Changeset 1406 for trunk/psLib/test/dataManip/tst_psMatrix06.c
- Timestamp:
- Aug 6, 2004, 12:34:06 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/dataManip/tst_psMatrix06.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/dataManip/tst_psMatrix06.c
r1348 r1406 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-0 7-30 03:48:15$12 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-06 22:34:06 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 22 22 #define PRINT_MATRIX(IMAGE) \ 23 23 for(int i=0; i<IMAGE->numRows; i++) { \ 24 for(int j=0; j<IMAGE->numCols; j++) { \25 printf("%f ", IMAGE->data.F64[i][j]); \26 } \27 printf("\n"); \28 }29 30 24 for(int j=0; j<IMAGE->numCols; j++) { \ 25 printf("%f ", IMAGE->data.F64[i][j]); \ 26 } \ 27 printf("\n"); \ 28 } 29 30 31 31 int main( int argc, 32 32 char* argv[] ) … … 34 34 psImage * outImage = NULL; 35 35 psImage *inImage = NULL; 36 37 36 37 38 38 // Test A - Create input and output images 39 39 printPositiveTestHeader( stdout, "psMatrix", "Create input and output images" ); 40 40 outImage = ( psImage* ) psImageAlloc( 4, 4, PS_TYPE_F64 ); 41 41 inImage = ( psImage* ) psImageAlloc( 4, 4, PS_TYPE_F64 ); 42 42 43 43 inImage->data.F64[ 0 ][ 0 ] = 1. / 1.; 44 44 inImage->data.F64[ 0 ][ 1 ] = 1. / 2.; 45 45 inImage->data.F64[ 0 ][ 2 ] = 1. / 3.; 46 46 inImage->data.F64[ 0 ][ 3 ] = 1. / 4.; 47 47 48 48 inImage->data.F64[ 1 ][ 0 ] = 1. / 2.; 49 49 inImage->data.F64[ 1 ][ 1 ] = 1. / 3.; 50 50 inImage->data.F64[ 1 ][ 2 ] = 1. / 4.; 51 51 inImage->data.F64[ 1 ][ 3 ] = 1. / 5.; 52 52 53 53 inImage->data.F64[ 2 ][ 0 ] = 1. / 3.; 54 54 inImage->data.F64[ 2 ][ 1 ] = 1. / 4.; 55 55 inImage->data.F64[ 2 ][ 2 ] = 1. / 5.; 56 56 inImage->data.F64[ 2 ][ 3 ] = 1. / 6.; 57 57 58 58 inImage->data.F64[ 3 ][ 0 ] = 1. / 4.; 59 59 inImage->data.F64[ 3 ][ 1 ] = 1. / 5.; 60 60 inImage->data.F64[ 3 ][ 2 ] = 1. / 6.; 61 61 inImage->data.F64[ 3 ][ 3 ] = 1. / 7.; 62 62 63 63 PRINT_MATRIX( inImage ); 64 64 printFooter( stdout, "psMatrix", "Create input and output images", true ); 65 66 65 66 67 67 // Test B - Calculate Eigenvectors 68 68 printPositiveTestHeader( stdout, "psMatrix", "Calculate Eigenvectors" ); … … 70 70 PRINT_MATRIX( outImage ); 71 71 printFooter( stdout, "psMatrix", "Calculate Eigenvectors", true ); 72 73 72 73 74 74 // Test C - Free input and output images 75 75 printPositiveTestHeader( stdout, "psMatrix", "Free input and output images" ); … … 78 78 int nLeaks = psMemCheckLeaks( 0, NULL, stdout ); 79 79 if ( nLeaks != 0 ) { 80 printf( "ERROR: Found %d memory leaks\n", nLeaks );81 }80 printf( "ERROR: Found %d memory leaks\n", nLeaks ); 81 } 82 82 int nBad = psMemCheckCorruption( 0 ); 83 83 if ( nBad ) { 84 printf( "ERROR: Found %d bad memory blocks\n", nBad );85 }84 printf( "ERROR: Found %d bad memory blocks\n", nBad ); 85 } 86 86 printFooter( stdout, "psMatrix" , "Free input and output images", true ); 87 87 88 88 return 0; 89 89 }
Note:
See TracChangeset
for help on using the changeset viewer.
