Changeset 2204 for trunk/psLib/test/dataManip
- Timestamp:
- Oct 26, 2004, 2:57:34 PM (22 years ago)
- Location:
- trunk/psLib/test/dataManip
- Files:
-
- 42 edited
-
tst_psFunc00.c (modified) (2 diffs)
-
tst_psFunc01.c (modified) (2 diffs)
-
tst_psFunc02.c (modified) (1 diff)
-
tst_psFunc03.c (modified) (1 diff)
-
tst_psFunc04.c (modified) (3 diffs)
-
tst_psFunc05.c (modified) (1 diff)
-
tst_psFunc07.c (modified) (3 diffs)
-
tst_psHist00.c (modified) (1 diff)
-
tst_psHist01.c (modified) (1 diff)
-
tst_psHist02.c (modified) (2 diffs)
-
tst_psHist03.c (modified) (1 diff)
-
tst_psMatrix01.c (modified) (4 diffs)
-
tst_psMatrix02.c (modified) (2 diffs)
-
tst_psMatrix03.c (modified) (4 diffs)
-
tst_psMatrix04.c (modified) (4 diffs)
-
tst_psMatrix05.c (modified) (4 diffs)
-
tst_psMatrix06.c (modified) (4 diffs)
-
tst_psMatrix07.c (modified) (4 diffs)
-
tst_psMatrixVectorArithmetic01.c (modified) (8 diffs)
-
tst_psMatrixVectorArithmetic02.c (modified) (9 diffs)
-
tst_psMatrixVectorArithmetic03.c (modified) (6 diffs)
-
tst_psMinimize00.c (modified) (3 diffs)
-
tst_psMinimize01.c (modified) (3 diffs)
-
tst_psMinimize02.c (modified) (3 diffs)
-
tst_psMinimize03.c (modified) (3 diffs)
-
tst_psMinimize04.c (modified) (6 diffs)
-
tst_psMinimize04_F32.c (modified) (6 diffs)
-
tst_psMinimize04b.c (modified) (6 diffs)
-
tst_psMinimize04b_F32.c (modified) (6 diffs)
-
tst_psMinimize05.c (modified) (9 diffs)
-
tst_psMinimize06.c (modified) (5 diffs)
-
tst_psStats00.c (modified) (2 diffs)
-
tst_psStats01.c (modified) (2 diffs)
-
tst_psStats02.c (modified) (2 diffs)
-
tst_psStats03.c (modified) (2 diffs)
-
tst_psStats04.c (modified) (1 diff)
-
tst_psStats05.c (modified) (1 diff)
-
tst_psStats06.c (modified) (2 diffs)
-
tst_psStats07.c (modified) (7 diffs)
-
tst_psStats08.c (modified) (2 diffs)
-
tst_psStats09.c (modified) (2 diffs)
-
tst_psVectorFFT.c (modified) (19 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/dataManip/tst_psFunc00.c
r1985 r2204 22 22 #define CN 6 23 23 #define DN 8 24 intmain()24 psS32 main() 25 25 { 26 26 psPolynomial1D *my1DPoly = NULL; … … 32 32 psDPolynomial3D *my3DPolyD = NULL; 33 33 psDPolynomial4D *my4DPolyD = NULL; 34 inttestStatus = true;35 intmemLeaks = 0;36 inta = 0;37 intb = 0;38 intc = 0;39 intd = 0;40 intcurrentId = 0;34 psS32 testStatus = true; 35 psS32 memLeaks = 0; 36 psS32 a = 0; 37 psS32 b = 0; 38 psS32 c = 0; 39 psS32 d = 0; 40 psS32 currentId = 0; 41 41 42 42 currentId = psMemGetId(); -
trunk/psLib/test/dataManip/tst_psFunc01.c
r1811 r2204 13 13 #define MY_STDEV 2.0 14 14 #define N 30 15 intmain()15 psS32 main() 16 16 { 17 inttestStatus = true;17 psS32 testStatus = true; 18 18 float x = 0.0; 19 intmemLeaks;20 intcurrentId = psMemGetId();19 psS32 memLeaks; 20 psS32 currentId = psMemGetId(); 21 21 psVector *myGaussData = NULL; 22 22 printPositiveTestHeader(stdout, … … 52 52 53 53 myGaussData = psGaussianDev(MY_MEAN, MY_STDEV, N); 54 for ( inti = 0; i < N ; i++) {54 for (psS32 i = 0; i < N ; i++) { 55 55 printf("Gaussian Deviate [%d] is %f\n", i, myGaussData->data.F32[i]); 56 56 } -
trunk/psLib/test/dataManip/tst_psFunc02.c
r1946 r2204 14 14 #define CUBIC 3 15 15 16 intmain()16 psS32 main() 17 17 { 18 inttestStatus = true;19 intmemLeaks=0;20 inti;21 intcurrentId = psMemGetId();18 psS32 testStatus = true; 19 psS32 memLeaks=0; 20 psS32 i; 21 psS32 currentId = psMemGetId(); 22 22 psSpline1D *tmpSpline; 23 23 -
trunk/psLib/test/dataManip/tst_psFunc03.c
r1946 r2204 15 15 #define CUBIC 3 16 16 17 intmain()17 psS32 main() 18 18 { 19 inttestStatus = true;20 intmemLeaks=0;21 inti;22 intcurrentId = psMemGetId();19 psS32 testStatus = true; 20 psS32 memLeaks=0; 21 psS32 i; 22 psS32 currentId = psMemGetId(); 23 23 psSpline1D *tmpSpline; 24 24 psVector *bounds; -
trunk/psLib/test/dataManip/tst_psFunc04.c
r1982 r2204 17 17 #define N 8 18 18 19 intt00()19 psS32 t00() 20 20 { 21 inttestStatus = true;22 intmemLeaks=0;23 inti;21 psS32 testStatus = true; 22 psS32 memLeaks=0; 23 psS32 i; 24 24 float x; 25 25 float y; 26 intcurrentId = psMemGetId();26 psS32 currentId = psMemGetId(); 27 27 psSpline1D *tmpSpline; 28 28 psVector *data; … … 69 69 } 70 70 71 intt01()71 psS32 t01() 72 72 { 73 inttestStatus = true;74 intmemLeaks=0;75 inti;73 psS32 testStatus = true; 74 psS32 memLeaks=0; 75 psS32 i; 76 76 float x; 77 77 float y; 78 intcurrentId = psMemGetId();78 psS32 currentId = psMemGetId(); 79 79 psSpline1D *tmpSpline; 80 80 psVector *data; … … 121 121 } 122 122 123 intmain()123 psS32 main() 124 124 { 125 125 t00(); -
trunk/psLib/test/dataManip/tst_psFunc05.c
r1991 r2204 18 18 #define SPLINE_ORDER 1 19 19 20 intmain()20 psS32 main() 21 21 { 22 inttestStatus = true;23 intmemLeaks=0;24 inti;25 intcurrentId = psMemGetId();22 psS32 testStatus = true; 23 psS32 memLeaks=0; 24 psS32 i; 25 psS32 currentId = psMemGetId(); 26 26 psSpline1D *tmpSpline; 27 27 psVector *data; -
trunk/psLib/test/dataManip/tst_psFunc07.c
r1985 r2204 32 32 } 33 33 34 intt00()34 psS32 t00() 35 35 { 36 inttestStatus = true;37 intmemLeaks=0;38 intcurrentId = psMemGetId();39 inti;36 psS32 testStatus = true; 37 psS32 memLeaks=0; 38 psS32 currentId = psMemGetId(); 39 psS32 i; 40 40 psSpline1D *tmpSpline = NULL; 41 41 psVector *x = NULL; … … 101 101 102 102 // This is the F64 version of the above test code. 103 intt01()103 psS32 t01() 104 104 { 105 inttestStatus = true;106 intmemLeaks=0;107 intcurrentId = psMemGetId();108 inti;105 psS32 testStatus = true; 106 psS32 memLeaks=0; 107 psS32 currentId = psMemGetId(); 108 psS32 i; 109 109 psSpline1D *tmpSpline = NULL; 110 110 psVector *x = NULL; … … 169 169 } 170 170 171 intmain()171 psS32 main() 172 172 { 173 173 t00(); -
trunk/psLib/test/dataManip/tst_psHist00.c
r1811 r2204 10 10 #define UPPER 30.0 11 11 12 intmain()12 psS32 main() 13 13 { 14 14 psHistogram *myHist = NULL; 15 inttestStatus = true;16 intmemLeaks = 0;17 inti = 0;18 intnb = 0;19 intnumBins = 0;20 intcurrentId = 0;15 psS32 testStatus = true; 16 psS32 memLeaks = 0; 17 psS32 i = 0; 18 psS32 nb = 0; 19 psS32 numBins = 0; 20 psS32 currentId = 0; 21 21 22 22 currentId = psMemGetId(); -
trunk/psLib/test/dataManip/tst_psHist01.c
r1811 r2204 10 10 #define UPPER 30.0 11 11 12 intmain()12 psS32 main() 13 13 { 14 14 psHistogram *myHist = NULL; 15 15 psVector *myBounds = NULL; 16 inttestStatus = true;17 intmemLeaks = 0;18 inti = 0;19 intnb = 0;20 intnumBins = 0;21 intcurrentId = 0;16 psS32 testStatus = true; 17 psS32 memLeaks = 0; 18 psS32 i = 0; 19 psS32 nb = 0; 20 psS32 numBins = 0; 21 psS32 currentId = 0; 22 22 23 23 currentId = psMemGetId(); -
trunk/psLib/test/dataManip/tst_psHist02.c
r1811 r2204 14 14 #define NUM_DATA 10000 15 15 16 intmain()16 psS32 main() 17 17 { 18 18 psHistogram * myHist = NULL; … … 20 20 psVector *myData = NULL; 21 21 psVector *myMask = NULL; 22 inttestStatus = true;23 intmemLeaks = 0;24 intnb = 0;25 intnumBins = 0;26 inti = 0;27 intcurrentId = 0;22 psS32 testStatus = true; 23 psS32 memLeaks = 0; 24 psS32 nb = 0; 25 psS32 numBins = 0; 26 psS32 i = 0; 27 psS32 currentId = 0; 28 28 29 29 currentId = psMemGetId(); -
trunk/psLib/test/dataManip/tst_psHist03.c
r1824 r2204 12 12 #define NUM_DATA 20 13 13 14 intmain()14 psS32 main() 15 15 { 16 16 psHistogram *myHist = NULL; 17 17 psVector *myBounds = NULL; 18 18 psVector *myData = psVectorAlloc( NUM_DATA, PS_TYPE_F32 ); 19 inttestStatus = true;20 intmemLeaks = 0;21 inti = 0;22 intnb = 0;23 intnumBins = 0;24 intcurrentId = 0;19 psS32 testStatus = true; 20 psS32 memLeaks = 0; 21 psS32 i = 0; 22 psS32 nb = 0; 23 psS32 numBins = 0; 24 psS32 currentId = 0; 25 25 26 26 currentId = psMemGetId(); -
trunk/psLib/test/dataManip/tst_psMatrix01.c
r1406 r2204 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $14 * @date $Date: 2004- 08-06 22:34:06$13 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-10-27 00:57:33 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 22 22 23 23 #define PRINT_MATRIX(IMAGE) \ 24 for( inti=IMAGE->numRows-1; i>-1; i--) { \25 for( intj=0; j<IMAGE->numCols; j++) { \24 for(psS32 i=IMAGE->numRows-1; i>-1; i--) { \ 25 for(psS32 j=0; j<IMAGE->numCols; j++) { \ 26 26 printf("%f ", IMAGE->data.F64[i][j]); \ 27 27 } \ … … 29 29 } 30 30 31 int main( intargc,32 char* argv[] )31 psS32 main( psS32 argc, 32 char* argv[] ) 33 33 { 34 34 psImage * tempImage = NULL; … … 79 79 psFree( outImage ); 80 80 psFree( outImageNull ); 81 intnLeaks = psMemCheckLeaks( 0, NULL, stdout );81 psS32 nLeaks = psMemCheckLeaks( 0, NULL, stdout ); 82 82 if ( nLeaks != 0 ) { 83 83 printf( "ERROR: Found %d memory leaks\n", nLeaks ); 84 84 } 85 intnBad = psMemCheckCorruption( 0 );85 psS32 nBad = psMemCheckCorruption( 0 ); 86 86 if ( nBad ) { 87 87 printf( "ERROR: Found %d bad memory blocks\n", nBad ); -
trunk/psLib/test/dataManip/tst_psMatrix02.c
r1406 r2204 13 13 * @author Ross Harman, MHPCC 14 14 * 15 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $16 * @date $Date: 2004- 08-06 22:34:06$15 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2004-10-27 00:57:33 $ 17 17 * 18 18 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 23 23 #include "psTest.h" 24 24 25 int main(intargc,26 char* argv[])25 psS32 main(psS32 argc, 26 char* argv[]) 27 27 { 28 28 psImage *nullImage = NULL; -
trunk/psLib/test/dataManip/tst_psMatrix03.c
r1406 r2204 14 14 * @author Ross Harman, MHPCC 15 15 * 16 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $17 * @date $Date: 2004- 08-06 22:34:06$16 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 17 * @date $Date: 2004-10-27 00:57:33 $ 18 18 * 19 19 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 25 25 26 26 #define PRINT_MATRIX(IMAGE) \ 27 for( inti=IMAGE->numRows-1; i>-1; i--) { \28 for( intj=0; j<IMAGE->numCols; j++) { \27 for(psS32 i=IMAGE->numRows-1; i>-1; i--) { \ 28 for(psS32 j=0; j<IMAGE->numCols; j++) { \ 29 29 printf("%f ", IMAGE->data.F64[i][j]); \ 30 30 } \ … … 33 33 \ 34 34 #define PRINT_VECTOR(VECTOR) \ 35 for( inti=0; i<VECTOR->n; i++) { \35 for(psS32 i=0; i<VECTOR->n; i++) { \ 36 36 printf("%f\n", VECTOR->data.F64[i]); \ 37 37 } 38 38 39 39 40 int main(intargc,41 char* argv[])40 psS32 main(psS32 argc, 41 char* argv[]) 42 42 { 43 43 psImage *luImage = NULL; … … 112 112 psFree(inVector); 113 113 psMemCheckLeaks(0, NULL, stdout); 114 intnBad = psMemCheckCorruption(0);114 psS32 nBad = psMemCheckCorruption(0); 115 115 if(nBad) { 116 116 printf("ERROR: Found %d bad memory blocks\n", nBad); -
trunk/psLib/test/dataManip/tst_psMatrix04.c
r1406 r2204 13 13 * @author Ross Harman, MHPCC 14 14 * 15 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $16 * @date $Date: 2004- 08-06 22:34:06$15 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2004-10-27 00:57:33 $ 17 17 * 18 18 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 24 24 25 25 #define PRINT_MATRIX(IMAGE) \ 26 for( inti=IMAGE->numRows-1; i>-1; i--) { \27 for( intj=0; j<IMAGE->numCols; j++) { \26 for(psS32 i=IMAGE->numRows-1; i>-1; i--) { \ 27 for(psS32 j=0; j<IMAGE->numCols; j++) { \ 28 28 printf("%f ", IMAGE->data.F64[i][j]); \ 29 29 } \ … … 32 32 33 33 34 int main(intargc,35 char* argv[])34 psS32 main(psS32 argc, 35 char* argv[]) 36 36 { 37 37 float det = 0.0f; … … 87 87 psFree(det2); 88 88 psMemCheckLeaks(0, NULL, stdout); 89 intnBad = psMemCheckCorruption(0);89 psS32 nBad = psMemCheckCorruption(0); 90 90 if(nBad) { 91 91 printf("ERROR: Found %d bad memory blocks\n", nBad); -
trunk/psLib/test/dataManip/tst_psMatrix05.c
r1406 r2204 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $13 * @date $Date: 2004- 08-06 22:34:06$12 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-10-27 00:57:33 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 21 21 22 22 #define PRINT_MATRIX(IMAGE) \ 23 for( inti=0; i<IMAGE->numRows; i++) { \24 for( intj=0; j<IMAGE->numCols; j++) { \23 for(psS32 i=0; i<IMAGE->numRows; i++) { \ 24 for(psS32 j=0; j<IMAGE->numCols; j++) { \ 25 25 printf("%f ", IMAGE->data.F64[i][j]); \ 26 26 } \ … … 29 29 30 30 31 int main( intargc,32 char* argv[] )31 psS32 main( psS32 argc, 32 char* argv[] ) 33 33 { 34 34 psImage * outImage = NULL; … … 68 68 psFree( inImage1 ); 69 69 psFree( inImage2 ); 70 intnLeaks = psMemCheckLeaks( 0, NULL, stdout );70 psS32 nLeaks = psMemCheckLeaks( 0, NULL, stdout ); 71 71 if ( nLeaks != 0 ) { 72 72 printf( "ERROR: Found %d memory leaks\n", nLeaks ); 73 73 } 74 intnBad = psMemCheckCorruption( 0 );74 psS32 nBad = psMemCheckCorruption( 0 ); 75 75 if ( nBad ) { 76 76 printf( "ERROR: Found %d bad memory blocks\n", nBad ); -
trunk/psLib/test/dataManip/tst_psMatrix06.c
r1406 r2204 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $13 * @date $Date: 2004- 08-06 22:34:06$12 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-10-27 00:57:33 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 21 21 22 22 #define PRINT_MATRIX(IMAGE) \ 23 for( inti=0; i<IMAGE->numRows; i++) { \24 for( intj=0; j<IMAGE->numCols; j++) { \23 for(psS32 i=0; i<IMAGE->numRows; i++) { \ 24 for(psS32 j=0; j<IMAGE->numCols; j++) { \ 25 25 printf("%f ", IMAGE->data.F64[i][j]); \ 26 26 } \ … … 29 29 30 30 31 int main( intargc,32 char* argv[] )31 psS32 main( psS32 argc, 32 char* argv[] ) 33 33 { 34 34 psImage * outImage = NULL; … … 76 76 psFree( outImage ); 77 77 psFree( inImage ); 78 intnLeaks = psMemCheckLeaks( 0, NULL, stdout );78 psS32 nLeaks = psMemCheckLeaks( 0, NULL, stdout ); 79 79 if ( nLeaks != 0 ) { 80 80 printf( "ERROR: Found %d memory leaks\n", nLeaks ); 81 81 } 82 intnBad = psMemCheckCorruption( 0 );82 psS32 nBad = psMemCheckCorruption( 0 ); 83 83 if ( nBad ) { 84 84 printf( "ERROR: Found %d bad memory blocks\n", nBad ); -
trunk/psLib/test/dataManip/tst_psMatrix07.c
r1406 r2204 16 16 * @author Ross Harman, MHPCC 17 17 * 18 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $19 * @date $Date: 2004- 08-06 22:34:06$18 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 19 * @date $Date: 2004-10-27 00:57:33 $ 20 20 * 21 21 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 27 27 28 28 #define PRINT_MATRIX(IMAGE) \ 29 for( inti=0; i<IMAGE->numRows; i++) { \30 for( intj=0; j<IMAGE->numCols; j++) { \29 for(psS32 i=0; i<IMAGE->numRows; i++) { \ 30 for(psS32 j=0; j<IMAGE->numCols; j++) { \ 31 31 printf("%f ", IMAGE->data.F64[i][j]); \ 32 32 } \ … … 35 35 36 36 #define PRINT_VECTOR(VECTOR) \ 37 for( inti=0; i<VECTOR->n; i++) { \37 for(psS32 i=0; i<VECTOR->n; i++) { \ 38 38 printf("%f\n", VECTOR->data.F64[i]); \ 39 39 } 40 40 41 41 42 int main(intargc,43 char* argv[])42 psS32 main(psS32 argc, 43 char* argv[]) 44 44 { 45 45 psVector *v1 = NULL; … … 169 169 psFree(badImage); 170 170 psMemCheckLeaks(0, NULL, stdout); 171 intnBad = psMemCheckCorruption(0);171 psS32 nBad = psMemCheckCorruption(0); 172 172 if(nBad) { 173 173 printf("ERROR: Found %d bad memory blocks\n", nBad); -
trunk/psLib/test/dataManip/tst_psMatrixVectorArithmetic01.c
r1648 r2204 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $13 * @date $Date: 2004- 08-27 23:31:22$12 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-10-27 00:57:33 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 24 24 printf("%f+%fi ", creal(SCALAR->data.TYPE), cimag(SCALAR->data.TYPE)); \ 25 25 } else if(PS_IS_PSELEMTYPE_INT(SCALAR->type.type)) { \ 26 printf("%d ", ( int)SCALAR->data.TYPE); \26 printf("%d ", (psS32)SCALAR->data.TYPE); \ 27 27 } else { \ 28 28 printf("%f ", (double)SCALAR->data.TYPE); \ … … 31 31 32 32 #define PRINT_VECTOR(VECTOR,TYPE) \ 33 for( inti=0; i<VECTOR->n; i++) { \33 for(psS32 i=0; i<VECTOR->n; i++) { \ 34 34 if(PS_IS_PSELEMTYPE_COMPLEX(VECTOR->type.type)) { \ 35 35 printf("%f+%fi ", creal(VECTOR->data.TYPE[i]), cimag(VECTOR->data.TYPE[i])); \ 36 36 } else if(PS_IS_PSELEMTYPE_INT(VECTOR->type.type)) { \ 37 printf("%d ", ( int)VECTOR->data.TYPE[i]); \37 printf("%d ", (psS32)VECTOR->data.TYPE[i]); \ 38 38 } else { \ 39 39 printf("%f ", (double)VECTOR->data.TYPE[i]); \ … … 44 44 45 45 #define PRINT_MATRIX(IMAGE,TYPE) \ 46 for( inti=IMAGE->numRows-1; i>-1; i--) { \47 for( intj=0; j<IMAGE->numCols; j++) { \46 for(psS32 i=IMAGE->numRows-1; i>-1; i--) { \ 47 for(psS32 j=0; j<IMAGE->numCols; j++) { \ 48 48 if(PS_IS_PSELEMTYPE_COMPLEX(IMAGE->type.type)) { \ 49 49 printf("%f+%fi ", creal(IMAGE->data.TYPE[i][j]), cimag(IMAGE->data.TYPE[i][j])); \ 50 50 } else if(PS_IS_PSELEMTYPE_INT(IMAGE->type.type)) { \ 51 printf("%d ", ( int)IMAGE->data.TYPE[i][j]); \51 printf("%d ", (psS32)IMAGE->data.TYPE[i][j]); \ 52 52 } else { \ 53 53 printf("%f ", (double)IMAGE->data.TYPE[i][j]); \ … … 61 61 #define CREATE_AND_SET_VECTOR(NAME,TYPE,VALUE,SIZE) \ 62 62 psVector *NAME = (psVector*)psVectorAlloc(SIZE, PS_TYPE_##TYPE); \ 63 for( inti=0; i<SIZE; i++) { \63 for(psS32 i=0; i<SIZE; i++) { \ 64 64 NAME->data.TYPE[i] = VALUE; \ 65 65 } \ … … 69 69 #define CREATE_AND_SET_IMAGE(NAME,TYPE,VALUE,NROWS,NCOLS) \ 70 70 psImage *NAME = (psImage*)psImageAlloc(NCOLS,NROWS,PS_TYPE_##TYPE); \ 71 for( inti=0; i<NAME->numRows; i++) { \72 for( intj=0; j<NAME->numCols; j++) { \71 for(psS32 i=0; i<NAME->numRows; i++) { \ 72 for(psS32 j=0; j<NAME->numCols; j++) { \ 73 73 NAME->data.TYPE[i][j] = VALUE; \ 74 74 } \ … … 78 78 #define CHECK_MEMORY \ 79 79 psMemCheckLeaks(0, NULL, stdout); \ 80 intnBad = psMemCheckCorruption(0); \80 psS32 nBad = psMemCheckCorruption(0); \ 81 81 if(nBad) { \ 82 82 printf("ERROR: Found %d bad memory blocks\n", nBad); \ … … 84 84 85 85 86 int main(intargc, char* argv[])86 psS32 main(psS32 argc, char* argv[]) 87 87 { 88 88 -
trunk/psLib/test/dataManip/tst_psMatrixVectorArithmetic02.c
r2057 r2204 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-10- 12 20:50:40$12 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-10-27 00:57:33 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 24 24 25 25 #define CHECK_VECTOR(VECTOR,TYPE,TRUTH) \ 26 for( inti=0; i<VECTOR->n; i++) { \26 for(psS32 i=0; i<VECTOR->n; i++) { \ 27 27 if(cabs(VECTOR->data.TYPE[i])-cabs(TRUTH) > FLT_EPSILON){ \ 28 28 printf("ERROR:Truth and calculated values don't match for vector operation:\n"); \ … … 31 31 printf("Calculated: %.2f%+.2fi\n", creal(TRUTH), cimag(TRUTH)); \ 32 32 } else if(PS_IS_PSELEMTYPE_INT(VECTOR->type.type)) { \ 33 printf("Truth: %d\n", ( int)(VECTOR->data.TYPE[i])); \34 printf("Calculated: %d\n", ( int)(TRUTH)); \33 printf("Truth: %d\n", (psS32)(VECTOR->data.TYPE[i])); \ 34 printf("Calculated: %d\n", (psS32)(TRUTH)); \ 35 35 } else { \ 36 36 printf("Truth: %.2f\n", (double)(VECTOR->data.TYPE[i])); \ … … 43 43 44 44 #define CHECK_MATRIX(IMAGE,TYPE,TRUTH) \ 45 for( inti=IMAGE->numRows-1; i>-1; i--) { \46 for( intj=0; j<IMAGE->numCols; j++) { \45 for(psS32 i=IMAGE->numRows-1; i>-1; i--) { \ 46 for(psS32 j=0; j<IMAGE->numCols; j++) { \ 47 47 if(cabs(IMAGE->data.TYPE[i][j])-cabs(TRUTH) > FLT_EPSILON){ \ 48 48 printf("ERROR:Truth and calculated values don't match for matrix operation:\n"); \ … … 51 51 printf("Calculated: %.2f%+.2fi\n", creal(TRUTH), cimag(TRUTH)); \ 52 52 } else if(PS_IS_PSELEMTYPE_INT(IMAGE->type.type)) { \ 53 printf("Truth: %d\n", ( int)(IMAGE->data.TYPE[i][j])); \54 printf("Calculated: %d\n", ( int)(TRUTH)); \53 printf("Truth: %d\n", (psS32)(IMAGE->data.TYPE[i][j])); \ 54 printf("Calculated: %d\n", (psS32)(TRUTH)); \ 55 55 } else { \ 56 56 printf("Truth: %.2f\n", (double)(IMAGE->data.TYPE[i][j])); \ … … 66 66 #define CREATE_AND_SET_VECTOR(NAME,TYPE,VALUE,SIZE) \ 67 67 psVector *NAME = (psVector*)psVectorAlloc(SIZE, PS_TYPE_##TYPE); \ 68 for( inti=0; i<SIZE; i++) { \68 for(psS32 i=0; i<SIZE; i++) { \ 69 69 NAME->data.TYPE[i] = VALUE; \ 70 70 } \ … … 74 74 #define CREATE_AND_SET_IMAGE(NAME,TYPE,VALUE,NROWS,NCOLS) \ 75 75 psImage *NAME = (psImage*)psImageAlloc(NCOLS,NROWS,PS_TYPE_##TYPE); \ 76 for( inti=0; i<NAME->numRows; i++) { \77 for( intj=0; j<NAME->numCols; j++) { \76 for(psS32 i=0; i<NAME->numRows; i++) { \ 77 for(psS32 j=0; j<NAME->numCols; j++) { \ 78 78 NAME->data.TYPE[i][j] = VALUE; \ 79 79 } \ … … 86 86 return 50; \ 87 87 } \ 88 intnBad = psMemCheckCorruption(0); \88 psS32 nBad = psMemCheckCorruption(0); \ 89 89 if(nBad) { \ 90 90 psError(__func__,"ERROR: Found %d bad memory blocks\n", nBad); \ … … 93 93 94 94 95 int main( intargc, char* argv[] )95 psS32 main( psS32 argc, char* argv[] ) 96 96 { 97 97 -
trunk/psLib/test/dataManip/tst_psMatrixVectorArithmetic03.c
r2053 r2204 15 15 * @author Ross Harman, MHPCC 16 16 * 17 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $18 * @date $Date: 2004-10- 12 19:18:20$17 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 18 * @date $Date: 2004-10-27 00:57:33 $ 19 19 * 20 20 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 27 27 28 28 #define PRINT_VECTOR(VECTOR,TYPE) \ 29 for( inti=0; i<VECTOR->n; i++) { \29 for(psS32 i=0; i<VECTOR->n; i++) { \ 30 30 if(PS_IS_PSELEMTYPE_COMPLEX(VECTOR->type.type)) { \ 31 31 printf("%f+%fi ", creal(VECTOR->data.TYPE[i]), cimag(VECTOR->data.TYPE[i])); \ 32 32 } else if(PS_IS_PSELEMTYPE_INT(VECTOR->type.type)) { \ 33 printf("%d ", ( int)VECTOR->data.TYPE[i]); \33 printf("%d ", (psS32)VECTOR->data.TYPE[i]); \ 34 34 } else { \ 35 35 printf("%f ", (double)VECTOR->data.TYPE[i]); \ … … 40 40 41 41 #define PRINT_MATRIX(IMAGE,TYPE) \ 42 for( inti=IMAGE->numRows-1; i>-1; i--) { \43 for( intj=0; j<IMAGE->numCols; j++) { \42 for(psS32 i=IMAGE->numRows-1; i>-1; i--) { \ 43 for(psS32 j=0; j<IMAGE->numCols; j++) { \ 44 44 if(PS_IS_PSELEMTYPE_COMPLEX(IMAGE->type.type)) { \ 45 45 printf("%f+%fi ", creal(IMAGE->data.TYPE[i][j]), cimag(IMAGE->data.TYPE[i][j])); \ 46 46 } else if(PS_IS_PSELEMTYPE_INT(IMAGE->type.type)) { \ 47 printf("%d ", ( int)IMAGE->data.TYPE[i][j]); \47 printf("%d ", (psS32)IMAGE->data.TYPE[i][j]); \ 48 48 } else { \ 49 49 printf("%f ", (double)IMAGE->data.TYPE[i][j]); \ … … 57 57 #define CREATE_AND_SET_VECTOR(NAME,TYPE,VALUE,SIZE) \ 58 58 psVector *NAME = (psVector*)psVectorAlloc(SIZE, PS_TYPE_##TYPE); \ 59 for( inti=0; i<SIZE; i++) { \59 for(psS32 i=0; i<SIZE; i++) { \ 60 60 NAME->data.TYPE[i] = VALUE; \ 61 61 } \ … … 65 65 #define CREATE_AND_SET_IMAGE(NAME,TYPE,VALUE,NROWS,NCOLS) \ 66 66 psImage *NAME = (psImage*)psImageAlloc(NCOLS,NROWS,PS_TYPE_##TYPE); \ 67 for( inti=0; i<NAME->numRows; i++) { \68 for( intj=0; j<NAME->numCols; j++) { \67 for(psS32 i=0; i<NAME->numRows; i++) { \ 68 for(psS32 j=0; j<NAME->numCols; j++) { \ 69 69 NAME->data.TYPE[i][j] = VALUE; \ 70 70 } \ … … 72 72 73 73 74 int main(intargc, char* argv[])74 psS32 main(psS32 argc, char* argv[]) 75 75 { 76 76 CREATE_AND_SET_IMAGE(image1,F64,0,3,3); -
trunk/psLib/test/dataManip/tst_psMinimize00.c
r1811 r2204 36 36 float myFuncDeriv(const psVector *restrict myData, 37 37 const psVector *restrict myParams, 38 intwhichParamDeriv)38 psS32 whichParamDeriv) 39 39 { 40 40 float x = myData->data.F32[0]; … … 65 65 66 66 67 intmain()67 psS32 main() 68 68 { 69 69 psImage *domain = NULL; … … 74 74 psVector *tmpVecPtr = NULL; 75 75 float chiSq = 0.0; 76 inti = 0;77 intj = 0;78 intcurrentId = psMemGetId();79 inttestStatus = true;80 intmemLeaks = 0;76 psS32 i = 0; 77 psS32 j = 0; 78 psS32 currentId = psMemGetId(); 79 psS32 testStatus = true; 80 psS32 memLeaks = 0; 81 81 psVector *theParams = NULL; 82 82 -
trunk/psLib/test/dataManip/tst_psMinimize01.c
r1811 r2204 35 35 float myFuncDeriv(const psVector *restrict myData, 36 36 const psVector *restrict myParams, 37 intwhichParamDeriv)37 psS32 whichParamDeriv) 38 38 { 39 39 float x = myData->data.F32[0]; … … 58 58 } 59 59 60 intmain()60 psS32 main() 61 61 { 62 62 psImage *domain = NULL; … … 67 67 psVector *tmpVecPtr = NULL; 68 68 float chiSq = 0.0; 69 inti = 0;69 psS32 i = 0; 70 70 psVector *theParams = NULL; 71 intcurrentId = psMemGetId();72 inttestStatus = true;73 intmemLeaks = 0;71 psS32 currentId = psMemGetId(); 72 psS32 testStatus = true; 73 psS32 memLeaks = 0; 74 74 75 75 domain = psImageAlloc(DATA_WIDTH, NUM_DATA, PS_TYPE_F32); -
trunk/psLib/test/dataManip/tst_psMinimize02.c
r1811 r2204 34 34 float myFuncDeriv0(const psVector *restrict myParams, 35 35 const psVector *restrict myCoords, 36 intwhichParamDeriv)36 psS32 whichParamDeriv) 37 37 { 38 38 float P0 = myCoords->data.F32[0]; … … 75 75 float myFuncDeriv(const psVector *restrict myParams, 76 76 const psVector *restrict myCoords, 77 intwhichParamDeriv)77 psS32 whichParamDeriv) 78 78 { 79 79 float x = myCoords->data.F32[0]; … … 104 104 105 105 106 intmain()106 psS32 main() 107 107 { 108 108 psVector *initialGuess = NULL; 109 109 psVector *paramMask = NULL; 110 110 psVector *coord = NULL; 111 inti = 0;112 intcurrentId = psMemGetId();113 inttestStatus = true;114 intmemLeaks = 0;111 psS32 i = 0; 112 psS32 currentId = psMemGetId(); 113 psS32 testStatus = true; 114 psS32 memLeaks = 0; 115 115 psVector *theParams = NULL; 116 116 -
trunk/psLib/test/dataManip/tst_psMinimize03.c
r1811 r2204 34 34 float myFuncDeriv0(const psVector *restrict myParams, 35 35 const psVector *restrict myCoords, 36 intwhichParamDeriv)36 psS32 whichParamDeriv) 37 37 { 38 38 float P0 = myCoords->data.F32[0]; … … 75 75 float myFuncDeriv(const psVector *restrict myParams, 76 76 const psVector *restrict myCoords, 77 intwhichParamDeriv)77 psS32 whichParamDeriv) 78 78 { 79 79 float x = myCoords->data.F32[0]; … … 104 104 105 105 106 intmain()106 psS32 main() 107 107 { 108 108 psVector *initialGuess = NULL; 109 109 psVector *paramMask = NULL; 110 110 psVector *coord = NULL; 111 inti = 0;112 intcurrentId = psMemGetId();113 inttestStatus = true;114 intmemLeaks = 0;111 psS32 i = 0; 112 psS32 currentId = psMemGetId(); 113 psS32 testStatus = true; 114 psS32 memLeaks = 0; 115 115 psVector *theParams = NULL; 116 116 -
trunk/psLib/test/dataManip/tst_psMinimize04.c
r2090 r2204 33 33 } 34 34 35 intt00()35 psS32 t00() 36 36 { 37 37 psPolynomial1D *myPoly = NULL; … … 39 39 psVector *y = NULL; 40 40 psVector *yErr = NULL; 41 inti = 0;42 intcurrentId = psMemGetId();43 inttestStatus = true;44 intmemLeaks = 0;41 psS32 i = 0; 42 psS32 currentId = psMemGetId(); 43 psS32 testStatus = true; 44 psS32 memLeaks = 0; 45 45 double expectData; 46 46 double actualData; … … 101 101 } 102 102 103 intt01()103 psS32 t01() 104 104 { 105 105 psPolynomial1D *myPoly = NULL; 106 106 psVector *x = NULL; 107 107 psVector *y = NULL; 108 inti = 0;109 intcurrentId = psMemGetId();110 inttestStatus = true;111 intmemLeaks = 0;108 psS32 i = 0; 109 psS32 currentId = psMemGetId(); 110 psS32 testStatus = true; 111 psS32 memLeaks = 0; 112 112 double expectData; 113 113 double actualData; … … 164 164 } 165 165 166 intt02()166 psS32 t02() 167 167 { 168 168 psPolynomial1D *myPoly = NULL; 169 169 psVector *y = NULL; 170 inti = 0;171 intcurrentId = psMemGetId();172 inttestStatus = true;173 intmemLeaks = 0;170 psS32 i = 0; 171 psS32 currentId = psMemGetId(); 172 psS32 testStatus = true; 173 psS32 memLeaks = 0; 174 174 double expectData; 175 175 double actualData; … … 223 223 } 224 224 225 intt03()226 { 227 intcurrentId = psMemGetId();228 inttestStatus = true;229 intmemLeaks = 0;225 psS32 t03() 226 { 227 psS32 currentId = psMemGetId(); 228 psS32 testStatus = true; 229 psS32 memLeaks = 0; 230 230 psPolynomial1D *myPoly = NULL; 231 231 … … 257 257 258 258 259 intmain()259 psS32 main() 260 260 { 261 261 t00(); -
trunk/psLib/test/dataManip/tst_psMinimize04_F32.c
r2091 r2204 33 33 } 34 34 35 intt00()35 psS32 t00() 36 36 { 37 37 psPolynomial1D *myPoly = NULL; … … 39 39 psVector *y = NULL; 40 40 psVector *yErr = NULL; 41 inti = 0;42 intcurrentId = psMemGetId();43 inttestStatus = true;44 intmemLeaks = 0;41 psS32 i = 0; 42 psS32 currentId = psMemGetId(); 43 psS32 testStatus = true; 44 psS32 memLeaks = 0; 45 45 float expectData; 46 46 float actualData; … … 100 100 } 101 101 102 intt01()102 psS32 t01() 103 103 { 104 104 psPolynomial1D *myPoly = NULL; 105 105 psVector *x = NULL; 106 106 psVector *y = NULL; 107 inti = 0;108 intcurrentId = psMemGetId();109 inttestStatus = true;110 intmemLeaks = 0;107 psS32 i = 0; 108 psS32 currentId = psMemGetId(); 109 psS32 testStatus = true; 110 psS32 memLeaks = 0; 111 111 float expectData; 112 112 float actualData; … … 163 163 } 164 164 165 intt02()165 psS32 t02() 166 166 { 167 167 psPolynomial1D *myPoly = NULL; 168 168 psVector *y = NULL; 169 inti = 0;170 intcurrentId = psMemGetId();171 inttestStatus = true;172 intmemLeaks = 0;169 psS32 i = 0; 170 psS32 currentId = psMemGetId(); 171 psS32 testStatus = true; 172 psS32 memLeaks = 0; 173 173 float expectData; 174 174 float actualData; … … 222 222 } 223 223 224 intt03()225 { 226 intcurrentId = psMemGetId();227 inttestStatus = true;228 intmemLeaks = 0;224 psS32 t03() 225 { 226 psS32 currentId = psMemGetId(); 227 psS32 testStatus = true; 228 psS32 memLeaks = 0; 229 229 230 230 printPositiveTestHeader(stdout, … … 251 251 252 252 253 intmain()253 psS32 main() 254 254 { 255 255 t00(); -
trunk/psLib/test/dataManip/tst_psMinimize04b.c
r2089 r2204 26 26 } 27 27 28 intt00()28 psS32 t00() 29 29 { 30 30 psPolynomial1D *myPoly = NULL; … … 32 32 psVector *y = NULL; 33 33 psVector *yErr = NULL; 34 inti = 0;35 intcurrentId = psMemGetId();36 inttestStatus = true;37 intmemLeaks = 0;34 psS32 i = 0; 35 psS32 currentId = psMemGetId(); 36 psS32 testStatus = true; 37 psS32 memLeaks = 0; 38 38 39 39 myPoly = psPolynomial1DAlloc(POLY_ORDER+1, PS_POLYNOMIAL_CHEB); … … 95 95 96 96 97 intt01()97 psS32 t01() 98 98 { 99 99 psPolynomial1D *myPoly = NULL; 100 100 psVector *x = NULL; 101 101 psVector *y = NULL; 102 inti = 0;103 intcurrentId = psMemGetId();104 inttestStatus = true;105 intmemLeaks = 0;102 psS32 i = 0; 103 psS32 currentId = psMemGetId(); 104 psS32 testStatus = true; 105 psS32 memLeaks = 0; 106 106 107 107 myPoly = psPolynomial1DAlloc(POLY_ORDER+1, PS_POLYNOMIAL_CHEB); … … 155 155 156 156 157 intt02()157 psS32 t02() 158 158 { 159 159 psPolynomial1D *myPoly = NULL; 160 160 psVector *x = NULL; 161 161 psVector *y = NULL; 162 inti = 0;163 intcurrentId = psMemGetId();164 inttestStatus = true;165 intmemLeaks = 0;162 psS32 i = 0; 163 psS32 currentId = psMemGetId(); 164 psS32 testStatus = true; 165 psS32 memLeaks = 0; 166 166 167 167 myPoly = psPolynomial1DAlloc(POLY_ORDER+1, PS_POLYNOMIAL_CHEB); … … 214 214 } 215 215 216 intt03()217 { 218 psPolynomial1D *myPoly = NULL; 219 intcurrentId = psMemGetId();220 inttestStatus = true;221 intmemLeaks = 0;216 psS32 t03() 217 { 218 psPolynomial1D *myPoly = NULL; 219 psS32 currentId = psMemGetId(); 220 psS32 testStatus = true; 221 psS32 memLeaks = 0; 222 222 223 223 printPositiveTestHeader(stdout, … … 244 244 } 245 245 246 intmain()246 psS32 main() 247 247 { 248 248 t00(); -
trunk/psLib/test/dataManip/tst_psMinimize04b_F32.c
r2086 r2204 26 26 } 27 27 28 intt00()28 psS32 t00() 29 29 { 30 30 psPolynomial1D *myPoly = NULL; … … 32 32 psVector *y = NULL; 33 33 psVector *yErr = NULL; 34 inti = 0;35 intcurrentId = psMemGetId();36 inttestStatus = true;37 intmemLeaks = 0;34 psS32 i = 0; 35 psS32 currentId = psMemGetId(); 36 psS32 testStatus = true; 37 psS32 memLeaks = 0; 38 38 39 39 myPoly = psPolynomial1DAlloc(POLY_ORDER+1, PS_POLYNOMIAL_CHEB); … … 95 95 96 96 97 intt01()97 psS32 t01() 98 98 { 99 99 psPolynomial1D *myPoly = NULL; 100 100 psVector *x = NULL; 101 101 psVector *y = NULL; 102 inti = 0;103 intcurrentId = psMemGetId();104 inttestStatus = true;105 intmemLeaks = 0;102 psS32 i = 0; 103 psS32 currentId = psMemGetId(); 104 psS32 testStatus = true; 105 psS32 memLeaks = 0; 106 106 107 107 myPoly = psPolynomial1DAlloc(POLY_ORDER+1, PS_POLYNOMIAL_CHEB); … … 155 155 156 156 157 intt02()157 psS32 t02() 158 158 { 159 159 psPolynomial1D *myPoly = NULL; 160 160 psVector *x = NULL; 161 161 psVector *y = NULL; 162 inti = 0;163 intcurrentId = psMemGetId();164 inttestStatus = true;165 intmemLeaks = 0;162 psS32 i = 0; 163 psS32 currentId = psMemGetId(); 164 psS32 testStatus = true; 165 psS32 memLeaks = 0; 166 166 167 167 myPoly = psPolynomial1DAlloc(POLY_ORDER+1, PS_POLYNOMIAL_CHEB); … … 214 214 } 215 215 216 intt03()217 { 218 psPolynomial1D *myPoly = NULL; 219 intcurrentId = psMemGetId();220 inttestStatus = true;221 intmemLeaks = 0;216 psS32 t03() 217 { 218 psPolynomial1D *myPoly = NULL; 219 psS32 currentId = psMemGetId(); 220 psS32 testStatus = true; 221 psS32 memLeaks = 0; 222 222 223 223 printPositiveTestHeader(stdout, … … 244 244 } 245 245 246 intmain()246 psS32 main() 247 247 { 248 248 t00(); -
trunk/psLib/test/dataManip/tst_psMinimize05.c
r2081 r2204 15 15 #define ERROR_TOLERANCE 0.10 16 16 float expectedParm[NUM_PARAMS]; 17 inttestStatus = true;17 psS32 testStatus = true; 18 18 19 19 /***************************************************************************** … … 32 32 float coordData = 0.0; 33 33 float expData = 0.0; 34 inti;34 psS32 i; 35 35 36 36 for (i=0;i<N;i++) { … … 62 62 63 63 64 intt00()65 { 66 intcurrentId = psMemGetId();67 intmemLeaks = 0;68 inti = 0;64 psS32 t00() 65 { 66 psS32 currentId = psMemGetId(); 67 psS32 memLeaks = 0; 68 psS32 i = 0; 69 69 psArray *myCoords; 70 70 psVector *myParams; … … 81 81 myCoords = psArrayAlloc(N); 82 82 for (i=0;i<N;i++) { 83 myCoords->data[i] = (psP TR*) psVectorAlloc(2, PS_TYPE_F32);83 myCoords->data[i] = (psPtr *) psVectorAlloc(2, PS_TYPE_F32); 84 84 ((psVector *) (myCoords->data[i]))->data.F32[0] = (float) (i+10); 85 85 ((psVector *) (myCoords->data[i]))->data.F32[1] = (float) (i+3); … … 137 137 } 138 138 139 intt01()140 { 141 intcurrentId = psMemGetId();142 intmemLeaks = 0;143 inti = 0;139 psS32 t01() 140 { 141 psS32 currentId = psMemGetId(); 142 psS32 memLeaks = 0; 143 psS32 i = 0; 144 144 psArray *myCoords; 145 145 psVector *myParams; … … 154 154 myCoords = psArrayAlloc(N); 155 155 for (i=0;i<N;i++) { 156 myCoords->data[i] = (psP TR*) psVectorAlloc(2, PS_TYPE_F32);156 myCoords->data[i] = (psPtr *) psVectorAlloc(2, PS_TYPE_F32); 157 157 ((psVector *) (myCoords->data[i]))->data.F32[0] = (float) (i+10); 158 158 ((psVector *) (myCoords->data[i]))->data.F32[1] = (float) (i+3); … … 208 208 } 209 209 210 intt02()211 { 212 intcurrentId = psMemGetId();213 intmemLeaks = 0;214 inti = 0;210 psS32 t02() 211 { 212 psS32 currentId = psMemGetId(); 213 psS32 memLeaks = 0; 214 psS32 i = 0; 215 215 psArray *myCoords; 216 216 psVector *myParams; … … 227 227 myCoords = psArrayAlloc(N); 228 228 for (i=0;i<N;i++) { 229 myCoords->data[i] = (psP TR*) psVectorAlloc(2, PS_TYPE_F32);229 myCoords->data[i] = (psPtr *) psVectorAlloc(2, PS_TYPE_F32); 230 230 ((psVector *) (myCoords->data[i]))->data.F32[0] = (float) (i+10); 231 231 ((psVector *) (myCoords->data[i]))->data.F32[1] = (float) (i+3); … … 269 269 } 270 270 271 intmain()271 psS32 main() 272 272 { 273 273 t00(); -
trunk/psLib/test/dataManip/tst_psMinimize06.c
r2202 r2204 12 12 #define NUM_PARAMS 3 13 13 float expectedParm[NUM_PARAMS]; 14 inttestStatus = true;14 psS32 testStatus = true; 15 15 16 16 /***************************************************************************** … … 29 29 { 30 30 psVector *sum = psVectorAlloc(myCoords->n, PS_TYPE_F32); 31 inti;32 intj;31 psS32 i; 32 psS32 j; 33 33 34 34 … … 52 52 } 53 53 54 intt01()54 psS32 t01() 55 55 { 56 intcurrentId = psMemGetId();57 intmemLeaks = 0;58 inti = 0;56 psS32 currentId = psMemGetId(); 57 psS32 memLeaks = 0; 58 psS32 i = 0; 59 59 psArray *myCoords; 60 60 psVector *myParams; … … 73 73 74 74 for (i=0;i<N;i++) { 75 myCoords->data[i] = (psP TR*) psVectorAlloc(2, PS_TYPE_F32);75 myCoords->data[i] = (psPtr *) psVectorAlloc(2, PS_TYPE_F32); 76 76 ((psVector *) (myCoords->data[i]))->data.F32[0] = (float) (i+10); 77 77 ((psVector *) (myCoords->data[i]))->data.F32[1] = (float) (i+3); … … 115 115 } 116 116 117 intmain()117 psS32 main() 118 118 { 119 119 t01(); -
trunk/psLib/test/dataManip/tst_psStats00.c
r1811 r2204 8 8 #define N 10 9 9 10 intmain()10 psS32 main() 11 11 { 12 12 psStats *myStats = NULL; 13 13 psStats *myStats2 = NULL; 14 inttestStatus = true;15 intglobalTestStatus = true;16 inti = 0;14 psS32 testStatus = true; 15 psS32 globalTestStatus = true; 16 psS32 i = 0; 17 17 psVector *myVector = NULL; 18 18 psVector *maskVector= NULL; … … 20 20 float realMeanNoMask = 0.0; 21 21 float realMeanWithMask = 0.0; 22 intcount = 0;23 intcurrentId = psMemGetId();24 intmemLeaks = 0;22 psS32 count = 0; 23 psS32 currentId = psMemGetId(); 24 psS32 memLeaks = 0; 25 25 26 26 /*************************************************************************/ -
trunk/psLib/test/dataManip/tst_psStats01.c
r1811 r2204 8 8 #define N 10 9 9 10 intmain()10 psS32 main() 11 11 { 12 12 psStats *myStats = NULL; 13 inttestStatus = true;14 intglobalTestStatus = true;15 inti = 0;13 psS32 testStatus = true; 14 psS32 globalTestStatus = true; 15 psS32 i = 0; 16 16 psVector *myVector = NULL; 17 17 psVector *maskVector= NULL; … … 19 19 float realMaxNoMask = 0.0; 20 20 float realMaxWithMask = 0.0; 21 intcurrentId = psMemGetId();22 intmemLeaks = 0;21 psS32 currentId = psMemGetId(); 22 psS32 memLeaks = 0; 23 23 24 24 /*************************************************************************/ -
trunk/psLib/test/dataManip/tst_psStats02.c
r1811 r2204 8 8 #define N 10 9 9 10 intmain()10 psS32 main() 11 11 { 12 12 psStats *myStats = NULL; 13 inttestStatus = true;14 intglobalTestStatus = true;15 inti = 0;13 psS32 testStatus = true; 14 psS32 globalTestStatus = true; 15 psS32 i = 0; 16 16 psVector *myVector = NULL; 17 17 psVector *maskVector= NULL; … … 19 19 float realMinNoMask = 1e99; 20 20 float realMinWithMask = 1e99; 21 intcurrentId = psMemGetId();22 intmemLeaks = 0;21 psS32 currentId = psMemGetId(); 22 psS32 memLeaks = 0; 23 23 24 24 /*************************************************************************/ -
trunk/psLib/test/dataManip/tst_psStats03.c
r1811 r2204 9 9 #define N ((4 * N1) + 1) 10 10 11 intmain()11 psS32 main() 12 12 { 13 13 psStats *myStats = NULL; 14 inttestStatus = true;15 intglobalTestStatus = true;16 inti = 0;14 psS32 testStatus = true; 15 psS32 globalTestStatus = true; 16 psS32 i = 0; 17 17 psVector *myVector = NULL; 18 18 psVector *maskVector= NULL; … … 20 20 float realMedianWithMask = (float) (N-3)/4; 21 21 float realMedianNoMask = (float) (N-1)/2; 22 intcurrentId = psMemGetId();23 intmemLeaks = 0;22 psS32 currentId = psMemGetId(); 23 psS32 memLeaks = 0; 24 24 25 25 /*************************************************************************/ -
trunk/psLib/test/dataManip/tst_psStats04.c
r1406 r2204 12 12 #define N ((4 * N1) + 1) 13 13 14 intmain()14 psS32 main() 15 15 { 16 16 psStats *myStats = NULL; 17 inttestStatus = true;18 inti = 0;17 psS32 testStatus = true; 18 psS32 i = 0; 19 19 psVector *myVector = NULL; 20 20 psVector *maskVector= NULL; -
trunk/psLib/test/dataManip/tst_psStats05.c
r1900 r2204 8 8 #define MISC_FLOAT_NUMBER 345.0 9 9 10 intmain()10 psS32 main() 11 11 { 12 12 psStats *myStats = NULL; 13 inttestStatus = true;14 intcurrentId = psMemGetId();15 intmemLeaks = 0;13 psS32 testStatus = true; 14 psS32 currentId = psMemGetId(); 15 psS32 memLeaks = 0; 16 16 17 17 /*************************************************************************/ -
trunk/psLib/test/dataManip/tst_psStats06.c
r1811 r2204 12 12 #define N 15 13 13 14 intmain()14 psS32 main() 15 15 { 16 16 psStats *myStats = NULL; 17 inttestStatus = true;18 intglobalTestStatus = true;19 inti = 0;17 psS32 testStatus = true; 18 psS32 globalTestStatus = true; 19 psS32 i = 0; 20 20 psVector *myVector = NULL; 21 21 psVector *maskVector= NULL; … … 26 26 float realStdevNoMask = 4.472136; 27 27 float realStdevWithMask = 2.160247; 28 intcount = 0;29 intcurrentId = psMemGetId();30 intmemLeaks = 0;28 psS32 count = 0; 29 psS32 currentId = psMemGetId(); 30 psS32 memLeaks = 0; 31 31 32 32 /*************************************************************************/ -
trunk/psLib/test/dataManip/tst_psStats07.c
r2198 r2204 15 15 #define ERROR_TOLERANCE 0.10 16 16 17 intt00()17 psS32 t00() 18 18 { 19 19 psStats * myStats = NULL; 20 inttestStatus = true;21 intglobalTestStatus = true;22 inti = 0;20 psS32 testStatus = true; 21 psS32 globalTestStatus = true; 22 psS32 i = 0; 23 23 psVector *myVector = NULL; 24 24 psVector *maskVector = NULL; … … 26 26 // They must be changed if we adjust the number of data points. 27 27 // We don't really know that they are correct. 28 intcount = 0;29 intcurrentId = psMemGetId();30 intmemLeaks = 0;28 psS32 count = 0; 29 psS32 currentId = psMemGetId(); 30 psS32 memLeaks = 0; 31 31 float realMeanNoMask = MEAN; 32 32 float realMedianNoMask = MEAN; … … 35 35 float realLQNoMask = MEAN - ( 0.6 * STDEV ); 36 36 float realUQNoMask = MEAN + ( 0.6 * STDEV ); 37 intrealN50NoMask = N / 4;38 intrealNfitNoMask = N / 4;37 psS32 realN50NoMask = N / 4; 38 psS32 realNfitNoMask = N / 4; 39 39 40 40 psTraceSetLevel(".psLib.dataManip.psStats", 10); … … 253 253 254 254 255 intt01()255 psS32 t01() 256 256 { 257 257 psStats * myStats = NULL; 258 inttestStatus = true;259 intglobalTestStatus = true;260 inti = 0;258 psS32 testStatus = true; 259 psS32 globalTestStatus = true; 260 psS32 i = 0; 261 261 psVector *myVector = NULL; 262 262 psVector *maskVector = NULL; … … 264 264 // A: They must be changed if we adjust the number of data points. 265 265 // B: We don't really know that they are correct. 266 intcount = 0;267 intcurrentId = psMemGetId();268 intmemLeaks = 0;266 psS32 count = 0; 267 psS32 currentId = psMemGetId(); 268 psS32 memLeaks = 0; 269 269 float realMeanWithMask = MEAN; 270 270 float realMedianWithMask = MEAN; … … 273 273 float realLQWithMask = MEAN; 274 274 float realUQWithMask = MEAN; 275 intrealN50WithMask = N / 4;276 intrealNfitWithMask = N / 4;275 psS32 realN50WithMask = N / 4; 276 psS32 realNfitWithMask = N / 4; 277 277 278 278 psTraceSetLevel(".psLib.dataManip.psStats", 10); … … 487 487 } 488 488 489 intmain()489 psS32 main() 490 490 { 491 491 t00(); -
trunk/psLib/test/dataManip/tst_psStats08.c
r1811 r2204 13 13 #define N (8 * N1) // Don't change this (N must be a multiple of 8) 14 14 15 intmain()15 psS32 main() 16 16 { 17 17 psStats *myStats = NULL; 18 inttestStatus = true;19 intglobalTestStatus = true;20 inti = 0;18 psS32 testStatus = true; 19 psS32 globalTestStatus = true; 20 psS32 i = 0; 21 21 psVector *myVector = NULL; 22 22 psVector *maskVector= NULL; … … 28 28 float realLQWithMask = N/8.0; 29 29 float realUQWithMask = 3.0 * (N/8.0); 30 intcount = 0;31 intcurrentId = psMemGetId();32 intmemLeaks = 0;30 psS32 count = 0; 31 psS32 currentId = psMemGetId(); 32 psS32 memLeaks = 0; 33 33 34 34 /*************************************************************************/ -
trunk/psLib/test/dataManip/tst_psStats09.c
r1811 r2204 16 16 #define MY_RANGE 2.0 17 17 18 intmain()18 psS32 main() 19 19 { 20 20 psStats *myStats = NULL; 21 inttestStatus = true;22 intglobalTestStatus = true;23 inti = 0;21 psS32 testStatus = true; 22 psS32 globalTestStatus = true; 23 psS32 i = 0; 24 24 psVector *maskVector= NULL; 25 25 psVector *myGaussData = NULL; … … 31 31 // float realclippedMeanWithMask = 0.0; 32 32 // float realclippedStdevWithMask = 0.0; 33 intcount = 0;34 intcurrentId = psMemGetId();35 intmemLeaks = 0;33 psS32 count = 0; 34 psS32 currentId = psMemGetId(); 35 psS32 memLeaks = 0; 36 36 37 37 /*************************************************************************/ -
trunk/psLib/test/dataManip/tst_psVectorFFT.c
r1406 r2204 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $9 * @date $Date: 2004- 08-06 22:34:06$8 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-10-27 00:57:33 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 20 20 #define GENIMAGE(img,c,r,TYP, valueFcn) \ 21 21 img = psImageAlloc(c,r,PS_TYPE_##TYP); \ 22 for ( unsigned introw=0;row<r;row++) { \22 for (psU32 row=0;row<r;row++) { \ 23 23 ps##TYP* imgRow = img->data.TYP[row]; \ 24 for ( unsigned intcol=0;col<c;col++) { \24 for (psU32 col=0;col<c;col++) { \ 25 25 imgRow[col] = (ps##TYP)(valueFcn); \ 26 26 } \ 27 27 } 28 28 29 static inttestVectorFFT( void );30 static inttestVectorRealImaginary( void );31 static inttestVectorComplex( void );32 static inttestVectorConjugate( void );33 static inttestVectorPowerSpectrum( void );29 static psS32 testVectorFFT( void ); 30 static psS32 testVectorRealImaginary( void ); 31 static psS32 testVectorComplex( void ); 32 static psS32 testVectorConjugate( void ); 33 static psS32 testVectorPowerSpectrum( void ); 34 34 35 35 testDescription tests[] = { … … 54 54 }; 55 55 56 int main( intargc, char* argv[] )56 psS32 main( psS32 argc, char* argv[] ) 57 57 { 58 58 psLogSetLevel( PS_LOG_INFO ); … … 61 61 } 62 62 63 inttestVectorFFT( void )63 psS32 testVectorFFT( void ) 64 64 { 65 65 psVector * vec = NULL; … … 78 78 vec = psVectorAlloc( 100, PS_TYPE_F32 ); 79 79 vec->n = vec->nalloc; 80 for ( unsigned intn = 0; n < 100; n++ ) {80 for ( psU32 n = 0; n < 100; n++ ) { 81 81 vec->data.F32[ n ] = sinf( ( psF32 ) n / 50.0f * M_PI ); 82 82 } … … 91 91 92 92 // 3. verify that the only significant component cooresponds to the freqency of the input in step 1. 93 for ( unsigned intn = 0; n < 100; n++ ) {93 for ( psU32 n = 0; n < 100; n++ ) { 94 94 if ( n == 1 || n == 99 ) { 95 95 if ( fabsf( cabsf( vec2->data.C32[ n ] ) - 50.0f ) > 0.1f ) { … … 111 111 return 4; 112 112 } 113 for ( unsigned intn = 0; n < 100; n++ ) {113 for ( psU32 n = 0; n < 100; n++ ) { 114 114 psF32 val = sinf( ( psF32 ) n / 50.0f * M_PI ); 115 115 psF32 vecVal = crealf( vec3->data.C32[ n ] ) / 100; … … 128 128 } 129 129 130 inttestVectorRealImaginary( void )130 psS32 testVectorRealImaginary( void ) 131 131 { 132 132 psVector * vec = NULL; … … 143 143 vec = psVectorAlloc( 100, PS_TYPE_C32 ); 144 144 vec->n = vec->nalloc; 145 for ( unsigned intn = 0; n < 100; n++ ) {145 for ( psU32 n = 0; n < 100; n++ ) { 146 146 vec->data.C32[ n ] = n + I * ( n * 2 ); 147 147 } … … 171 171 172 172 // 3. compare results to the real/imaginary components of input 173 for ( unsigned intn = 0; n < 100; n++ ) {173 for ( psU32 n = 0; n < 100; n++ ) { 174 174 psF32 r = n; 175 175 psF32 i = ( n * 2 ); … … 193 193 } 194 194 195 inttestVectorComplex( void )195 psS32 testVectorComplex( void ) 196 196 { 197 197 psVector * vec = NULL; … … 220 220 vec->n = vec->nalloc; 221 221 vec2->n = vec2->nalloc; 222 for ( unsigned intn = 0; n < 100; n++ ) {222 for ( psU32 n = 0; n < 100; n++ ) { 223 223 vec->data.F32[ n ] = n; 224 224 vec2->data.F32[ n ] = ( n * 2 ); … … 237 237 // 4. call psVectorReal and psVectorImaginary on step 2 results (not needed, just use crealf/cimagf) 238 238 // 5. compare step 4 results to input. 239 for ( unsigned intn = 0; n < 100; n++ ) {239 for ( psU32 n = 0; n < 100; n++ ) { 240 240 if ( fabsf( crealf( vec3->data.C32[ n ] ) - n ) > FLT_EPSILON || 241 241 fabsf( cimagf( vec3->data.C32[ n ] ) - ( n * 2 ) ) > FLT_EPSILON ) { … … 278 278 } 279 279 280 inttestVectorConjugate( void )280 psS32 testVectorConjugate( void ) 281 281 { 282 282 psVector * vec = NULL; … … 293 293 vec = psVectorAlloc( 100, PS_TYPE_C32 ); 294 294 vec->n = vec->nalloc; 295 for ( unsigned intn = 0; n < 100; n++ ) {295 for ( psU32 n = 0; n < 100; n++ ) { 296 296 vec->data.C32[ n ] = n + I * ( n * 2 ); 297 297 } … … 307 307 308 308 // 4. verify each value is conjugate of input (a+bi -> a-bi) 309 for ( unsigned intn = 0; n < 100; n++ ) {309 for ( psU32 n = 0; n < 100; n++ ) { 310 310 if ( fabsf( crealf( vec->data.C32[ n ] ) - crealf( vec2->data.C32[ n ] ) ) > FLT_EPSILON || 311 311 fabsf( cimagf( vec->data.C32[ n ] ) + cimagf( vec2->data.C32[ n ] ) ) > FLT_EPSILON ) { … … 322 322 } 323 323 324 inttestVectorPowerSpectrum( void )324 psS32 testVectorPowerSpectrum( void ) 325 325 { 326 326 psVector * vec = NULL; … … 338 338 vec = psVectorAlloc( 100, PS_TYPE_C32 ); 339 339 vec->n = vec->nalloc; 340 for ( unsigned intn = 0; n < 100; n++ ) {340 for ( psU32 n = 0; n < 100; n++ ) { 341 341 vec->data.C32[ n ] = n + I * sinf( ( ( psF32 ) n ) / 50.f * M_PI ); 342 342 } … … 365 365 }; 366 366 367 for ( unsigned intn = 1; n < 50; n++ ) {367 for ( psU32 n = 1; n < 50; n++ ) { 368 368 val = ( cabsf( vec->data.C32[ n ] ) * cabsf( vec->data.C32[ n ] ) + 369 369 cabsf( vec->data.C32[ 100 - n ] ) * cabsf( vec->data.C32[ 100 - n ] ) ) / 100 / 100;
Note:
See TracChangeset
for help on using the changeset viewer.
