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

    r2057 r2204  
    1010 *  @author  Ross Harman, MHPCC
    1111 *
    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 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2424
    2525#define CHECK_VECTOR(VECTOR,TYPE,TRUTH)                                                                      \
    26 for(int i=0; i<VECTOR->n; i++) {                                                                             \
     26for(psS32 i=0; i<VECTOR->n; i++) {                                                                             \
    2727    if(cabs(VECTOR->data.TYPE[i])-cabs(TRUTH) > FLT_EPSILON){                                                \
    2828        printf("ERROR:Truth and calculated values don't match for vector operation:\n");                     \
     
    3131            printf("Calculated: %.2f%+.2fi\n", creal(TRUTH), cimag(TRUTH));                                  \
    3232        } 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));                                                        \
    3535        } else {                                                                                             \
    3636            printf("Truth: %.2f\n", (double)(VECTOR->data.TYPE[i]));                                         \
     
    4343
    4444#define CHECK_MATRIX(IMAGE,TYPE,TRUTH)                                                                       \
    45 for(int i=IMAGE->numRows-1; i>-1; i--) {                                                                     \
    46     for(int j=0; j<IMAGE->numCols; j++) {                                                                    \
     45for(psS32 i=IMAGE->numRows-1; i>-1; i--) {                                                                     \
     46    for(psS32 j=0; j<IMAGE->numCols; j++) {                                                                    \
    4747        if(cabs(IMAGE->data.TYPE[i][j])-cabs(TRUTH) > FLT_EPSILON){                                          \
    4848            printf("ERROR:Truth and calculated values don't match for matrix operation:\n");                 \
     
    5151                printf("Calculated: %.2f%+.2fi\n", creal(TRUTH), cimag(TRUTH));                              \
    5252            } 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));                                                    \
    5555            } else {                                                                                         \
    5656                printf("Truth: %.2f\n", (double)(IMAGE->data.TYPE[i][j]));                                   \
     
    6666#define CREATE_AND_SET_VECTOR(NAME,TYPE,VALUE,SIZE)                                                          \
    6767psVector *NAME = (psVector*)psVectorAlloc(SIZE, PS_TYPE_##TYPE);                                             \
    68 for(int i=0; i<SIZE; i++) {                                                                                  \
     68for(psS32 i=0; i<SIZE; i++) {                                                                                  \
    6969    NAME->data.TYPE[i] = VALUE;                                                                              \
    7070}                                                                                                            \
     
    7474#define CREATE_AND_SET_IMAGE(NAME,TYPE,VALUE,NROWS,NCOLS)                                                    \
    7575psImage *NAME = (psImage*)psImageAlloc(NCOLS,NROWS,PS_TYPE_##TYPE);                                          \
    76 for(int i=0; i<NAME->numRows; i++) {                                                                         \
    77     for(int j=0; j<NAME->numCols; j++) {                                                                     \
     76for(psS32 i=0; i<NAME->numRows; i++) {                                                                         \
     77    for(psS32 j=0; j<NAME->numCols; j++) {                                                                     \
    7878        NAME->data.TYPE[i][j] = VALUE;                                                                       \
    7979    }                                                                                                        \
     
    8686    return 50; \
    8787} \
    88 int nBad = psMemCheckCorruption(0); \
     88psS32 nBad = psMemCheckCorruption(0); \
    8989if(nBad) { \
    9090    psError(__func__,"ERROR: Found %d bad memory blocks\n", nBad); \
     
    9393
    9494
    95 int main( int argc, char* argv[] )
     95psS32 main( psS32 argc, char* argv[] )
    9696{
    9797
Note: See TracChangeset for help on using the changeset viewer.