IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 25, 2004, 1:05:07 PM (22 years ago)
Author:
gusciora
Message:

No substantial mods here.

File:
1 edited

Legend:

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

    r1879 r1903  
    1 //
    2 // Source code comments.
    3 //
     1/** @file  psComments.h
     2 *
     3 *  This file will hold definitions of various constants as well as common
     4 *  macros used throughout psLib.
     5 *
     6 *  @author GLG, MHPCC
     7 *
     8 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2004-09-25 23:05:07 $
     10 *
     11 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     12 */
    413
    514#define DETERMINE_BRACKET_STEP_SIZE 0.10
     
    918#define RIGHT_SPLINE_DERIV 0.0
    1019
     20/** Preprocessor macro to generate error on an incorrect type */
     21#define PS_CHECK_VECTOR_TYPE(NAME, TYPE) \
     22if (NAME->type.type != TYPE) { \
     23    psError(__func__,"Invalid operation: %s has incorrect type.", #NAME); \
     24}
     25
     26/** Preprocessor macro to generate error on a NULL vector */
     27#define PS_CHECK_NULL_VECTOR(NAME) \
     28if (NAME == NULL || NAME->data.V == NULL) { \
     29    psError(__func__,"Invalid operation: %s or its data is NULL.", #NAME); \
     30}
     31
     32/** Preprocessor macro to generate error on a NULL poniter */
     33#define PS_CHECK_NULL_PTR(NAME) \
     34if (NAME == NULL) { \
     35    psError(__func__,"Invalid operation: %s is NULL.", #NAME); \
     36}
     37
     38/** Preprocessor macro to generate error for zero length vector */
     39#define PS_CHECK_EMPTY_VECTOR(NAME) \
     40if (NAME->n < 1) { \
     41    psError(__func__,"Invalid operation: %s has zero n value.", #NAME); \
     42}
     43
     44/** Preprocessor macro to generate error on differing size vectors */
     45#define PS_CHECK_VECTOR_SIZE_EQUAL(VEC1, VEC2) \
     46if (VEC1->n != VEC2->n) { \
     47    psError(__func__,"Vector %s has size %d, Vector %s has size %d.", #VEC1, VEC1->n, #VEC2, VEC2->n); \
     48}
     49
     50#define PS_PRINT_VECTOR(NAME) \
     51for (int my_i=0;my_i<NAME->n;my_i++) { \
     52    printf("%s->data.F32[%d] is %f\n", #NAME, my_i, NAME->data.F32[my_i]); \
     53} \
     54printf("\n"); \
     55
     56#define PS_MAX(A, B) \
     57(A > B) ? A : B \
     58
     59#define PS_MIN(A, B) \
     60(A < B) ? A : B \
     61
Note: See TracChangeset for help on using the changeset viewer.