aboutsummaryrefslogtreecommitdiff
path: root/redist
diff options
context:
space:
mode:
authorJustin Berger <j.david.berger@gmail.com>2018-03-17 08:15:09 -0600
committerJustin Berger <j.david.berger@gmail.com>2018-03-17 08:15:09 -0600
commit00fbdfcbe9b1c3cc9f9f0814fe5f60bbf066cbbf (patch)
treef5d3e39b77515fd31f0117a27b0d50d36626e94a /redist
parent9115ffd3138b460707dd1ba45dd7f6fccde87a46 (diff)
downloadlibsurvive-00fbdfcbe9b1c3cc9f9f0814fe5f60bbf066cbbf.tar.gz
libsurvive-00fbdfcbe9b1c3cc9f9f0814fe5f60bbf066cbbf.tar.bz2
Added test target, mul test
Diffstat (limited to 'redist')
-rw-r--r--redist/test_dcl.c24
1 files changed, 20 insertions, 4 deletions
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 <assert.h>
#include <stdint.h>
#include <stdio.h>
-
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 );
}