From 00fbdfcbe9b1c3cc9f9f0814fe5f60bbf066cbbf Mon Sep 17 00:00:00 2001 From: Justin Berger Date: Sat, 17 Mar 2018 08:15:09 -0600 Subject: Added test target, mul test --- redist/test_dcl.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'redist') diff --git a/redist/test_dcl.c b/redist/test_dcl.c index adea7b5..a9512f8 100644 --- a/redist/test_dcl.c +++ b/redist/test_dcl.c @@ -1,8 +1,8 @@ #include "dclhelpers.h" +#include #include #include - int main() { FLT A[2][4] = { { 0, 1, 2, 3 }, { 4, 5, 6, 7} }; @@ -31,9 +31,25 @@ int main() printf( "The following should be an identity matrix\n" ); dclPrint( MM[0], 3, 3, 3 ); -//void dclTransp( DCL_FLOAT * R, int Rc, const DCL_FLOAT * A, int Ac, int n, int m ); + { + FLT A[3][4]; + dclIdentity(A[0], 4, 3); + dclPrint(A[0], 4, 3, 4); + + FLT x[4] = {7, 8, 9, 10}; + FLT R[4]; + + dclMul(R, 1, A[0], 4, x, 1, 4, 1, 3); + dclPrint(x, 1, 4, 1); + dclPrint(R, 1, 4, 1); + + for (int i = 0; i < 3; i++) + assert(R[i] == x[i]); + assert(R[3] == 0.); + } + // void dclTransp( DCL_FLOAT * R, int Rc, const DCL_FLOAT * A, int Ac, int n, int m ); -// dclIdentity( A[0], MATx, 5 ); -// dclPrint( A[0], MATx, MATx, MATy ); + // dclIdentity( A[0], MATx, 5 ); + // dclPrint( A[0], MATx, MATx, MATy ); } -- cgit v1.2.3