/* this nearly works with ivextrema.c. The problem remaining, I think, is related to DUP making multiple copies of lacfns. Particularly when a Loop-fn contains a cond_fn, as in the code below. It might be fixable by making DUPap not traverse a Loop_fn from within itself. */ /* RESULT: with 99912 12 */ /* FILTER: no-no */ use Array: all; bool[.] ravel( bool[+] y) { z = _reshape_VxA_( [prod(shape(y))], y); return(z); } int main() { y = genarray( [10], [true, false, true, false]); x = transpose( y); z = ordotandBBBSTAR(x, y); z = sum((iota(16) * toi(ravel(z)))) - 20; return(z); } bool[+] ordotandBBBSTAR(bool[+]LARG, bool[+]RARG) { /* CDC STAR-100 APL Algorithm for inner product */ rowsx = drop([-1],shape(LARG)); colsx = shape(LARG)[[dim(LARG)-1]]; colsy = shape(RARG)[[dim(RARG)-1]]; Zrow = genarray([colsy],false); /* Parallel over rows of x */ z = with { (. <= row <= .) { Crow = Zrow; for (colx=0; colx