From 9115ffd3138b460707dd1ba45dd7f6fccde87a46 Mon Sep 17 00:00:00 2001 From: cnlohr Date: Sat, 17 Mar 2018 03:28:23 -0400 Subject: Test DCL. --- redist/dclhelpers.c | 4 ++-- redist/test_dcl.c | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 redist/test_dcl.c (limited to 'redist') diff --git a/redist/dclhelpers.c b/redist/dclhelpers.c index c3725f8..fb6aba6 100644 --- a/redist/dclhelpers.c +++ b/redist/dclhelpers.c @@ -5,9 +5,9 @@ #include "dclapack.h" #include -void dclPrint( const DCL_FLOAT * A, int Ac, int n, int m ) +void dclPrint( const DCL_FLOAT * PMATRIX, int PMATRIXc, int n, int m ) { - PRINT( A, n, m ); + PRINT( PMATRIX, n, m ); } void dclIdentity( DCL_FLOAT * I, int Ic, int n ) diff --git a/redist/test_dcl.c b/redist/test_dcl.c new file mode 100644 index 0000000..adea7b5 --- /dev/null +++ b/redist/test_dcl.c @@ -0,0 +1,39 @@ +#include "dclhelpers.h" +#include +#include + + +int main() +{ + FLT A[2][4] = { { 0, 1, 2, 3 }, { 4, 5, 6, 7} }; + FLT B[4][2]; + dclPrint( A[0], 4, 2, 4 ); + dclTransp( B[0], 2, A[0], 4, 2, 4 ); + dclPrint( B[0], 2, 4, 2 ); + + int i; + for( i = 0; i < 8; i++ ) + { + printf( "%f\n", ((float*)(B[0]))[i] ); + } + + FLT M[3][3] = { + { .32, 1, 0 }, + { 0, 1, 2 }, + { 1, 0, 1 } }; + FLT Mo[3][3]; + dclInv( Mo[0], 3, M[0], 3, 3 ); + dclPrint( Mo[0], 3, 3, 3 ); + + FLT MM[3][3]; + dclMul( MM[0], 3, M[0], 3, Mo[0], 3, 3, 3, 3 ); + + 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 ); + +// dclIdentity( A[0], MATx, 5 ); +// dclPrint( A[0], MATx, MATx, MATy ); +} + -- cgit v1.2.3