1 #define MAIN(x) linalg##x
5 static void test_mul(void)
9 a_float x
[3 * 3] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
10 a_float y
[3 * 3] = {9, 8, 7, 6, 5, 4, 3, 2, 1};
13 for (i
= 0; i
< 9; ++i
)
15 debug("%" A_FLOAT_PRI
"g%c", x
[i
], i
< 8 ? ',' : '}');
20 for (i
= 0; i
< 9; ++i
)
22 debug("%" A_FLOAT_PRI
"g%c", y
[i
], i
< 8 ? ',' : '}');
26 a_linalg_mulmm(z
, x
, y
, 3, 3, 3);
29 for (i
= 0; i
< 9; ++i
)
31 debug("%" A_FLOAT_PRI
"g%c", z
[i
], i
< 8 ? ',' : '}');
35 a_linalg_mulTm(z
, x
, y
, 3, 3, 3);
38 for (i
= 0; i
< 9; ++i
)
40 debug("%" A_FLOAT_PRI
"g%c", z
[i
], i
< 8 ? ',' : '}');
44 a_linalg_mulmT(z
, x
, y
, 3, 3, 3);
47 for (i
= 0; i
< 9; ++i
)
49 debug("%" A_FLOAT_PRI
"g%c", z
[i
], i
< 8 ? ',' : '}');
53 a_linalg_mulTT(z
, x
, y
, 3, 3, 3);
56 for (i
= 0; i
< 9; ++i
)
58 debug("%" A_FLOAT_PRI
"g%c", z
[i
], i
< 8 ? ',' : '}');
62 debug("X.Y\t=%" A_FLOAT_PRI
"g\n", a_linalg_dot(x
, y
, 9));
65 int main(int argc
, char *argv
[]) /* NOLINT(misc-definitions-in-headers) */
67 main_init(argc
, argv
, 1);