Changeset 2212
- Timestamp:
- Oct 27, 2004, 10:07:17 AM (22 years ago)
- Location:
- trunk/psLib/src
- Files:
-
- 11 edited
-
astro/psCoord.c (modified) (8 diffs)
-
astronomy/psAstrometry.c (modified) (21 diffs)
-
astronomy/psCoord.c (modified) (8 diffs)
-
dataManip/psConstants.h (modified) (3 diffs)
-
dataManip/psMinimize.c (modified) (9 diffs)
-
dataManip/psStats.c (modified) (2 diffs)
-
image/psImageStats.c (modified) (2 diffs)
-
imageops/psImageStats.c (modified) (2 diffs)
-
math/psConstants.h (modified) (3 diffs)
-
math/psMinimize.c (modified) (9 diffs)
-
math/psStats.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astro/psCoord.c
r2206 r2212 10 10 * @author George Gusciora, MHPCC 11 11 * 12 * @version $Revision: 1.3 0$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-10-27 01:15:47 $12 * @version $Revision: 1.31 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-10-27 20:07:17 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 81 81 const psPlane* coords) 82 82 { 83 PS_ CHECK_NULL_PTR(transform, NULL);84 PS_ CHECK_NULL_PTR(coords, NULL);83 PS_PTR_CHECK_NULL(transform, NULL); 84 PS_PTR_CHECK_NULL(coords, NULL); 85 85 if (out == NULL) { 86 86 out = (psPlane* ) psAlloc(sizeof(psPlane)); … … 117 117 float magnitude) 118 118 { 119 PS_ CHECK_NULL_PTR(transform, NULL);120 PS_ CHECK_NULL_PTR(coords, NULL);119 PS_PTR_CHECK_NULL(transform, NULL); 120 PS_PTR_CHECK_NULL(coords, NULL); 121 121 if (out == NULL) { 122 122 out = (psPlane* ) psAlloc(sizeof(psPlane)); … … 156 156 const psSphere* coord) 157 157 { 158 PS_ CHECK_NULL_PTR(transform, NULL);159 PS_ CHECK_NULL_PTR(coord, NULL);158 PS_PTR_CHECK_NULL(transform, NULL); 159 PS_PTR_CHECK_NULL(coord, NULL); 160 160 double sinY = 0.0; 161 161 double cosY = 0.0; … … 228 228 const psProjection* projection) 229 229 { 230 PS_ CHECK_NULL_PTR(coord, NULL);231 PS_ CHECK_NULL_PTR(projection, NULL);230 PS_PTR_CHECK_NULL(coord, NULL); 231 PS_PTR_CHECK_NULL(projection, NULL); 232 232 233 233 float R = 0.0; … … 280 280 const psProjection* projection) 281 281 { 282 PS_ CHECK_NULL_PTR(coord, NULL);283 PS_ CHECK_NULL_PTR(projection, NULL);282 PS_PTR_CHECK_NULL(coord, NULL); 283 PS_PTR_CHECK_NULL(projection, NULL); 284 284 285 285 float R = 0.0; … … 348 348 psSphereOffsetUnit unit) 349 349 { 350 PS_ CHECK_NULL_PTR(position1, NULL);351 PS_ CHECK_NULL_PTR(position2, NULL);350 PS_PTR_CHECK_NULL(position1, NULL); 351 PS_PTR_CHECK_NULL(position2, NULL); 352 352 353 353 psPlane* lin; … … 416 416 psSphereOffsetUnit unit) 417 417 { 418 PS_ CHECK_NULL_PTR(position, NULL);419 PS_ CHECK_NULL_PTR(offset, NULL);418 PS_PTR_CHECK_NULL(position, NULL); 419 PS_PTR_CHECK_NULL(offset, NULL); 420 420 421 421 psPlane lin; -
trunk/psLib/src/astronomy/psAstrometry.c
r2211 r2212 8 8 * @author George Gusciora, MHPCC 9 9 * 10 * @version $Revision: 1.4 5$ $Name: not supported by cvs2svn $11 * @date $Date: 2004-10-27 19:58:54$10 * @version $Revision: 1.46 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-10-27 20:07:17 $ 12 12 * 13 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 59 59 { 60 60 int i = 0; 61 PS_ CHECK_NULL_PTR(transform, 0);61 PS_PTR_CHECK_NULL(transform, 0); 62 62 63 63 for (i=2;i<(transform->x->nX);i++) { … … 114 114 double F = transform->y->coeff[0][1]; 115 115 116 PS_ CHECK_NULL_PTR(transform, NULL);116 PS_PTR_CHECK_NULL(transform, NULL); 117 117 psPlaneTransform *out = psAlloc(sizeof(psPlaneTransform)); 118 118 … … 286 286 const psObservatory* observatory) 287 287 { 288 PS_ CHECK_NULL_PTR(observatory, NULL);288 PS_PTR_CHECK_NULL(observatory, NULL); 289 289 psExposure* exp = psAlloc(sizeof(psExposure)); 290 290 … … 463 463 psGrommit* psGrommitAlloc(const psExposure* exp) 464 464 { 465 PS_ CHECK_NULL_PTR(exp, NULL);465 PS_PTR_CHECK_NULL(exp, NULL); 466 466 467 467 double date = psTimeToMJD(exp->time); … … 493 493 const psFPA* FPA) 494 494 { 495 PS_ CHECK_NULL_PTR(fpaCoord, NULL);496 PS_ CHECK_NULL_PTR(FPA, NULL);495 PS_PTR_CHECK_NULL(fpaCoord, NULL); 496 PS_PTR_CHECK_NULL(FPA, NULL); 497 497 psChip* tmpChip = NULL; 498 498 psPlane chipCoord; … … 517 517 const psFPA* FPA) 518 518 { 519 PS_ CHECK_NULL_PTR(fpaCoord, NULL);520 PS_ CHECK_NULL_PTR(FPA, NULL);521 PS_ CHECK_NULL_PTR(FPA->chips, NULL);519 PS_PTR_CHECK_NULL(fpaCoord, NULL); 520 PS_PTR_CHECK_NULL(FPA, NULL); 521 PS_PTR_CHECK_NULL(FPA->chips, NULL); 522 522 psArray* chips = FPA->chips; 523 523 psS32 nChips = chips->n; … … 545 545 const psChip* chip) 546 546 { 547 PS_ CHECK_NULL_PTR(chipCoord, NULL);548 PS_ CHECK_NULL_PTR(chip, NULL);547 PS_PTR_CHECK_NULL(chipCoord, NULL); 548 PS_PTR_CHECK_NULL(chip, NULL); 549 549 550 550 psPlane cellCoord; … … 588 588 const psCell* cell) 589 589 { 590 PS_ CHECK_NULL_PTR(inCoord, NULL);591 PS_ CHECK_NULL_PTR(cell, NULL);590 PS_PTR_CHECK_NULL(inCoord, NULL); 591 PS_PTR_CHECK_NULL(cell, NULL); 592 592 593 593 return (psPlaneTransformApply(outCoord, cell->toChip, inCoord)); … … 598 598 const psChip* chip) 599 599 { 600 PS_ CHECK_NULL_PTR(inCoord, NULL);601 PS_ CHECK_NULL_PTR(chip, NULL);600 PS_PTR_CHECK_NULL(inCoord, NULL); 601 PS_PTR_CHECK_NULL(chip, NULL); 602 602 603 603 return (psPlaneTransformApply(outCoord, chip->toFPA, inCoord)); … … 610 610 const psFPA* fpa) 611 611 { 612 PS_ CHECK_NULL_PTR(inCoord, NULL);613 PS_ CHECK_NULL_PTR(fpa, NULL);612 PS_PTR_CHECK_NULL(inCoord, NULL); 613 PS_PTR_CHECK_NULL(fpa, NULL); 614 614 615 615 return(psPlaneDistortApply(outCoord, fpa->toTangentPlane, inCoord, … … 624 624 const psGrommit* grommit) 625 625 { 626 PS_ CHECK_NULL_PTR(tpCoord, NULL);627 PS_ CHECK_NULL_PTR(grommit, NULL);626 PS_PTR_CHECK_NULL(tpCoord, NULL); 627 PS_PTR_CHECK_NULL(grommit, NULL); 628 628 629 629 double AOB = 0.0; … … 644 644 const psCell* cell) 645 645 { 646 PS_ CHECK_NULL_PTR(cellCoord, NULL);647 PS_ CHECK_NULL_PTR(cell, NULL);646 PS_PTR_CHECK_NULL(cellCoord, NULL); 647 PS_PTR_CHECK_NULL(cell, NULL); 648 648 649 649 return (psPlaneTransformApply(fpaCoord, cell->toFPA, cellCoord)); … … 656 656 const psCell* cell) 657 657 { 658 PS_ CHECK_NULL_PTR(cellCoord, NULL);659 PS_ CHECK_NULL_PTR(cell, NULL);658 PS_PTR_CHECK_NULL(cellCoord, NULL); 659 PS_PTR_CHECK_NULL(cell, NULL); 660 660 661 661 psPlane* fpaCoord = NULL; … … 688 688 const psCell* cell) 689 689 { 690 PS_ CHECK_NULL_PTR(cellCoord, NULL);691 PS_ CHECK_NULL_PTR(cell, NULL);690 PS_PTR_CHECK_NULL(cellCoord, NULL); 691 PS_PTR_CHECK_NULL(cell, NULL); 692 692 693 693 psPlane *tpCoord = NULL; … … 724 724 const psGrommit* grommit) 725 725 { 726 PS_ CHECK_NULL_PTR(in, NULL);727 PS_ CHECK_NULL_PTR(grommit, NULL);726 PS_PTR_CHECK_NULL(in, NULL); 727 PS_PTR_CHECK_NULL(grommit, NULL); 728 728 729 729 char* type = "RA"; … … 745 745 const psFPA* fpa) 746 746 { 747 PS_ CHECK_NULL_PTR(tpCoord, NULL);748 PS_ CHECK_NULL_PTR(fpa, NULL);747 PS_PTR_CHECK_NULL(tpCoord, NULL); 748 PS_PTR_CHECK_NULL(fpa, NULL); 749 749 750 750 return (psPlaneDistortApply(fpaCoord, fpa->fromTangentPlane, … … 756 756 const psChip* chip) 757 757 { 758 PS_ CHECK_NULL_PTR(fpaCoord, NULL);759 PS_ CHECK_NULL_PTR(chip, NULL);760 PS_ CHECK_NULL_PTR(chip->parent, NULL);758 PS_PTR_CHECK_NULL(fpaCoord, NULL); 759 PS_PTR_CHECK_NULL(chip, NULL); 760 PS_PTR_CHECK_NULL(chip->parent, NULL); 761 761 762 762 chipCoord = psPlaneTransformApply(chipCoord, chip->fromFPA, fpaCoord); … … 768 768 const psCell* cell) 769 769 { 770 PS_ CHECK_NULL_PTR(chipCoord, NULL);771 PS_ CHECK_NULL_PTR(cell, NULL);772 PS_ CHECK_NULL_PTR(cell->parent, NULL);770 PS_PTR_CHECK_NULL(chipCoord, NULL); 771 PS_PTR_CHECK_NULL(cell, NULL); 772 PS_PTR_CHECK_NULL(cell->parent, NULL); 773 773 774 774 cellCoord = psPlaneTransformApply(cellCoord, cell->fromChip, chipCoord); … … 782 782 const psCell* cell) 783 783 { 784 PS_ CHECK_NULL_PTR(skyCoord, NULL);785 PS_ CHECK_NULL_PTR(cell, NULL);784 PS_PTR_CHECK_NULL(skyCoord, NULL); 785 PS_PTR_CHECK_NULL(cell, NULL); 786 786 787 787 psChip *parChip = cell->parent; … … 813 813 const psCell* cell) 814 814 { 815 PS_ CHECK_NULL_PTR(skyCoord, NULL);816 PS_ CHECK_NULL_PTR(cell, NULL);815 PS_PTR_CHECK_NULL(skyCoord, NULL); 816 PS_PTR_CHECK_NULL(cell, NULL); 817 817 818 818 psPlane *tpCoord = NULL; -
trunk/psLib/src/astronomy/psCoord.c
r2206 r2212 10 10 * @author George Gusciora, MHPCC 11 11 * 12 * @version $Revision: 1.3 0$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-10-27 01:15:47 $12 * @version $Revision: 1.31 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-10-27 20:07:17 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 81 81 const psPlane* coords) 82 82 { 83 PS_ CHECK_NULL_PTR(transform, NULL);84 PS_ CHECK_NULL_PTR(coords, NULL);83 PS_PTR_CHECK_NULL(transform, NULL); 84 PS_PTR_CHECK_NULL(coords, NULL); 85 85 if (out == NULL) { 86 86 out = (psPlane* ) psAlloc(sizeof(psPlane)); … … 117 117 float magnitude) 118 118 { 119 PS_ CHECK_NULL_PTR(transform, NULL);120 PS_ CHECK_NULL_PTR(coords, NULL);119 PS_PTR_CHECK_NULL(transform, NULL); 120 PS_PTR_CHECK_NULL(coords, NULL); 121 121 if (out == NULL) { 122 122 out = (psPlane* ) psAlloc(sizeof(psPlane)); … … 156 156 const psSphere* coord) 157 157 { 158 PS_ CHECK_NULL_PTR(transform, NULL);159 PS_ CHECK_NULL_PTR(coord, NULL);158 PS_PTR_CHECK_NULL(transform, NULL); 159 PS_PTR_CHECK_NULL(coord, NULL); 160 160 double sinY = 0.0; 161 161 double cosY = 0.0; … … 228 228 const psProjection* projection) 229 229 { 230 PS_ CHECK_NULL_PTR(coord, NULL);231 PS_ CHECK_NULL_PTR(projection, NULL);230 PS_PTR_CHECK_NULL(coord, NULL); 231 PS_PTR_CHECK_NULL(projection, NULL); 232 232 233 233 float R = 0.0; … … 280 280 const psProjection* projection) 281 281 { 282 PS_ CHECK_NULL_PTR(coord, NULL);283 PS_ CHECK_NULL_PTR(projection, NULL);282 PS_PTR_CHECK_NULL(coord, NULL); 283 PS_PTR_CHECK_NULL(projection, NULL); 284 284 285 285 float R = 0.0; … … 348 348 psSphereOffsetUnit unit) 349 349 { 350 PS_ CHECK_NULL_PTR(position1, NULL);351 PS_ CHECK_NULL_PTR(position2, NULL);350 PS_PTR_CHECK_NULL(position1, NULL); 351 PS_PTR_CHECK_NULL(position2, NULL); 352 352 353 353 psPlane* lin; … … 416 416 psSphereOffsetUnit unit) 417 417 { 418 PS_ CHECK_NULL_PTR(position, NULL);419 PS_ CHECK_NULL_PTR(offset, NULL);418 PS_PTR_CHECK_NULL(position, NULL); 419 PS_PTR_CHECK_NULL(offset, NULL); 420 420 421 421 psPlane lin; -
trunk/psLib/src/dataManip/psConstants.h
r2211 r2212 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1. 19$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-10-27 19:58:54$8 * @version $Revision: 1.20 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-10-27 20:07:17 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 95 95 96 96 /***************************************************************************** 97 97 Macros which take a generic psLib type and determine if it is NULL, or has 98 the wrong type. 98 99 *****************************************************************************/ 99 #define PS_ CHECK_NULL_PTR(NAME, RVAL) \100 #define PS_PTR_CHECK_NULL(NAME, RVAL) \ 100 101 if (NAME == NULL) { \ 101 102 psError(__func__,"Unallowable operation: %s is NULL.", #NAME); \ … … 103 104 } 104 105 105 /***************************************************************************** 106 107 *****************************************************************************/ 108 #define VECTOR_CHECK_TYPE_F32_OR_F64(VEC, RVAL) \ 106 #define PS_PTR_CHECK_TYPE(NAME, TYPE, RVAL) \ 107 if (NAME->type.type != TYPE) { \ 108 psError(__func__,"Unallowable operation: %s has incorrect type.", #NAME); \ 109 return(RVAL); \ 110 } 111 /***************************************************************************** 112 113 *****************************************************************************/ 114 #define PS_VECTOR_CHECK_TYPE_F32_OR_F64(VEC, RVAL) \ 109 115 if ((VEC->type.type != PS_TYPE_F32) && (VEC->type.type != PS_TYPE_F64)) { \ 110 116 psAbort(__func__, "Bad type for VEC (%d)", VEC->type.type); \ -
trunk/psLib/src/dataManip/psMinimize.c
r2211 r2212 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.6 5$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-10-27 19:58:54$11 * @version $Revision: 1.66 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-10-27 20:07:17 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 252 252 static psVector *yErr32Static = NULL; 253 253 254 PS_ CHECK_NULL_PTR(mySpline, NULL);255 PS_ CHECK_NULL_PTR(y, NULL);256 VECTOR_CHECK_TYPE_F32_OR_F64(y, NULL);254 PS_PTR_CHECK_NULL(mySpline, NULL); 255 PS_PTR_CHECK_NULL(y, NULL); 256 PS_VECTOR_CHECK_TYPE_F32_OR_F64(y, NULL); 257 257 CONVERT_VECTOR_F64_TO_F32(y, y32, y32Static); 258 258 … … 262 262 yErr32 = yErr32Static; 263 263 } else { 264 VECTOR_CHECK_TYPE_F32_OR_F64(yErr, NULL);264 PS_VECTOR_CHECK_TYPE_F32_OR_F64(yErr, NULL); 265 265 CONVERT_VECTOR_F64_TO_F32(yErr, yErr32, yErr32Static); 266 266 } … … 271 271 x32 = x32Static; 272 272 } else { 273 VECTOR_CHECK_TYPE_F32_OR_F64(x, NULL);273 PS_VECTOR_CHECK_TYPE_F32_OR_F64(x, NULL); 274 274 CONVERT_VECTOR_F64_TO_F32(x, x32, x32Static); 275 275 } … … 425 425 psMinimizeLMChi2Func func) 426 426 { 427 PS_ CHECK_NULL_PTR(min, NULL);427 PS_PTR_CHECK_NULL(min, NULL); 428 428 PS_CHECK_NULL_VECTOR(params, NULL); 429 429 PS_CHECK_EMPTY_VECTOR(params, NULL); 430 PS_ CHECK_NULL_PTR(x, NULL);430 PS_PTR_CHECK_NULL(x, NULL); 431 431 PS_CHECK_NULL_VECTOR(y, NULL); 432 432 PS_CHECK_EMPTY_VECTOR(y, NULL); … … 865 865 static psVector *yErr64Static = NULL; 866 866 867 VECTOR_CHECK_TYPE_F32_OR_F64(y, NULL);867 PS_VECTOR_CHECK_TYPE_F32_OR_F64(y, NULL); 868 868 CONVERT_VECTOR_F32_TO_F64(y, y64, y64Static); 869 869 … … 873 873 yErr64 = yErr64Static; 874 874 } else { 875 VECTOR_CHECK_TYPE_F32_OR_F64(yErr, NULL);875 PS_VECTOR_CHECK_TYPE_F32_OR_F64(yErr, NULL); 876 876 CONVERT_VECTOR_F32_TO_F64(yErr, yErr64, yErr64Static); 877 877 } … … 885 885 x64 = x64Static; 886 886 } else { 887 VECTOR_CHECK_TYPE_F32_OR_F64(x, NULL);887 PS_VECTOR_CHECK_TYPE_F32_OR_F64(x, NULL); 888 888 CONVERT_VECTOR_F32_TO_F64(x, x64, x64Static); 889 889 } … … 1321 1321 PS_CHECK_NULL_VECTOR(params, NULL); 1322 1322 PS_CHECK_EMPTY_VECTOR(params, NULL); 1323 PS_ CHECK_NULL_PTR(min, NULL);1324 PS_ CHECK_NULL_PTR(coords, NULL);1325 PS_ CHECK_NULL_PTR(func, NULL);1323 PS_PTR_CHECK_NULL(min, NULL); 1324 PS_PTR_CHECK_NULL(coords, NULL); 1325 PS_PTR_CHECK_NULL(func, NULL); 1326 1326 1327 1327 psS32 numDims = params->n; -
trunk/psLib/src/dataManip/psStats.c
r2208 r2212 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.7 1$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-10-27 01:21:01$11 * @version $Revision: 1.72 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-10-27 20:07:17 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 1733 1733 return(stats); 1734 1734 } 1735 PS_ CHECK_NULL_PTR(stats, NULL);1735 PS_PTR_CHECK_NULL(stats, NULL); 1736 1736 1737 1737 inF32 = p_psConvertToF32((psVector *) in); -
trunk/psLib/src/image/psImageStats.c
r2206 r2212 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.4 5$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-10-27 01:15:47 $11 * @version $Revision: 1.46 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-10-27 20:07:17 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 112 112 113 113 // NOTE: Verify this action. 114 PS_ CHECK_NULL_PTR(out, NULL);115 PS_ CHECK_NULL_PTR(in, NULL);114 PS_PTR_CHECK_NULL(out, NULL); 115 PS_PTR_CHECK_NULL(in, NULL); 116 116 117 117 junkData = psAlloc(sizeof(psVector)); -
trunk/psLib/src/imageops/psImageStats.c
r2206 r2212 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.4 5$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-10-27 01:15:47 $11 * @version $Revision: 1.46 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-10-27 20:07:17 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 112 112 113 113 // NOTE: Verify this action. 114 PS_ CHECK_NULL_PTR(out, NULL);115 PS_ CHECK_NULL_PTR(in, NULL);114 PS_PTR_CHECK_NULL(out, NULL); 115 PS_PTR_CHECK_NULL(in, NULL); 116 116 117 117 junkData = psAlloc(sizeof(psVector)); -
trunk/psLib/src/math/psConstants.h
r2211 r2212 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1. 19$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-10-27 19:58:54$8 * @version $Revision: 1.20 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-10-27 20:07:17 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 95 95 96 96 /***************************************************************************** 97 97 Macros which take a generic psLib type and determine if it is NULL, or has 98 the wrong type. 98 99 *****************************************************************************/ 99 #define PS_ CHECK_NULL_PTR(NAME, RVAL) \100 #define PS_PTR_CHECK_NULL(NAME, RVAL) \ 100 101 if (NAME == NULL) { \ 101 102 psError(__func__,"Unallowable operation: %s is NULL.", #NAME); \ … … 103 104 } 104 105 105 /***************************************************************************** 106 107 *****************************************************************************/ 108 #define VECTOR_CHECK_TYPE_F32_OR_F64(VEC, RVAL) \ 106 #define PS_PTR_CHECK_TYPE(NAME, TYPE, RVAL) \ 107 if (NAME->type.type != TYPE) { \ 108 psError(__func__,"Unallowable operation: %s has incorrect type.", #NAME); \ 109 return(RVAL); \ 110 } 111 /***************************************************************************** 112 113 *****************************************************************************/ 114 #define PS_VECTOR_CHECK_TYPE_F32_OR_F64(VEC, RVAL) \ 109 115 if ((VEC->type.type != PS_TYPE_F32) && (VEC->type.type != PS_TYPE_F64)) { \ 110 116 psAbort(__func__, "Bad type for VEC (%d)", VEC->type.type); \ -
trunk/psLib/src/math/psMinimize.c
r2211 r2212 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.6 5$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-10-27 19:58:54$11 * @version $Revision: 1.66 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-10-27 20:07:17 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 252 252 static psVector *yErr32Static = NULL; 253 253 254 PS_ CHECK_NULL_PTR(mySpline, NULL);255 PS_ CHECK_NULL_PTR(y, NULL);256 VECTOR_CHECK_TYPE_F32_OR_F64(y, NULL);254 PS_PTR_CHECK_NULL(mySpline, NULL); 255 PS_PTR_CHECK_NULL(y, NULL); 256 PS_VECTOR_CHECK_TYPE_F32_OR_F64(y, NULL); 257 257 CONVERT_VECTOR_F64_TO_F32(y, y32, y32Static); 258 258 … … 262 262 yErr32 = yErr32Static; 263 263 } else { 264 VECTOR_CHECK_TYPE_F32_OR_F64(yErr, NULL);264 PS_VECTOR_CHECK_TYPE_F32_OR_F64(yErr, NULL); 265 265 CONVERT_VECTOR_F64_TO_F32(yErr, yErr32, yErr32Static); 266 266 } … … 271 271 x32 = x32Static; 272 272 } else { 273 VECTOR_CHECK_TYPE_F32_OR_F64(x, NULL);273 PS_VECTOR_CHECK_TYPE_F32_OR_F64(x, NULL); 274 274 CONVERT_VECTOR_F64_TO_F32(x, x32, x32Static); 275 275 } … … 425 425 psMinimizeLMChi2Func func) 426 426 { 427 PS_ CHECK_NULL_PTR(min, NULL);427 PS_PTR_CHECK_NULL(min, NULL); 428 428 PS_CHECK_NULL_VECTOR(params, NULL); 429 429 PS_CHECK_EMPTY_VECTOR(params, NULL); 430 PS_ CHECK_NULL_PTR(x, NULL);430 PS_PTR_CHECK_NULL(x, NULL); 431 431 PS_CHECK_NULL_VECTOR(y, NULL); 432 432 PS_CHECK_EMPTY_VECTOR(y, NULL); … … 865 865 static psVector *yErr64Static = NULL; 866 866 867 VECTOR_CHECK_TYPE_F32_OR_F64(y, NULL);867 PS_VECTOR_CHECK_TYPE_F32_OR_F64(y, NULL); 868 868 CONVERT_VECTOR_F32_TO_F64(y, y64, y64Static); 869 869 … … 873 873 yErr64 = yErr64Static; 874 874 } else { 875 VECTOR_CHECK_TYPE_F32_OR_F64(yErr, NULL);875 PS_VECTOR_CHECK_TYPE_F32_OR_F64(yErr, NULL); 876 876 CONVERT_VECTOR_F32_TO_F64(yErr, yErr64, yErr64Static); 877 877 } … … 885 885 x64 = x64Static; 886 886 } else { 887 VECTOR_CHECK_TYPE_F32_OR_F64(x, NULL);887 PS_VECTOR_CHECK_TYPE_F32_OR_F64(x, NULL); 888 888 CONVERT_VECTOR_F32_TO_F64(x, x64, x64Static); 889 889 } … … 1321 1321 PS_CHECK_NULL_VECTOR(params, NULL); 1322 1322 PS_CHECK_EMPTY_VECTOR(params, NULL); 1323 PS_ CHECK_NULL_PTR(min, NULL);1324 PS_ CHECK_NULL_PTR(coords, NULL);1325 PS_ CHECK_NULL_PTR(func, NULL);1323 PS_PTR_CHECK_NULL(min, NULL); 1324 PS_PTR_CHECK_NULL(coords, NULL); 1325 PS_PTR_CHECK_NULL(func, NULL); 1326 1326 1327 1327 psS32 numDims = params->n; -
trunk/psLib/src/math/psStats.c
r2208 r2212 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.7 1$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-10-27 01:21:01$11 * @version $Revision: 1.72 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-10-27 20:07:17 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 1733 1733 return(stats); 1734 1734 } 1735 PS_ CHECK_NULL_PTR(stats, NULL);1735 PS_PTR_CHECK_NULL(stats, NULL); 1736 1736 1737 1737 inF32 = p_psConvertToF32((psVector *) in);
Note:
See TracChangeset
for help on using the changeset viewer.
