7 (1) => _, 1 : vectorize ;
8 (m) => concat1(m - 1), ( _, 1 : vectorize) : concat;
12 (1, m) => concat1(m), 1 : vectorize;
13 (n, m) => concat2(n - 1, m), (concat1(m), 1 : vectorize) : concat;
16 make_input_matrix(n, m) = _, m : vectorize : _, n : vectorize ;
18 make_output_matrix(n, m) = concat2(n, m);
20 accumulate_vector(k) = _ <: sum(i, k, ( _, i : nth));
22 get_column(k, j) = _ <: par(p, k, ( _, p : nth : _, j : nth)) : concat1(k);
24 get_line(i) = _, i : nth;
26 make_line(i, k, m) = par(j, m, ( get_line(i), get_column(k, j) : * : accumulate_vector(k)));
28 multiply(n, k, m) = par(i, n, make_line(i, k, m));
30 matrix_mul(n, k, m) = make_input_matrix(n, k), make_input_matrix(k, m) <: multiply(n, k, m) : make_output_matrix(n, m);
32 matrix_output(n, m) = _ <: par(i, n, ( _, i : nth));
34 process = matrix_mul(10, 10, 10) : matrix_output(10, 10);