static void convolution ( int [ ] x , int [ ] h , int n , int m ) {
  int row_vec [ ] = new int [ MAX_SIZE ] ;
  int col_vec [ ] = new int [ MAX_SIZE ] ;
  int out [ ] = new int [ MAX_SIZE ] ;
  int circular_shift_mat [ ] [ ] = new int [ MAX_SIZE ] [ MAX_SIZE ] ;
  int maxSize = n > m ? n : m ;
  for ( int i = 0 ;
  i < maxSize ;
  i ++ ) {
    if ( i >= n ) {
      row_vec [ i ] = 0 ;
    }
    else {
      row_vec [ i ] = x [ i ] ;
    }
  }
  for ( int i = 0 ;
  i < maxSize ;
  i ++ ) {
    if ( i >= m ) {
      col_vec [ i ] = 0 ;
    }
    else {
      col_vec [ i ] = h [ i ] ;
    }
  }
  int k = 0 , d = 0 ;
  for ( int i = 0 ;
  i < maxSize ;
  i ++ ) {
    int curIndex = k - d ;
    for ( int j = 0 ;
    j < maxSize ;
    j ++ ) {
      circular_shift_mat [ j ] [ i ] = row_vec [ curIndex % maxSize ] ;
      curIndex ++ ;
    }
    k = maxSize ;
    d ++ ;
  }
  for ( int i = 0 ;
  i < maxSize ;
  i ++ ) {
    for ( int j = 0 ;
    j < maxSize ;
    j ++ ) {
      out [ i ] += circular_shift_mat [ i ] [ j ] * col_vec [ j ] ;
    }
    System . out . print ( out [ i ] + " " ) ;
  }
}

static void convolution ( int [ ] x , int [ ] h , int n , int m ) { int row_vec [ ] = new int [ MAX_SIZE ] ; int col_vec [ ] = new int [ MAX_SIZE ] ; int out [ ] = new int [ MAX_SIZE ] ; int circular_shift_mat [ ] [ ] = new int [ MAX_SIZE ] [ MAX_SIZE ] ; int maxSize = n > m ? n : m ; for ( int i = 0 ; i < maxSize ; i ++ ) { if ( i >= n ) { row_vec [ i ] = 0 ; } else { row_vec [ i ] = x [ i ] ; } } for ( int i = 0 ; i < maxSize ; i ++ ) { if ( i >= m ) { col_vec [ i ] = 0 ; } else { col_vec [ i ] = h [ i ] ; } } int k = 0 , d = 0 ; for ( int i = 0 ; i < maxSize ; i ++ ) { int curIndex = k - d ; for ( int j = 0 ; j < maxSize ; j ++ ) { circular_shift_mat [ j ] [ i ] = row_vec [ curIndex % maxSize ] ; curIndex ++ ; } k = maxSize ; d ++ ; } for ( int i = 0 ; i < maxSize ; i ++ ) { for ( int j = 0 ; j < maxSize ; j ++ ) { out [ i ] += circular_shift_mat [ i ] [ j ] * col_vec [ j ] ; } System . out . print ( out [ i ] + " ▁ " ) ; } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier)) (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier)) dimensions: (dimensions_expr (identifier))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (ternary_expression condition: (binary_expression left: (identifier) right: (identifier)) consequence: (identifier) alternative: (identifier)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal)))) alternative: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (identifier)))))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal)))) alternative: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (identifier)))))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (identifier)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (identifier))))) (expression_statement (update_expression (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (update_expression (identifier))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (binary_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) right: (array_access array: (identifier) index: (identifier))))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (string_literal)))))))))