aboutsummaryrefslogtreecommitdiff
path: root/redist
diff options
context:
space:
mode:
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 );
}