IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 6, 2004, 12:34:06 PM (22 years ago)
Author:
desonia
Message:

astyle fixed?

File:
1 edited

Legend:

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

    r1365 r1406  
    1010 *  @author  Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
    13  *  @date  $Date: 2004-08-02 19:43:23 $
     12 *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
     13 *  @date  $Date: 2004-08-06 22:34:06 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2525#define PRINT_SCALAR(SCALAR,TYPE)                                                                            \
    2626if(PS_IS_PSELEMTYPE_COMPLEX(SCALAR->type.type)) {                                                            \
    27         printf("%.2f%f+.2i ", creal(SCALAR->data.TYPE), cimag(SCALAR->data.TYPE));                                   \
    28     } else if(PS_IS_PSELEMTYPE_INT(SCALAR->type.type)) {                                                         \
    29         printf("%d", (int)SCALAR->data.TYPE);                                                                    \
    30     } else {                                                                                                     \
    31         printf("%.2f", (double)SCALAR->data.TYPE);                                                                 \
    32     }                                                                                                            \
     27    printf("%.2f%f+.2i ", creal(SCALAR->data.TYPE), cimag(SCALAR->data.TYPE));                                   \
     28} else if(PS_IS_PSELEMTYPE_INT(SCALAR->type.type)) {                                                         \
     29    printf("%d", (int)SCALAR->data.TYPE);                                                                    \
     30} else {                                                                                                     \
     31    printf("%.2f", (double)SCALAR->data.TYPE);                                                                 \
     32}                                                                                                            \
    3333printf("\n\n");
    3434
     
    3636#define PRINT_VECTOR(VECTOR,TYPE)                                                                            \
    3737for(int i=0; i<VECTOR->n; i++) {                                                                             \
    38         if(PS_IS_PSELEMTYPE_COMPLEX(VECTOR->type.type)) {                                                        \
    39                 printf("%.2f%+.2fi\n", creal(VECTOR->data.TYPE[i]), cimag(VECTOR->data.TYPE[i]));                        \
    40             } else if(PS_IS_PSELEMTYPE_INT(VECTOR->type.type)) {                                                     \
    41                 printf("%d\n", (int)VECTOR->data.TYPE[i]);                                                           \
    42             } else {                                                                                                 \
    43                 printf("%.2f\n", (double)VECTOR->data.TYPE[i]);                                                        \
    44             }                                                                                                        \
    45     }                                                                                                            \
     38    if(PS_IS_PSELEMTYPE_COMPLEX(VECTOR->type.type)) {                                                        \
     39        printf("%.2f%+.2fi\n", creal(VECTOR->data.TYPE[i]), cimag(VECTOR->data.TYPE[i]));                        \
     40    } else if(PS_IS_PSELEMTYPE_INT(VECTOR->type.type)) {                                                     \
     41        printf("%d\n", (int)VECTOR->data.TYPE[i]);                                                           \
     42    } else {                                                                                                 \
     43        printf("%.2f\n", (double)VECTOR->data.TYPE[i]);                                                        \
     44    }                                                                                                        \
     45}                                                                                                            \
    4646printf("\n");
    4747
     
    4949#define PRINT_MATRIX(IMAGE,TYPE)                                                                             \
    5050for(int i=IMAGE->numRows-1; i>-1; i--) {                                                                     \
    51         for(int j=0; j<IMAGE->numCols; j++) {                                                                    \
    52                 if(PS_IS_PSELEMTYPE_COMPLEX(IMAGE->type.type)) {                                                     \
    53                         printf("%.2f%+.2fi ", creal(IMAGE->data.TYPE[i][j]), cimag(IMAGE->data.TYPE[i][j]));                 \
    54                     } else if(PS_IS_PSELEMTYPE_INT(IMAGE->type.type)) {                                                  \
    55                         printf("%d ", (int)IMAGE->data.TYPE[i][j]);                                                      \
    56                     } else {                                                                                             \
    57                         printf("%.2f ", (double)IMAGE->data.TYPE[i][j]);                                                   \
    58                     }                                                                                                    \
    59             }                                                                                                        \
    60         printf("\n");                                                                                            \
    61     }                                                                                                            \
     51    for(int j=0; j<IMAGE->numCols; j++) {                                                                    \
     52        if(PS_IS_PSELEMTYPE_COMPLEX(IMAGE->type.type)) {                                                     \
     53            printf("%.2f%+.2fi ", creal(IMAGE->data.TYPE[i][j]), cimag(IMAGE->data.TYPE[i][j]));                 \
     54        } else if(PS_IS_PSELEMTYPE_INT(IMAGE->type.type)) {                                                  \
     55            printf("%d ", (int)IMAGE->data.TYPE[i][j]);                                                      \
     56        } else {                                                                                             \
     57            printf("%.2f ", (double)IMAGE->data.TYPE[i][j]);                                                   \
     58        }                                                                                                    \
     59    }                                                                                                        \
     60    printf("\n");                                                                                            \
     61}                                                                                                            \
    6262printf("\n");
    6363
     
    6666psVector *NAME = (psVector*)psVectorAlloc(SIZE, PS_TYPE_##TYPE);                                             \
    6767for(int i=0; i<SIZE; i++) {                                                                                  \
    68         NAME->data.TYPE[i] = VALUE;                                                                              \
    69     }                                                                                                            \
     68    NAME->data.TYPE[i] = VALUE;                                                                              \
     69}                                                                                                            \
    7070NAME->n = SIZE;
    7171
     
    7474psImage *NAME = (psImage*)psImageAlloc(NCOLS,NROWS,PS_TYPE_##TYPE);                                          \
    7575for(int i=0; i<NAME->numRows; i++) {                                                                         \
    76         for(int j=0; j<NAME->numCols; j++) {                                                                     \
    77                 NAME->data.TYPE[i][j] = VALUE;                                                                       \
    78             }                                                                                                        \
    79     }
    80    
    81    
     76    for(int j=0; j<NAME->numCols; j++) {                                                                     \
     77        NAME->data.TYPE[i][j] = VALUE;                                                                       \
     78    }                                                                                                        \
     79}
     80
     81
    8282#define CHECK_MEMORY                                                                                         \
    8383psMemCheckLeaks(0, NULL, stdout);                                                                            \
    8484int nBad = psMemCheckCorruption(0);                                                                          \
    8585if(nBad) {                                                                                                   \
    86         printf("ERROR: Found %d bad memory blocks\n", nBad);                                                     \
    87     }
    88    
    89    
     86    printf("ERROR: Found %d bad memory blocks\n", nBad);                                                     \
     87}
     88
     89
    9090int main( int argc, char* argv[] )
    9191{
     
    109109        printFooter(stdout, "psMatrixVectorArithmetic", "Test matrix psUnaryOp", true);                      \
    110110    }
    111    
     111
    112112    testBinaryOpM( abs, S32, -10, 0, 3, 2 );
    113113    testBinaryOpM( abs, F32, -10.0, 0.0, 3, 2 );
     
    178178    testBinaryOpM( datan, F64, 1.0, 0.0, 3, 2 );
    179179    testBinaryOpM( datan, C32, 1.0 + 1.0i, 0.0 + 0.0i, 3, 2 );
    180    
    181    
     180
     181
    182182    // Test vector unary operations
    183183    #define testBinaryOpV(OP,TYPE,VALUE1,VALUE2,SIZE)                                                        \
     
    198198        printFooter(stdout, "psMatrixVectorArithmetic", "Test vector psUnaryOp", true);                      \
    199199    }
    200    
     200
    201201    testBinaryOpV( abs, S32, -10, 0, 3 );
    202202    testBinaryOpV( abs, F32, -10.0, 0.0, 3 );
     
    267267    testBinaryOpV( datan, F64, 1.0, 0.0, 3 );
    268268    testBinaryOpV( datan, C32, 1.0 + 1.0i, 0.0 + 0.0i, 3 );
    269    
     269
    270270    return 0;
    271271}
Note: See TracChangeset for help on using the changeset viewer.