inline int dim( int [*] array) { return( _dim_( array)); } inline int[.] shape( int [*] array) { return( _shape_( array)); } inline int [*] sel( int[.] idx, int [*] array) { new_shape = _drop_SxV_( _sel_( [0], _shape_(idx)), _shape_(array)); res = with( . <= iv <= .) { new_idx = _cat_VxV_( idx, iv); } genarray( new_shape, _sel_(new_idx, array)); return( res); } inline int [*] sel( int idx, int [*] A) { return( sel( [idx], A)); } inline int ( + )( int A, int B) { return( _add_SxS_ ( A, B)); } inline int ( - )( int A, int B) { return( _sub_SxS_ ( A, B)); } inline int ( * )( int A, int B) { return( _mul_SxS_ ( A, B)); } inline bool ( == )( int A, int B) { return( _eq_ ( A, B)); } inline bool ( < )( int A, int B) { return( _lt_ ( A, B)); } inline bool ( > )( int A, int B) { return( _gt_ ( A, B)); } inline int [*] shift (int dimension, int count, int boundary, int [+] A) { if (count == 0) { result = A; } else { max_shift = _sel_( [dimension], _shape_(A)); if (count > 0) { count = _min_( count, max_shift); offset = _modarray_( _mul_SxA_( 0, _shape_(A)), [dimension], count); lb = offset; ub = _shape_(A); } else { count = _max_( count, _neg_(max_shift)); offset = _modarray_( _mul_SxA_( 0, _shape_(A)), [dimension], count); lb = _mul_SxA_( 0, _shape_(A)); ub = _add_AxA_( _shape_(A), offset); } result = with (. <= iv <= .) genarray( _shape_(A), boundary); result = with (lb <= iv < ub) { array_elem = _sel_( _sub_AxA_( iv, offset), A); } modarray( result, iv, array_elem); } return(result); } int main() { return ( 0); }