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_psMatrixVectorArithmetic01.c

    r1648 r2204  
    1010 *  @author  Ross Harman, MHPCC
    1111 *
    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 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2424    printf("%f+%fi ", creal(SCALAR->data.TYPE), cimag(SCALAR->data.TYPE));                               \
    2525} else if(PS_IS_PSELEMTYPE_INT(SCALAR->type.type)) {                                                     \
    26     printf("%d ", (int)SCALAR->data.TYPE);                                                               \
     26    printf("%d ", (psS32)SCALAR->data.TYPE);                                                               \
    2727} else {                                                                                                 \
    2828    printf("%f ", (double)SCALAR->data.TYPE);                                                            \
     
    3131
    3232#define PRINT_VECTOR(VECTOR,TYPE)                                                                            \
    33 for(int i=0; i<VECTOR->n; i++) {                                                                         \
     33for(psS32 i=0; i<VECTOR->n; i++) {                                                                         \
    3434    if(PS_IS_PSELEMTYPE_COMPLEX(VECTOR->type.type)) {                                                    \
    3535        printf("%f+%fi ", creal(VECTOR->data.TYPE[i]), cimag(VECTOR->data.TYPE[i]));                     \
    3636    } 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]);                                                        \
    3838    } else {                                                                                             \
    3939        printf("%f ", (double)VECTOR->data.TYPE[i]);                                                     \
     
    4444
    4545#define PRINT_MATRIX(IMAGE,TYPE)                                                                             \
    46 for(int i=IMAGE->numRows-1; i>-1; i--) {                                                                 \
    47     for(int j=0; j<IMAGE->numCols; j++) {                                                                \
     46for(psS32 i=IMAGE->numRows-1; i>-1; i--) {                                                                 \
     47    for(psS32 j=0; j<IMAGE->numCols; j++) {                                                                \
    4848        if(PS_IS_PSELEMTYPE_COMPLEX(IMAGE->type.type)) {                                                 \
    4949            printf("%f+%fi ", creal(IMAGE->data.TYPE[i][j]), cimag(IMAGE->data.TYPE[i][j]));             \
    5050        } 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]);                                                  \
    5252        } else {                                                                                         \
    5353            printf("%f ", (double)IMAGE->data.TYPE[i][j]);                                               \
     
    6161#define CREATE_AND_SET_VECTOR(NAME,TYPE,VALUE,SIZE)                                                          \
    6262psVector *NAME = (psVector*)psVectorAlloc(SIZE, PS_TYPE_##TYPE);                                         \
    63 for(int i=0; i<SIZE; i++) {                                                                              \
     63for(psS32 i=0; i<SIZE; i++) {                                                                              \
    6464    NAME->data.TYPE[i] = VALUE;                                                                          \
    6565}                                                                                                        \
     
    6969#define CREATE_AND_SET_IMAGE(NAME,TYPE,VALUE,NROWS,NCOLS)                                                    \
    7070psImage *NAME = (psImage*)psImageAlloc(NCOLS,NROWS,PS_TYPE_##TYPE);                                      \
    71 for(int i=0; i<NAME->numRows; i++) {                                                                     \
    72     for(int j=0; j<NAME->numCols; j++) {                                                                 \
     71for(psS32 i=0; i<NAME->numRows; i++) {                                                                     \
     72    for(psS32 j=0; j<NAME->numCols; j++) {                                                                 \
    7373        NAME->data.TYPE[i][j] = VALUE;                                                                   \
    7474    }                                                                                                    \
     
    7878#define CHECK_MEMORY                                                                                         \
    7979psMemCheckLeaks(0, NULL, stdout);                                                                        \
    80 int nBad = psMemCheckCorruption(0);                                                                      \
     80psS32 nBad = psMemCheckCorruption(0);                                                                      \
    8181if(nBad) {                                                                                               \
    8282    printf("ERROR: Found %d bad memory blocks\n", nBad);                                                 \
     
    8484
    8585
    86 int main(int argc, char* argv[])
     86psS32 main(psS32 argc, char* argv[])
    8787{
    8888
Note: See TracChangeset for help on using the changeset viewer.