summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjofret2009-01-29 09:35:01 +0000
committerjofret2009-01-29 09:35:01 +0000
commite0eb6e054e3c86143271f12cf45a27ec9ebb3b0d (patch)
tree9702def1851fd63e9ddcc2fbcb70721c02a6c93f
parent1f7339c376d861032a473f290ec9d966821b879f (diff)
downloadscilab2c-e0eb6e054e3c86143271f12cf45a27ec9ebb3b0d.tar.gz
scilab2c-e0eb6e054e3c86143271f12cf45a27ec9ebb3b0d.tar.bz2
scilab2c-e0eb6e054e3c86143271f12cf45a27ec9ebb3b0d.zip
adding wired test
-rw-r--r--scilab2c/src/matrixOperations/multiplication/testDoubleMatrixMultiplication.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/scilab2c/src/matrixOperations/multiplication/testDoubleMatrixMultiplication.c b/scilab2c/src/matrixOperations/multiplication/testDoubleMatrixMultiplication.c
index e9b71a87..d1c210ea 100644
--- a/scilab2c/src/matrixOperations/multiplication/testDoubleMatrixMultiplication.c
+++ b/scilab2c/src/matrixOperations/multiplication/testDoubleMatrixMultiplication.c
@@ -118,6 +118,9 @@ static void dmulmaTest(void) {
double M8[6] = {1.0, 3.0, 5.0, 2.0, 4.0, 6.0};
double M7_by_M8[4];
double miscM7_by_M8[9];
+ double M9[6] = {1, 4, 2, 5, 3, 6};
+ double M10[9] = {4, 8, 3, 2, 8, 4, 3, 4, 5};
+ double M9_by_M10[6];
int i = 0;
@@ -192,6 +195,23 @@ static void dmulmaTest(void) {
assert(miscM7_by_M8[6] == 34.0);
assert(miscM7_by_M8[7] == 34.0);
assert(miscM7_by_M8[8] == 44.0);
+
+ /*
+ [ 1 2 3 ] * [ 4 2 3 ] = [ 29 30 26 ]
+ [ 4 5 6 ] [ 8 8 4 ] [ 74 72 62 ]
+ [ 3 4 5 ]
+ */
+ dmulma(M9, 2, 3, M10, 3, 3, M9_by_M10);
+ for (i = 0; i < 6; ++i) {
+ printf("M9_by_M10[%d] = %e\n", i, M9_by_M10[i]);
+ }
+ assert(M9_by_M10[0] == 29.0);
+ assert(M9_by_M10[1] == 74.0);
+ assert(M9_by_M10[2] == 30.0);
+ assert(M9_by_M10[3] == 72.0);
+ assert(M9_by_M10[4] == 26.0);
+ assert(M9_by_M10[5] == 62.0);
+
}
static int testDoubleMultiplication(void) {