IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 26, 2004, 2:57:34 PM (22 years ago)
Author:
desonia
Message:

converted native C types to ps Types, where practical.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/dataManip/tst_psMatrixVectorArithmetic03.c

    r2053 r2204  
    1515 *  @author  Ross Harman, MHPCC
    1616 *
    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 $
    1919 *
    2020 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2727
    2828#define PRINT_VECTOR(VECTOR,TYPE)                                                                            \
    29 for(int i=0; i<VECTOR->n; i++) {                                                                         \
     29for(psS32 i=0; i<VECTOR->n; i++) {                                                                         \
    3030    if(PS_IS_PSELEMTYPE_COMPLEX(VECTOR->type.type)) {                                                    \
    3131        printf("%f+%fi ", creal(VECTOR->data.TYPE[i]), cimag(VECTOR->data.TYPE[i]));                     \
    3232    } 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]);                                                        \
    3434    } else {                                                                                             \
    3535        printf("%f ", (double)VECTOR->data.TYPE[i]);                                                     \
     
    4040
    4141#define PRINT_MATRIX(IMAGE,TYPE)                                                                             \
    42 for(int i=IMAGE->numRows-1; i>-1; i--) {                                                                 \
    43     for(int j=0; j<IMAGE->numCols; j++) {                                                                \
     42for(psS32 i=IMAGE->numRows-1; i>-1; i--) {                                                                 \
     43    for(psS32 j=0; j<IMAGE->numCols; j++) {                                                                \
    4444        if(PS_IS_PSELEMTYPE_COMPLEX(IMAGE->type.type)) {                                                 \
    4545            printf("%f+%fi ", creal(IMAGE->data.TYPE[i][j]), cimag(IMAGE->data.TYPE[i][j]));             \
    4646        } 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]);                                                  \
    4848        } else {                                                                                         \
    4949            printf("%f ", (double)IMAGE->data.TYPE[i][j]);                                               \
     
    5757#define CREATE_AND_SET_VECTOR(NAME,TYPE,VALUE,SIZE)                                                          \
    5858psVector *NAME = (psVector*)psVectorAlloc(SIZE, PS_TYPE_##TYPE);                                         \
    59 for(int i=0; i<SIZE; i++) {                                                                              \
     59for(psS32 i=0; i<SIZE; i++) {                                                                              \
    6060    NAME->data.TYPE[i] = VALUE;                                                                          \
    6161}                                                                                                        \
     
    6565#define CREATE_AND_SET_IMAGE(NAME,TYPE,VALUE,NROWS,NCOLS)                                                    \
    6666psImage *NAME = (psImage*)psImageAlloc(NCOLS,NROWS,PS_TYPE_##TYPE);                                      \
    67 for(int i=0; i<NAME->numRows; i++) {                                                                     \
    68     for(int j=0; j<NAME->numCols; j++) {                                                                 \
     67for(psS32 i=0; i<NAME->numRows; i++) {                                                                     \
     68    for(psS32 j=0; j<NAME->numCols; j++) {                                                                 \
    6969        NAME->data.TYPE[i][j] = VALUE;                                                                   \
    7070    }                                                                                                    \
     
    7272
    7373
    74 int main(int argc, char* argv[])
     74psS32 main(psS32 argc, char* argv[])
    7575{
    7676    CREATE_AND_SET_IMAGE(image1,F64,0,3,3);
Note: See TracChangeset for help on using the changeset viewer.