#define INCLUDES APLCB+APLMAIN+STDIO #include "includes.h" main() { Endoper; Getcb; Indexm; Ivalue; Litvect; Perm; Quadout; Reshape; Setix; Shape; Temp; Aplcb m,n; #include "aplinit.h" m = perm( quadout( /* ------------------------------> 3 1 4 2 */ reshape( /* 1 4 4 1 */ litvect("2 4"), litvect("3 1 4 2 1 4 4 1") ) ) ); n = getcb(NULL, /* dataptr */ ivalue(shape(shape(m))), /* datacnt */ APLAPL + APLTEMP, /* datatyp */ 1,NULL); /* rank, dimptr */ setix(n,1,NULL); /* index to 1st dimension */ setix(n,2,m); /* index to 2nd dimension */ endoper(quadout(indexm(m,n,NULL))); /* --------> 4 3 2 1 */ endoper(temp(m)); /* 3 2 2 3 */ /* */ /* 4 1 1 4 */ /* 1 1 1 1 */ }