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