IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4419


Ignore:
Timestamp:
Jun 28, 2005, 1:28:31 PM (21 years ago)
Author:
gusciora
Message:

...

Location:
trunk/psLib/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/dataManip/psConstants.h

    r4162 r4419  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.73 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2005-06-08 23:40:45 $
     8 *  @version $Revision: 1.74 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2005-06-28 23:28:31 $
    1010 *
    1111 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    111111}
    112112
     113#define PS_ASSERT_INT_LESS_THAN(VAR1, VAR2, RVAL) \
     114if (!(VAR1 < VAR2)) { \
     115    psError(PS_ERR_UNKNOWN, true, \
     116            "Error: %s is not less than %s (%d, %d)", #VAR1, #VAR2, VAR1, VAR2); \
     117    return(RVAL); \
     118}
     119
     120#define PS_ASSERT_INT_LESS_THAN_OR_EQUAL(VAR1, VAR2, RVAL) \
     121if (!(VAR1 <= VAR2)) { \
     122    psError(PS_ERR_UNKNOWN, true, \
     123            "Error: %s is not less than %s (%d, %d)", #VAR1, #VAR2, VAR1, VAR2); \
     124    return(RVAL); \
     125}
     126
    113127#define PS_ASSERT_INT_LARGER_THAN(NAME1, NAME2, RVAL) \
    114128if (!((NAME1) > (NAME2))) { \
     
    337351for (int my_i=0;my_i<(NAME)->n;my_i++) { \
    338352    printf("%s->data.F32[%d] is %f\n", #NAME, my_i, (NAME)->data.F32[my_i]); \
     353} \
     354printf("\n"); \
     355
     356#define PS_VECTOR_PRINT_F64(NAME) \
     357for (int my_i=0;my_i<(NAME)->n;my_i++) { \
     358    printf("%s->data.F64[%d] is %f\n", #NAME, my_i, (NAME)->data.F64[my_i]); \
    339359} \
    340360printf("\n"); \
     
    599619}\
    600620
     621#define PS_IMAGE_PRINT_F64(NAME) \
     622printf("======== printing %s ========\n", #NAME); \
     623for (int i = 0 ; i < (NAME)->numRows ; i++) { \
     624    for (int j = 0 ; j < (NAME)->numCols ; j++) { \
     625        printf("%.2f ", (NAME)->data.F64[i][j]); \
     626    } \
     627    printf("\n"); \
     628}\
     629
    601630#define PS_IMAGE_SET_U8(NAME, VALUE) \
    602631for (int i = 0 ; i < (NAME)->numRows ; i++) { \
  • trunk/psLib/src/math/psConstants.h

    r4162 r4419  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.73 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2005-06-08 23:40:45 $
     8 *  @version $Revision: 1.74 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2005-06-28 23:28:31 $
    1010 *
    1111 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    111111}
    112112
     113#define PS_ASSERT_INT_LESS_THAN(VAR1, VAR2, RVAL) \
     114if (!(VAR1 < VAR2)) { \
     115    psError(PS_ERR_UNKNOWN, true, \
     116            "Error: %s is not less than %s (%d, %d)", #VAR1, #VAR2, VAR1, VAR2); \
     117    return(RVAL); \
     118}
     119
     120#define PS_ASSERT_INT_LESS_THAN_OR_EQUAL(VAR1, VAR2, RVAL) \
     121if (!(VAR1 <= VAR2)) { \
     122    psError(PS_ERR_UNKNOWN, true, \
     123            "Error: %s is not less than %s (%d, %d)", #VAR1, #VAR2, VAR1, VAR2); \
     124    return(RVAL); \
     125}
     126
    113127#define PS_ASSERT_INT_LARGER_THAN(NAME1, NAME2, RVAL) \
    114128if (!((NAME1) > (NAME2))) { \
     
    337351for (int my_i=0;my_i<(NAME)->n;my_i++) { \
    338352    printf("%s->data.F32[%d] is %f\n", #NAME, my_i, (NAME)->data.F32[my_i]); \
     353} \
     354printf("\n"); \
     355
     356#define PS_VECTOR_PRINT_F64(NAME) \
     357for (int my_i=0;my_i<(NAME)->n;my_i++) { \
     358    printf("%s->data.F64[%d] is %f\n", #NAME, my_i, (NAME)->data.F64[my_i]); \
    339359} \
    340360printf("\n"); \
     
    599619}\
    600620
     621#define PS_IMAGE_PRINT_F64(NAME) \
     622printf("======== printing %s ========\n", #NAME); \
     623for (int i = 0 ; i < (NAME)->numRows ; i++) { \
     624    for (int j = 0 ; j < (NAME)->numCols ; j++) { \
     625        printf("%.2f ", (NAME)->data.F64[i][j]); \
     626    } \
     627    printf("\n"); \
     628}\
     629
    601630#define PS_IMAGE_SET_U8(NAME, VALUE) \
    602631for (int i = 0 ; i < (NAME)->numRows ; i++) { \
Note: See TracChangeset for help on using the changeset viewer.