-vectorize = +;
-serialize = _ , 1 : +;
-concat = * ;
-nth = / ;
-
concat1 = case {
(1) => _, 1 : vectorize ;
- (m) => concat1(m - 1), ( _, 1 : vectorize) : concat;
+ (m) => concat1(m - 1), ( _, 1 : vectorize) : #;
};
concat2 = case {
(1, m) => concat1(m), 1 : vectorize;
- (n, m) => concat2(n - 1, m), (concat1(m), 1 : vectorize) : concat;
+ (n, m) => concat2(n - 1, m), (concat1(m), 1 : vectorize) : #;
};
make_input_matrix(n, m) = _, m : vectorize : _, n : vectorize ;
make_output_matrix(n, m) = concat2(n, m);
-accumulate_vector(k) = _ <: sum(i, k, ( _, i : nth));
+accumulate_vector(k) = _ <: sum(i, k, ( _, i : []));
-get_column(k, j) = _ <: par(p, k, ( _, p : nth : _, j : nth)) : concat1(k);
+get_column(k, j) = _ <: par(p, k, ( _, p : [] : _, j : [])) : concat1(k);
-get_line(i) = _, i : nth;
+get_line(i) = _, i : [];
make_line(i, k, m) = par(j, m, ( get_line(i), get_column(k, j) : * : accumulate_vector(k)));
matrix_mul(n, k, m) = make_input_matrix(n, k), make_input_matrix(k, m) <: multiply(n, k, m) : make_output_matrix(n, m);
-matrix_output(n, m) = _ <: par(i, n, ( _, i : nth));
+matrix_output(n, m) = _ <: par(i, n, ( _, i : []));
+
+matrix_mul_square(n) = matrix_mul(n, n, n) : matrix_output(n, n);
+
+//process = matrix_mul(3, 2, 3) : matrix_output(3, 3);
-process = matrix_mul(10, 10, 10) : matrix_output(10, 10);
-
\ No newline at end of file
+process = matrix_mul_square(3);
+
\ No newline at end of file