/* * * This was a bug in PMarray and friends, where they fail to chase * an N_id chain through guards. * * The two reverse operations should go away, being * folded into the match. */ use Array : {+,-,toi,match,iota,take,drop,sel,genarray}; /* RESULT: with 31 11 -noprfunr */ int main() { A_45=iota( 24); A_46=_reshape_VxA_([2, 3, 4],A_45); A_47=rotrXII( A_46); z = match(A_46, A_47); return(toi(z) - 1); } inline int[.,.,.] rotrXII(int[.,.,.] y) {/* Last axis reverse on rank>1 */ cellshape = [ (_shape_A_(y))[2] ]; frameshape = [2,3]; cell = genarray(cellshape, 0); z = with { ( . <= iv <= .) : y[iv]; } : genarray(frameshape, cell); return(z); }