IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 15, 2005, 10:10:32 AM (20 years ago)
Author:
gusciora
Message:

Bug fix for psSpline, some new psConstant macros, ....

File:
1 edited

Legend:

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

    r5294 r5517  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.78 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2005-10-12 21:02:20 $
     8 *  @version $Revision: 1.79 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2005-11-15 20:10:32 $
    1010 *
    1111 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    222222the wrong type.
    223223*****************************************************************************/
     224#define PS_WARN_PTR_NON_NULL(NAME) \
     225if ((NAME) == NULL) { \
     226    psLogMsg(__func__, PS_LOG_WARN, "WARNING: %s is NULL.", #NAME); \
     227} \
     228
    224229#define PS_ASSERT_PTR_NON_NULL(NAME, RVAL) PS_ASSERT_GENERAL_PTR_NON_NULL(NAME, return RVAL)
    225230#define PS_ASSERT_GENERAL_PTR_NON_NULL(NAME, CLEANUP) \
     
    501506    PS_POLY macros:
    502507*****************************************************************************/
     508#define PS_ASSERT_POLY1D(NAME, RVAL) \
     509if (false == psMemCheckPolynomial1D(NAME)) { \
     510    psError(PS_ERR_BAD_PARAMETER_NULL, true, \
     511            "Unallowable operation: argument %s is not a psPolynomial1D struct.\n",\
     512            #NAME); \
     513    return(RVAL); \
     514} \
     515
    503516#define PS_ASSERT_POLY_NON_NULL(NAME, RVAL) \
    504517if ((NAME) == NULL || (NAME)->coeff == NULL) { \
     
    582595    printf("%s->coeff[%d] is %f\n", #NAME, i, NAME->coeff[i]); \
    583596}\
     597
     598/*****************************************************************************
     599    PS_SPLINE macros:
     600*****************************************************************************/
     601#define PS_ASSERT_SPLINE(NAME, RVAL) \
     602if (false == psMemCheckSpline1D(NAME)) { \
     603    psError(PS_ERR_BAD_PARAMETER_NULL, true, \
     604            "Unallowable operation: argument %s is not a psSpline1D struct.\n",\
     605            #NAME); \
     606    return(RVAL); \
     607} \
     608
     609#define PS_ASSERT_SPLINE_NON_NULL(NAME, RVAL) \
     610if ((NAME) == NULL) { \
     611    psError(PS_ERR_BAD_PARAMETER_NULL, true, \
     612            "Unallowable operation: psSpline1D %s is NULL.", \
     613            #NAME); \
     614    return(RVAL); \
     615} \
    584616
    585617/*****************************************************************************
     
    755787((A) * (A))
    756788
     789#define PRINT_MEMLEAKS(NUM) \
     790printf("A: ---------------------------------------- (ID: %d)\n", NUM); \
     791memLeaks = psMemCheckLeaks(currentId,NULL,stderr,false); \
     792printf("B: ---------------------------------------- (%d)\n", memLeaks); \
     793
    757794# define PS_SWAP(X,Y) {double tmp=(X); (X) = (Y); (Y) = tmp;}
Note: See TracChangeset for help on using the changeset viewer.