- Timestamp:
- Oct 26, 2004, 2:57:34 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.
