IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1903


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

No substantial mods here.

Location:
trunk/psLib/src
Files:
7 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
  • trunk/psLib/src/dataManip/psFunctions.c

    r1861 r1903  
    77 *  polynomials.  It also contains a Gaussian functions.
    88 *
    9  *  @version $Revision: 1.40 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2004-09-23 06:12:22 $
     9 *  @version $Revision: 1.41 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2004-09-25 23:05:07 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    16991699all j>=i).  This routine does a binary disection of the vector and returns
    17001700"i" such that (v[i] <= x <= v[i+1).  If x lies outside the range of v[],
    1701 then this routine prints a warning message and returns -1.
     1701then this routine prints a warning message and returns (-2 or -1).
    17021702 
    17031703XXX: Macro this for a few different types.
     
    17161716            "---- Calling p_psVectorBinDisectF32(%f)\n", x);
    17171717
    1718     if ((x < bins[0]) ||
    1719             (x > bins[numBins-1])) {
     1718    if (x < bins[0]) {
     1719        psLogMsg(__func__, PS_LOG_WARN,
     1720                 "p_psVectorBinDisectF32(): ordinate %f is outside vector range (%f - %f).",
     1721                 x, bins[0], bins[numBins-1]);
     1722        return(-2);
     1723    }
     1724
     1725    if (x > bins[numBins-1]) {
    17201726        psLogMsg(__func__, PS_LOG_WARN,
    17211727                 "p_psVectorBinDisectF32(): ordinate %f is outside vector range (%f - %f).",
  • trunk/psLib/src/dataManip/psStats.c

    r1879 r1903  
    77 *  on those data structures.
    88 *
    9  *  @author George Gusciora, MHPCC
     9 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.58 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-09-24 20:08:22 $
     11 *  @version $Revision: 1.59 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-09-25 23:05:07 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3434#include "psMinimize.h"
    3535#include "psFunctions.h"
     36#include "psConstants.h"
    3637
    3738/*****************************************************************************/
     
    5152void p_psVectorRobustStats(const psVector* restrict myVector,
    5253                           const psVector* restrict maskVector, unsigned int maskVal, psStats* stats);
    53 
    54 /** Preprocessor macro to generate error on an incorrect type */
    55 #define PS_CHECK_VECTOR_TYPE(NAME, TYPE) \
    56 if (NAME->type.type != TYPE) { \
    57     psError(__func__,"Invalid operation: %s has incorrect type.", #NAME); \
    58 }
    59 
    60 /** Preprocessor macro to generate error on a NULL vector */
    61 #define PS_CHECK_NULL_VECTOR(NAME) \
    62 if (NAME == NULL || NAME->data.V == NULL) { \
    63     psError(__func__,"Invalid operation: %s or its data is NULL.", #NAME); \
    64 }
    65 
    66 /** Preprocessor macro to generate error for zero length vector */
    67 #define PS_CHECK_EMPTY_VECTOR(NAME) \
    68 if (NAME->n < 1) { \
    69     psError(__func__,"Invalid operation: %s has zero n value.", #NAME); \
    70 }
    71 
    72 /** Preprocessor macro to generate error on differing size vectors */
    73 #define PS_CHECK_VECTOR_SIZE_EQUAL(VEC1, VEC2) \
    74 if (VEC1->n != VEC2->n) { \
    75     psError(__func__,"Vector %s has size %d, Vector %s has size %d.", #VEC1, VEC1->n, #VEC2, VEC2->n); \
    76 }
    77 
    78 #define PS_PRINT_VECTOR(NAME) \
    79 for (int my_i=0;my_i<NAME->n;my_i++) { \
    80     printf("%s->data.F32[%d] is %f\n", #NAME, my_i, NAME->data.F32[my_i]); \
    81 } \
    82 printf("\n"); \
    8354
    8455
  • trunk/psLib/src/math/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
  • trunk/psLib/src/math/psPolynomial.c

    r1861 r1903  
    77 *  polynomials.  It also contains a Gaussian functions.
    88 *
    9  *  @version $Revision: 1.40 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2004-09-23 06:12:22 $
     9 *  @version $Revision: 1.41 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2004-09-25 23:05:07 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    16991699all j>=i).  This routine does a binary disection of the vector and returns
    17001700"i" such that (v[i] <= x <= v[i+1).  If x lies outside the range of v[],
    1701 then this routine prints a warning message and returns -1.
     1701then this routine prints a warning message and returns (-2 or -1).
    17021702 
    17031703XXX: Macro this for a few different types.
     
    17161716            "---- Calling p_psVectorBinDisectF32(%f)\n", x);
    17171717
    1718     if ((x < bins[0]) ||
    1719             (x > bins[numBins-1])) {
     1718    if (x < bins[0]) {
     1719        psLogMsg(__func__, PS_LOG_WARN,
     1720                 "p_psVectorBinDisectF32(): ordinate %f is outside vector range (%f - %f).",
     1721                 x, bins[0], bins[numBins-1]);
     1722        return(-2);
     1723    }
     1724
     1725    if (x > bins[numBins-1]) {
    17201726        psLogMsg(__func__, PS_LOG_WARN,
    17211727                 "p_psVectorBinDisectF32(): ordinate %f is outside vector range (%f - %f).",
  • trunk/psLib/src/math/psSpline.c

    r1861 r1903  
    77 *  polynomials.  It also contains a Gaussian functions.
    88 *
    9  *  @version $Revision: 1.40 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2004-09-23 06:12:22 $
     9 *  @version $Revision: 1.41 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2004-09-25 23:05:07 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    16991699all j>=i).  This routine does a binary disection of the vector and returns
    17001700"i" such that (v[i] <= x <= v[i+1).  If x lies outside the range of v[],
    1701 then this routine prints a warning message and returns -1.
     1701then this routine prints a warning message and returns (-2 or -1).
    17021702 
    17031703XXX: Macro this for a few different types.
     
    17161716            "---- Calling p_psVectorBinDisectF32(%f)\n", x);
    17171717
    1718     if ((x < bins[0]) ||
    1719             (x > bins[numBins-1])) {
     1718    if (x < bins[0]) {
     1719        psLogMsg(__func__, PS_LOG_WARN,
     1720                 "p_psVectorBinDisectF32(): ordinate %f is outside vector range (%f - %f).",
     1721                 x, bins[0], bins[numBins-1]);
     1722        return(-2);
     1723    }
     1724
     1725    if (x > bins[numBins-1]) {
    17201726        psLogMsg(__func__, PS_LOG_WARN,
    17211727                 "p_psVectorBinDisectF32(): ordinate %f is outside vector range (%f - %f).",
  • trunk/psLib/src/math/psStats.c

    r1879 r1903  
    77 *  on those data structures.
    88 *
    9  *  @author George Gusciora, MHPCC
     9 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.58 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-09-24 20:08:22 $
     11 *  @version $Revision: 1.59 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-09-25 23:05:07 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3434#include "psMinimize.h"
    3535#include "psFunctions.h"
     36#include "psConstants.h"
    3637
    3738/*****************************************************************************/
     
    5152void p_psVectorRobustStats(const psVector* restrict myVector,
    5253                           const psVector* restrict maskVector, unsigned int maskVal, psStats* stats);
    53 
    54 /** Preprocessor macro to generate error on an incorrect type */
    55 #define PS_CHECK_VECTOR_TYPE(NAME, TYPE) \
    56 if (NAME->type.type != TYPE) { \
    57     psError(__func__,"Invalid operation: %s has incorrect type.", #NAME); \
    58 }
    59 
    60 /** Preprocessor macro to generate error on a NULL vector */
    61 #define PS_CHECK_NULL_VECTOR(NAME) \
    62 if (NAME == NULL || NAME->data.V == NULL) { \
    63     psError(__func__,"Invalid operation: %s or its data is NULL.", #NAME); \
    64 }
    65 
    66 /** Preprocessor macro to generate error for zero length vector */
    67 #define PS_CHECK_EMPTY_VECTOR(NAME) \
    68 if (NAME->n < 1) { \
    69     psError(__func__,"Invalid operation: %s has zero n value.", #NAME); \
    70 }
    71 
    72 /** Preprocessor macro to generate error on differing size vectors */
    73 #define PS_CHECK_VECTOR_SIZE_EQUAL(VEC1, VEC2) \
    74 if (VEC1->n != VEC2->n) { \
    75     psError(__func__,"Vector %s has size %d, Vector %s has size %d.", #VEC1, VEC1->n, #VEC2, VEC2->n); \
    76 }
    77 
    78 #define PS_PRINT_VECTOR(NAME) \
    79 for (int my_i=0;my_i<NAME->n;my_i++) { \
    80     printf("%s->data.F32[%d] is %f\n", #NAME, my_i, NAME->data.F32[my_i]); \
    81 } \
    82 printf("\n"); \
    8354
    8455
Note: See TracChangeset for help on using the changeset viewer.