IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 26, 2004, 11:25:59 AM (22 years ago)
Author:
gusciora
Message:

...

File:
1 edited

Legend:

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

    r2136 r2197  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2004-10-14 23:43:12 $
     8 *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2004-10-26 21:24:42 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    107107} \
    108108
     109/** Preprocessor macro to generate error on a NULL vector */
     110#define PS_CHECK_NULL_VECTOR_RETURN_F0(NAME) \
     111if (NAME == NULL || NAME->data.V == NULL) { \
     112    psError(__func__,"Unallowable operation: %s or its data is NULL.", #NAME); \
     113    return(0.0); \
     114} \
     115
    109116/** Preprocessor macro to generate error on a NULL poniter */
    110117#define PS_CHECK_NULL_PTR_RETURN_NULL(NAME) \
     
    113120    return(NULL); \
    114121}
     122
     123/** Preprocessor macro to generate error on a NULL poniter */
     124#define PS_CHECK_NULL_PTR_RETURN_F0(NAME) \
     125if (NAME == NULL) { \
     126    psError(__func__,"Unallowable operation: %s is NULL.", #NAME); \
     127    return(0.0); \
     128}
     129
    115130/** Preprocessor macro to generate error on a NULL poniter */
    116131#define PS_CHECK_NULL_PTR_RETURN_ZERO(NAME) \
     
    127142} \
    128143
     144/** Preprocessor macro to generate error for zero length vector */
     145#define PS_CHECK_EMPTY_VECTOR_RETURN_F0(NAME) \
     146if (NAME->n < 1) { \
     147    psError(__func__,"Unallowable operation: %s has zero n value.", #NAME); \
     148    return(0.0); \
     149} \
     150
    129151/** Preprocessor macro to generate error on differing size vectors */
    130152#define PS_CHECK_VECTOR_SIZE_EQUAL_RETURN_NULL(VEC1, VEC2) \
     
    132154    psError(__func__,"Vector %s has size %d, Vector %s has size %d.", #VEC1, VEC1->n, #VEC2, VEC2->n); \
    133155    return(NULL); \
     156}
     157
     158/** Preprocessor macro to generate error on differing size vectors */
     159#define PS_CHECK_VECTOR_SIZE_EQUAL_RETURN_F0(VEC1, VEC2) \
     160if (VEC1->n != VEC2->n) { \
     161    psError(__func__,"Vector %s has size %d, Vector %s has size %d.", #VEC1, VEC1->n, #VEC2, VEC2->n); \
     162    return(0.0); \
    134163}
    135164
     
    199228
    200229#define PS_MAX(A, B) \
    201 ((A > B) ? A : B) \
     230(((A) > (B)) ? (A) : (B)) \
    202231
    203232#define PS_MIN(A, B) \
    204 ((A < B) ? A : B) \
    205 
     233(((A) < (B)) ? (A) : (B)) \
     234
Note: See TracChangeset for help on using the changeset viewer.