projects
/
Faustine.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of https://scm.cri.ensmp.fr/git/Faustine
[Faustine.git]
/
dsp_files
/
matrix_mul.dsp
diff --git
a/dsp_files/matrix_mul.dsp
b/dsp_files/matrix_mul.dsp
index
637954f
..
0b6ef9b
100644
(file)
--- a/
dsp_files/matrix_mul.dsp
+++ b/
dsp_files/matrix_mul.dsp
@@
-1,27
+1,22
@@
-vectorize = +;
-serialize = _ , 1 : +;
-concat = * ;
-nth = / ;
-
concat1 = case {
(1) => _, 1 : vectorize ;
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;
};
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);
};
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)));
make_line(i, k, m) = par(j, m, ( get_line(i), get_column(k, j) : * : accumulate_vector(k)));
@@
-29,7
+24,11
@@
multiply(n, k, m) = par(i, n, make_line(i, k, m));
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_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