Changeset 7766
- Timestamp:
- Jun 29, 2006, 4:20:43 PM (20 years ago)
- Location:
- trunk/psLib/src
- Files:
-
- 1 added
- 43 edited
-
astro/psCoord.c (modified) (2 diffs)
-
astro/psCoord.h (modified) (2 diffs)
-
astro/psEarthOrientation.c (modified) (2 diffs)
-
astro/psSphereOps.c (modified) (2 diffs)
-
astro/psTime.c (modified) (2 diffs)
-
db/psDB.c (modified) (2 diffs)
-
imageops/psImageBackground.c (modified) (1 diff)
-
imageops/psImageGeomManip.c (modified) (2 diffs)
-
imageops/psImageMaskOps.c (modified) (2 diffs)
-
imageops/psImagePixelManip.c (modified) (2 diffs)
-
imageops/psImageStats.c (modified) (3 diffs)
-
imageops/psImageUnbin.c (modified) (1 diff)
-
jpeg/psImageJpeg.c (modified) (1 diff)
-
math/psBinaryOp.c (modified) (2 diffs)
-
math/psConstants.h (modified) (3 diffs)
-
math/psEllipse.c (modified) (1 diff)
-
math/psMathUtils.c (modified) (2 diffs)
-
math/psMatrix.c (modified) (2 diffs)
-
math/psMinimizeLMM.c (modified) (2 diffs)
-
math/psMinimizeLMM.h (modified) (2 diffs)
-
math/psMinimizePolyFit.c (modified) (2 diffs)
-
math/psMinimizePowell.c (modified) (2 diffs)
-
math/psPolynomial.c (modified) (2 diffs)
-
math/psPolynomial.h (modified) (2 diffs)
-
math/psPolynomialUtils.c (modified) (1 diff)
-
math/psRandom.c (modified) (2 diffs)
-
math/psSparse.c (modified) (1 diff)
-
math/psSpline.c (modified) (3 diffs)
-
math/psSpline.h (modified) (3 diffs)
-
math/psStats.c (modified) (2 diffs)
-
math/psUnaryOp.c (modified) (2 diffs)
-
math/psVectorSmooth.c (modified) (1 diff)
-
mathtypes/psImage.c (modified) (2 diffs)
-
mathtypes/psImage.h (modified) (2 diffs)
-
mathtypes/psVector.h (modified) (2 diffs)
-
sys/Makefile.am (modified) (1 diff)
-
sys/psAssert.h (added)
-
sys/psString.c (modified) (2 diffs)
-
types/psHash.c (modified) (2 diffs)
-
types/psLookupTable.c (modified) (2 diffs)
-
types/psMetadata.c (modified) (2 diffs)
-
types/psMetadataConfig.c (modified) (2 diffs)
-
types/psMetadataItemParse.c (modified) (1 diff)
-
xml/psXML.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astro/psCoord.c
r7079 r7766 10 10 * @author GLG, MHPCC 11 11 * 12 * @version $Revision: 1.1 19$ $Name: not supported by cvs2svn $13 * @date $Date: 2006-0 5-06 03:34:21$12 * @version $Revision: 1.120 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2006-06-30 02:20:06 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 22 22 #include "psMemory.h" 23 23 #include "psTime.h" 24 #include "ps Constants.h"24 #include "psAssert.h" 25 25 #include "psError.h" 26 26 #include "psLogMsg.h" -
trunk/psLib/src/astro/psCoord.h
r6874 r7766 11 11 * @author GLG, MHPCC 12 12 * 13 * @version $Revision: 1.5 1$ $Name: not supported by cvs2svn $14 * @date $Date: 2006-0 4-17 22:00:03$13 * @version $Revision: 1.52 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2006-06-30 02:20:06 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 456 456 ); 457 457 458 #define PS_PRINT_PLANE_TRANSFORM(NAME) \ 459 { \ 460 printf("---------------------- Plane Transform ----------------------\n"); \ 461 printf("x:\n"); \ 462 PS_POLY_PRINT_2D(NAME->x); \ 463 printf("y:\n"); \ 464 PS_POLY_PRINT_2D(NAME->y); \ 465 } \ 466 458 467 /// @} 459 468 -
trunk/psLib/src/astro/psEarthOrientation.c
r7118 r7766 8 8 * @author Robert Daniel DeSonia, MHPCC 9 9 * 10 * @version $Revision: 1.3 6$ $Name: not supported by cvs2svn $11 * @date $Date: 2006-0 5-16 01:08:57$10 * @version $Revision: 1.37 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2006-06-30 02:20:06 $ 12 12 * 13 13 * Copyright 2005 Maui High Performance Computing Center, University of Hawaii … … 27 27 #include "psMemory.h" 28 28 #include "psCoord.h" 29 #include "ps Constants.h"29 #include "psAssert.h" 30 30 31 31 // Sun's Mass (src: Google's Calculator Service) -
trunk/psLib/src/astro/psSphereOps.c
r6534 r7766 8 8 * @author Dave Robbins, MHPCC 9 9 * 10 * @version $Revision: 1.1 2$ $Name: not supported by cvs2svn $11 * @date $Date: 2006-0 3-07 01:53:24$10 * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2006-06-30 02:20:06 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 22 22 #include "psMemory.h" 23 23 #include "psTime.h" 24 #include "ps Constants.h"24 #include "psAssert.h" 25 25 #include "psError.h" 26 26 #include "psLogMsg.h" -
trunk/psLib/src/astro/psTime.c
r7703 r7766 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 89$ $Name: not supported by cvs2svn $13 * @date $Date: 2006-06- 27 04:13:07$12 * @version $Revision: 1.90 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2006-06-30 02:20:06 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 32 32 #include "psMetadataConfig.h" 33 33 #include "psLookupTable.h" 34 #include "ps Constants.h"34 #include "psAssert.h" 35 35 #include "psErrorText.h" 36 36 -
trunk/psLib/src/db/psDB.c
r7661 r7766 12 12 * @author Joshua Hoblitt 13 13 * 14 * @version $Revision: 1.6 7$ $Name: not supported by cvs2svn $15 * @date $Date: 2006-06- 24 00:18:48$14 * @version $Revision: 1.68 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2006-06-30 02:20:06 $ 16 16 * 17 17 * Copyright 2005 Joshua Hoblitt, University of Hawaii … … 32 32 #include "psDB.h" 33 33 #include "psMemory.h" 34 #include "psAssert.h" 34 35 #include "psAbort.h" 35 36 #include "psError.h" -
trunk/psLib/src/imageops/psImageBackground.c
r7380 r7766 7 7 #include "psStats.h" 8 8 #include "psType.h" 9 #include "ps Constants.h"9 #include "psAssert.h" 10 10 #include "psRandom.h" 11 11 #include "psError.h" -
trunk/psLib/src/imageops/psImageGeomManip.c
r7524 r7766 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.2 5$ $Name: not supported by cvs2svn $13 * @date $Date: 2006-06- 12 20:44:04$12 * @version $Revision: 1.26 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2006-06-30 02:20:06 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 29 29 #include "psStats.h" 30 30 #include "psMemory.h" 31 #include "ps Constants.h"31 #include "psAssert.h" 32 32 #include "psErrorText.h" 33 33 #include "psCoord.h" -
trunk/psLib/src/imageops/psImageMaskOps.c
r5256 r7766 8 8 * @author David Robbins, MHPCC 9 9 * 10 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $11 * @date $Date: 200 5-10-10 20:12:13$10 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2006-06-30 02:20:06 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 25 25 #include "psStats.h" 26 26 #include "psMemory.h" 27 #include "ps Constants.h"27 #include "psAssert.h" 28 28 #include "psErrorText.h" 29 29 #include "psCoord.h" -
trunk/psLib/src/imageops/psImagePixelManip.c
r7380 r7766 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.1 8$ $Name: not supported by cvs2svn $13 * @date $Date: 2006-06- 07 03:22:06 $12 * @version $Revision: 1.19 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2006-06-30 02:20:06 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 27 27 #include "psStats.h" 28 28 #include "psMemory.h" 29 #include "ps Constants.h"29 #include "psAssert.h" 30 30 #include "psErrorText.h" 31 31 #include "psCoord.h" -
trunk/psLib/src/imageops/psImageStats.c
r7612 r7766 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.9 7$ $Name: not supported by cvs2svn $12 * @date $Date: 2006-06- 21 21:03:49$11 * @version $Revision: 1.98 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2006-06-30 02:20:06 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 29 29 #include "psPolynomial.h" 30 30 #include "psImageStats.h" 31 #include "ps Constants.h"31 #include "psAssert.h" 32 32 #include "psErrorText.h" 33 33 #include "psRegion.h" … … 592 592 return -1; 593 593 }/* else if (col0 == col1 && row0 == row1) { 594 psError(PS_ERR_BAD_PARAMETER_VALUE, true,595 "Invalid psRegion specified. Region contains only 1 pixel.\n");596 return -1;597 }598 */594 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 595 "Invalid psRegion specified. Region contains only 1 pixel.\n"); 596 return -1; 597 } 598 */ 599 599 x0 = col0; 600 600 x1 = col1; -
trunk/psLib/src/imageops/psImageUnbin.c
r7381 r7766 3 3 #include "psError.h" 4 4 #include "psImage.h" 5 #include "ps Constants.h"5 #include "psAssert.h" 6 6 #include "psImageUnbin.h" 7 7 -
trunk/psLib/src/jpeg/psImageJpeg.c
r7736 r7766 9 9 #include "psVector.h" 10 10 #include "psError.h" 11 #include "ps Constants.h"11 #include "psAssert.h" 12 12 #include "psImageJpeg.h" 13 13 -
trunk/psLib/src/math/psBinaryOp.c
r7192 r7766 30 30 * @author Robert DeSonia, MHPCC 31 31 * 32 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $33 * @date $Date: 2006-0 5-24 03:10:14$32 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 33 * @date $Date: 2006-06-30 02:20:06 $ 34 34 * 35 35 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 49 49 #include "psScalar.h" 50 50 #include "psLogMsg.h" 51 #include "ps Constants.h"51 #include "psAssert.h" 52 52 #include "psErrorText.h" 53 53 -
trunk/psLib/src/math/psConstants.h
r7765 r7766 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1.9 2$ $Name: not supported by cvs2svn $9 * @date $Date: 2006-06-30 0 1:57:46 $8 * @version $Revision: 1.93 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-06-30 02:20:06 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 45 45 46 46 /***************************************************************************** 47 48 *****************************************************************************/49 50 #define PS_ASSERT_INT_UNEQUAL(NAME1, NAME2, RVAL) \51 if ((NAME1) == (NAME2)) { \52 psError(PS_ERR_BAD_PARAMETER_VALUE, true, \53 "Error: %s and %s are equal.", \54 #NAME1, #NAME2); \55 return(RVAL); \56 }57 58 #define PS_ASSERT_INT_EQUAL(NAME1, NAME2, RVAL) \59 if ((NAME1) != (NAME2)) { \60 psError(PS_ERR_BAD_PARAMETER_VALUE, true, \61 "Error: %s and %s are not equal.", \62 #NAME1, #NAME2); \63 return(RVAL); \64 }65 66 #define PS_ASSERT_INT_NONNEGATIVE(NAME, RVAL) \67 if ((NAME) < 0) { \68 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Error: %s is less than 0.", #NAME); \69 return(RVAL); \70 }71 72 #define PS_ASSERT_INT_POSITIVE(NAME, RVAL) \73 if ((NAME) < 1) { \74 psError(PS_ERR_BAD_PARAMETER_VALUE, true, \75 "Error: %s is 0 or less.", #NAME); \76 return(RVAL); \77 }78 79 #define PS_ASSERT_INT_ZERO(NAME, RVAL) \80 if ((NAME) != 0) { \81 psError(PS_ERR_BAD_PARAMETER_VALUE, true, \82 "Error: %s is 0.", #NAME); \83 return(RVAL); \84 }85 86 #define PS_ASSERT_INT_NONZERO(NAME, RVAL) \87 if ((NAME) == 0) { \88 psError(PS_ERR_BAD_PARAMETER_VALUE, true, \89 "Error: %s is 0.", #NAME); \90 return(RVAL); \91 }92 93 // XXX: Where did these int casts come from?94 #define PS_ASSERT_INT_WITHIN_RANGE(NAME, LOWER, UPPER, RVAL) \95 if ((int)(NAME) < LOWER || (int)(NAME) > UPPER) { \96 psError(PS_ERR_BAD_PARAMETER_VALUE, true, \97 "Error: %s, %d, is out of range. Must be between %d and %d.", \98 #NAME,(int)NAME,LOWER,UPPER); \99 return RVAL; \100 }101 102 #define PS_ASSERT_INT_LESS_THAN(VAR1, VAR2, RVAL) \103 if (!(VAR1 < VAR2)) { \104 psError(PS_ERR_UNKNOWN, true, \105 "Error: %s is not less than %s (%d, %d)", #VAR1, #VAR2, VAR1, VAR2); \106 return(RVAL); \107 }108 109 #define PS_ASSERT_INT_LESS_THAN_OR_EQUAL(VAR1, VAR2, RVAL) \110 if (!(VAR1 <= VAR2)) { \111 psError(PS_ERR_UNKNOWN, true, \112 "Error: %s is not less than %s (%d, %d)", #VAR1, #VAR2, VAR1, VAR2); \113 return(RVAL); \114 }115 116 #define PS_ASSERT_INT_LARGER_THAN(NAME1, NAME2, RVAL) \117 if (!((NAME1) > (NAME2))) { \118 psError(PS_ERR_BAD_PARAMETER_VALUE, true, \119 "Error: !(%s > %s) (%d %d).", \120 #NAME1, #NAME2, NAME1, NAME2); \121 return(RVAL); \122 }123 124 #define PS_ASSERT_INT_LARGER_THAN_OR_EQUAL(NAME1, NAME2, RVAL) \125 if (!((NAME1) >= (NAME2))) { \126 psError(PS_ERR_BAD_PARAMETER_VALUE, true, \127 "Error: !(%s >= %s) (%d %d).", \128 #NAME1, #NAME2, NAME1, NAME2); \129 return(RVAL); \130 }131 #define PS_ASSERT_FLOAT_LARGER_THAN(NAME1, NAME2, RVAL) \132 if (!((NAME1) > (NAME2))) { \133 psError(PS_ERR_BAD_PARAMETER_VALUE, true, \134 "Error: !(%s > %s) (%f %f).", \135 #NAME1, #NAME2, NAME1, NAME2); \136 return(RVAL); \137 }138 139 #define PS_ASSERT_FLOAT_LARGER_THAN_OR_EQUAL(NAME1, NAME2, RVAL) \140 if (!((NAME1) >= (NAME2))) { \141 psError(PS_ERR_BAD_PARAMETER_VALUE, true, \142 "Error: !(%s >= %s) (%f %f).", \143 #NAME1, #NAME2, NAME1, NAME2); \144 return(RVAL); \145 }146 147 #define PS_ASSERT_FLOAT_LESS_THAN(NAME1, NAME2, RVAL) \148 if (!((NAME1) < (NAME2))) { \149 psError(PS_ERR_BAD_PARAMETER_VALUE, true, \150 "Error: !(%s < %s) (%f %f).", \151 #NAME1, #NAME2, NAME1, NAME2); \152 return(RVAL); \153 }154 155 #define PS_ASSERT_FLOAT_LESS_THAN_OR_EQUAL(NAME1, NAME2, RVAL) \156 if (!((NAME1) <= (NAME2))) { \157 psError(PS_ERR_BAD_PARAMETER_VALUE, true, \158 "Error: !(%s <= %s) (%f %f).", \159 #NAME1, #NAME2, NAME1, NAME2); \160 return(RVAL); \161 }162 163 #define PS_ASSERT_FLOAT_NON_EQUAL(NAME1, NAME2, RVAL) \164 if (fabs((NAME2) - (NAME1)) < FLT_EPSILON) { \165 psError(PS_ERR_BAD_PARAMETER_VALUE, true, \166 "Error: %s and %s are equal.", \167 #NAME1, #NAME2); \168 return(RVAL); \169 }170 171 #define PS_ASSERT_FLOAT_EQUAL(NAME1, NAME2, RVAL) \172 if (fabs((NAME2) - (NAME1)) > FLT_EPSILON) { \173 psError(PS_ERR_BAD_PARAMETER_VALUE, true, \174 "Error: %s and %s are not equal.", \175 #NAME1, #NAME2); \176 return(RVAL); \177 }178 179 // Return an error if the arg lies outside the supplied range.180 #define PS_ASSERT_FLOAT_WITHIN_RANGE(NAME, LOWER, UPPER, RVAL) \181 if ((NAME) < (LOWER) || (NAME) > (UPPER)) { \182 psError(PS_ERR_BAD_PARAMETER_VALUE, true, \183 "Error: %s, %f, is out of range. Must be between %f and %f.", \184 #NAME, NAME, LOWER, UPPER); \185 return RVAL; \186 }187 188 #define PS_ASSERT_DOUBLE_WITHIN_RANGE(NAME, LOWER, UPPER, RVAL) \189 if ((NAME) < (LOWER) || (NAME) > (UPPER)) { \190 psError(PS_ERR_BAD_PARAMETER_VALUE, true, \191 "Error: %s, %lf, is out of range. Must be between %lf and %lf.", \192 #NAME, NAME, LOWER, UPPER); \193 return RVAL; \194 }195 196 #define PS_ASSERT_LONG_WITHIN_RANGE(NAME, LOWER, UPPER, RVAL) \197 if ((NAME) < (LOWER) || (NAME) > (UPPER)) { \198 psError(PS_ERR_BAD_PARAMETER_VALUE, true, \199 "Error: %s, %lld, is out of range.", \200 #NAME, NAME, LOWER, UPPER); \201 return RVAL; \202 }203 204 /*****************************************************************************205 Macros which take a generic psLib type and determine if it is NULL, or has206 the wrong type.207 *****************************************************************************/208 #define PS_WARN_PTR_NON_NULL(NAME) \209 if ((NAME) == NULL) { \210 psLogMsg(__func__, PS_LOG_WARN, "WARNING: %s is NULL.", #NAME); \211 } \212 213 #define PS_ASSERT_PTR_NON_NULL(NAME, RVAL) PS_ASSERT_GENERAL_PTR_NON_NULL(NAME, return RVAL)214 #define PS_ASSERT_GENERAL_PTR_NON_NULL(NAME, CLEANUP) \215 if ((NAME) == NULL) { \216 psError(PS_ERR_BAD_PARAMETER_NULL, true, \217 "Unallowable operation: %s is NULL.", \218 #NAME); \219 CLEANUP; \220 }221 222 #define PS_ASSERT_PTR_TYPE(NAME, TYPE, RVAL) \223 if ((NAME)->type.type != TYPE) { \224 psError(PS_ERR_BAD_PARAMETER_TYPE, true, \225 "Unallowable operation: %s has incorrect type.", \226 #NAME); \227 return(RVAL); \228 }229 230 #define PS_ASSERT_PTR_DIMEN(NAME, DIMEN, RVAL) PS_ASSERT_GENERAL_PTR_DIMEN(NAME, DIMEN, return RVAL)231 #define PS_ASSERT_GENERAL_PTR_DIMEN(NAME, DIMEN, CLEANUP) \232 if ((NAME)->type.dimen != DIMEN) { \233 psError(PS_ERR_BAD_PARAMETER_TYPE, true, \234 "Unallowable operation: %s has incorrect dimensionality.", \235 #NAME); \236 CLEANUP; \237 }238 239 #define PS_ASSERT_PTR_DIMEN_GENERAL_NOT(NAME, DIMEN, CLEANUP) \240 if ((NAME)->type.dimen == DIMEN) { \241 psError(PS_ERR_BAD_PARAMETER_TYPE, true, \242 "Unallowable operation: %s has incorrect dimensionality.", \243 #NAME); \244 CLEANUP; \245 }246 247 248 #define PS_ASSERT_PTRS_SIZE_EQUAL(PTR1, PTR2, RVAL) \249 if (PTR1->n != PTR2->n) { \250 psError(PS_ERR_BAD_PARAMETER_SIZE, true, \251 "ptr %s has size %d, ptr %s has size %d.", \252 #PTR1, PTR1->n, #PTR2, PTR2->n); \253 return(RVAL); \254 }255 256 #define PS_ASSERT_PTR_TYPE_EQUAL(PTR1, PTR2, RVAL) PS_ASSERT_PTRS_TYPE_EQUAL_GENERAL(PTR1, PTR2, return RVAL)257 #define PS_ASSERT_PTRS_TYPE_EQUAL_GENERAL(PTR1, PTR2, CLEANUP) \258 if (PTR1->type.type != PTR2->type.type) { \259 psError(PS_ERR_BAD_PARAMETER_TYPE, true, \260 "ptr %s has type %d, ptr %s has type %d.", \261 #PTR1, PTR1->type.type, #PTR2, PTR2->type.type); \262 CLEANUP; \263 }264 265 266 /*****************************************************************************267 PS_VECTOR macros:268 *****************************************************************************/269 #define PS_ASSERT_VECTOR_NON_NULL(NAME, RVAL) PS_ASSERT_GENERAL_VECTOR_NON_NULL(NAME, return RVAL)270 #define PS_ASSERT_GENERAL_VECTOR_NON_NULL(NAME, CLEANUP) \271 if ((NAME) == NULL || (NAME)->data.U8 == NULL) { \272 psError(PS_ERR_BAD_PARAMETER_NULL, true, \273 "Unallowable operation: psVector %s or its data is NULL.", \274 #NAME); \275 CLEANUP; \276 } \277 278 #define PS_ASSERT_VECTOR_NON_EMPTY(NAME, RVAL) PS_ASSERT_GENERAL_VECTOR_NON_EMPTY(NAME, return RVAL)279 #define PS_ASSERT_GENERAL_VECTOR_NON_EMPTY(NAME, CLEANUP) \280 if ((NAME)->n < 1) { \281 psError(PS_ERR_BAD_PARAMETER_SIZE, true, \282 "Unallowable operation: psVector %s has no elements.", \283 #NAME); \284 CLEANUP; \285 } \286 287 #define PS_ASSERT_VECTOR_TYPE_F32_OR_F64(NAME, RVAL) \288 if (((NAME)->type.type != PS_TYPE_F32) && ((NAME)->type.type != PS_TYPE_F64)) { \289 psError(PS_ERR_BAD_PARAMETER_TYPE, true, \290 "psVector %s: bad type(%d)", \291 #NAME, NAME->type.type); \292 return(RVAL); \293 } \294 295 #define PS_ASSERT_VECTOR_TYPE_S16_S32_F32(NAME, RVAL) \296 if (((NAME)->type.type != PS_TYPE_S16) && ((NAME)->type.type != PS_TYPE_S32) && ((NAME)->type.type != PS_TYPE_F32)) { \297 psError(PS_ERR_BAD_PARAMETER_TYPE, true, \298 "psVector %s: bad type(%d)", \299 #NAME, NAME->type.type); \300 return(RVAL); \301 } \302 303 #define PS_ASSERT_VECTOR_TYPE(NAME, TYPE, RVAL) \304 if ((NAME)->type.type != TYPE) { \305 psError(PS_ERR_BAD_PARAMETER_TYPE, true, \306 "Unallowable operation: psVector %s has incorrect type.", \307 #NAME); \308 return(RVAL); \309 }310 311 #define PS_ASSERT_VECTORS_SIZE_EQUAL(VEC1, VEC2, RVAL) \312 if (VEC1->n != VEC2->n) { \313 psError(PS_ERR_BAD_PARAMETER_SIZE, true, \314 "psVector %s has size %d, psVector %s has size %d.", \315 #VEC1, VEC1->n, #VEC2, VEC2->n); \316 return(RVAL); \317 }318 319 #define PS_ASSERT_VECTOR_SIZE(VEC, SIZE, RVAL) \320 if (VEC->n != SIZE) { \321 psError(PS_ERR_BAD_PARAMETER_SIZE, true, \322 "psVector %s has size %d, should be %d.", \323 #VEC, VEC->n, SIZE); \324 return(RVAL); \325 }326 327 #define PS_ASSERT_VECTOR_TYPE_EQUAL(VEC1, VEC2, RVAL) \328 if (VEC1->type.type != VEC2->type.type) { \329 psError(PS_ERR_BAD_PARAMETER_SIZE, true, \330 "psVector %s has size %d, psVector %s has size %d.", \331 #VEC1, VEC1->type.type, #VEC2, VEC2->type.type); \332 return(RVAL); \333 }334 335 #define PS_VECTOR_PRINT_F32(NAME) \336 if (NAME != NULL) { \337 for (int my_i=0;my_i<(NAME)->n;my_i++) { \338 printf("%s->data.F32[%d] is %f\n", #NAME, my_i, (NAME)->data.F32[my_i]); \339 } \340 printf("\n"); \341 } else {\342 printf("MACRO WARNING: vector %s is NULL.\n", #NAME); \343 }\344 345 #define PS_VECTOR_PRINT_F64(NAME) \346 if (NAME != NULL) { \347 for (int my_i=0;my_i<(NAME)->n;my_i++) { \348 printf("%s->data.F64[%d] is %f\n", #NAME, my_i, (NAME)->data.F64[my_i]); \349 } \350 printf("\n"); \351 } else {\352 printf("MACRO WARNING: vector %s is NULL.\n", #NAME); \353 }\354 355 /*****************************************************************************356 PS_POLY macros:357 *****************************************************************************/358 #define PS_ASSERT_POLY1D(NAME, RVAL) \359 if (false == psMemCheckPolynomial1D(NAME)) { \360 psError(PS_ERR_BAD_PARAMETER_NULL, true, \361 "Unallowable operation: argument %s is not a psPolynomial1D struct.\n",\362 #NAME); \363 return(RVAL); \364 } \365 366 #define PS_ASSERT_POLY_NON_NULL(NAME, RVAL) \367 if ((NAME) == NULL || (NAME)->coeff == NULL) { \368 psError(PS_ERR_BAD_PARAMETER_NULL, true, \369 "Unallowable operation: polynomial %s or its coeffs is NULL.", \370 #NAME); \371 return(RVAL); \372 } \373 374 #define PS_ASSERT_POLY_TYPE(NAME, TYPE, RVAL) \375 if ((NAME)->type != TYPE) { \376 psError(PS_ERR_BAD_PARAMETER_TYPE, true, \377 "Unallowable operation: polynomial %s has wrong type.", #NAME); \378 return(RVAL); \379 } \380 381 #define PS_POLY_PRINT_1D(NAME) \382 printf("Poly %s: (nX) is (%d)\n", #NAME, NAME->nX);\383 for (psS32 i = 0 ; i < NAME->nX+1 ; i++) {\384 printf("%s->coeff[%d] is %f\n", #NAME, i, NAME->coeff[i]); \385 }\386 387 #define PS_POLY_PRINT_2D(NAME) \388 printf("Poly %s: (nX, nY) is (%d, %d)\n", #NAME, NAME->nX, NAME->nY);\389 for (psS32 i = 0 ; i < NAME->nX+1 ; i++) {\390 for (psS32 j = 0 ; j < NAME->nY+1 ; j++) {\391 printf("%s->coeff[%d][%d] is %f\n", #NAME, i, j, NAME->coeff[i][j]); \392 }\393 }\394 395 #define PS_PRINT_PLANE_TRANSFORM(NAME) \396 { \397 printf("---------------------- Plane Transform ----------------------\n"); \398 printf("x:\n"); \399 PS_POLY_PRINT_2D(NAME->x); \400 printf("y:\n"); \401 PS_POLY_PRINT_2D(NAME->y); \402 } \403 404 405 /*****************************************************************************406 PS_SPLINE macros:407 *****************************************************************************/408 #define PS_ASSERT_SPLINE(NAME, RVAL) \409 if (false == psMemCheckSpline1D(NAME)) { \410 psError(PS_ERR_BAD_PARAMETER_NULL, true, \411 "Unallowable operation: argument %s is not a psSpline1D struct.\n",\412 #NAME); \413 return(RVAL); \414 } \415 416 #define PS_ASSERT_SPLINE_NON_NULL(NAME, RVAL) \417 if ((NAME) == NULL) { \418 psError(PS_ERR_BAD_PARAMETER_NULL, true, \419 "Unallowable operation: psSpline1D %s is NULL.", \420 #NAME); \421 return(RVAL); \422 } \423 424 /*****************************************************************************425 PS_IMAGE macros:426 *****************************************************************************/427 #define PS_ASSERT_IMAGE_NON_NULL(NAME, RVAL) PS_ASSERT_GENERAL_IMAGE_NON_NULL(NAME, return RVAL)428 #define PS_ASSERT_GENERAL_IMAGE_NON_NULL(NAME, CLEANUP) \429 if ((NAME) == NULL || (NAME)->data.V == NULL) { \430 psError(PS_ERR_BAD_PARAMETER_NULL, true, \431 "Unallowable operation: psImage %s or its data is NULL.", \432 #NAME); \433 CLEANUP; \434 }435 436 #define PS_ASSERT_IMAGE_NON_EMPTY(NAME, RVAL) PS_ASSERT_GENERAL_IMAGE_NON_EMPTY(NAME, return RVAL)437 #define PS_ASSERT_GENERAL_IMAGE_NON_EMPTY(NAME, CLEANUP) \438 if ((NAME)->numCols < 1 || (NAME)->numRows < 1) { \439 psError(PS_ERR_BAD_PARAMETER_SIZE, true, \440 "Unallowable operation: psImage %s has zero rows or columns (%dx%d).", \441 #NAME, (NAME)->numCols, (NAME)->numRows); \442 CLEANUP; \443 }444 445 #define PS_ASSERT_IMAGE_TYPE(NAME, TYPE, RVAL) \446 if ((NAME)->type.type != TYPE) { \447 psError(PS_ERR_BAD_PARAMETER_TYPE, true, \448 "Unallowable operation: psImage %s has incorrect type.", \449 #NAME); \450 return(RVAL); \451 }452 453 #define PS_ASSERT_IMAGES_SIZE_EQUAL(NAME1, NAME2, RVAL) \454 if (((NAME1)->numCols != (NAME2)->numCols) || \455 ((NAME1)->numRows != (NAME2)->numRows)) { \456 psError(PS_ERR_BAD_PARAMETER_SIZE, true, \457 "Unallowable operation: psImages %s and %s are not the same size.", \458 #NAME1, #NAME2); \459 return(RVAL); \460 }461 462 #define PS_ASSERT_IMAGE_SIZE(NAME1, NUM_COLS, NUM_ROWS, RVAL) \463 if (((NAME1)->numCols != NUM_COLS) || \464 ((NAME1)->numRows != NUM_ROWS)) { \465 psError(PS_ERR_BAD_PARAMETER_SIZE, true, \466 "Unallowable operation: psImages %s is not the correct size.", \467 #NAME1); \468 return(RVAL); \469 }470 471 #define PS_IMAGE_PRINT_F32(NAME) \472 printf("======== printing %s ========\n", #NAME); \473 for (int i = 0 ; i < (NAME)->numRows ; i++) { \474 for (int j = 0 ; j < (NAME)->numCols ; j++) { \475 printf("%.2f ", (NAME)->data.F32[i][j]); \476 } \477 printf("\n"); \478 }\479 480 #define PS_IMAGE_PRINT_F64(NAME) \481 printf("======== printing %s ========\n", #NAME); \482 for (int i = 0 ; i < (NAME)->numRows ; i++) { \483 for (int j = 0 ; j < (NAME)->numCols ; j++) { \484 printf("%.2f ", (NAME)->data.F64[i][j]); \485 } \486 printf("\n"); \487 }\488 489 /*****************************************************************************490 47 Misc. macros: 491 48 *****************************************************************************/ … … 499 56 ((A) * (A)) 500 57 501 # define PS_SWAP(X,Y) {double tmp=(X); (X) = (Y); (Y) = tmp;}58 #define PS_SWAP(X,Y) {double tmp=(X); (X) = (Y); (Y) = tmp;} -
trunk/psLib/src/math/psEllipse.c
r7380 r7766 1 1 #include <stdio.h> 2 3 2 #include "psConstants.h" 4 3 #include "psEllipse.h" -
trunk/psLib/src/math/psMathUtils.c
r7132 r7766 3 3 * This file contains standard math routines. 4 4 * 5 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $6 * @date $Date: 2006-0 5-18 01:20:51$5 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2006-06-30 02:20:06 $ 7 7 * 8 8 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 24 24 #include "psPolynomial.h" 25 25 #include "psMathUtils.h" 26 #include "psAssert.h" 26 27 #include "psConstants.h" 27 28 #include "psErrorText.h" -
trunk/psLib/src/math/psMatrix.c
r7325 r7766 21 21 * @author Robert DeSonia, MHPCC 22 22 * 23 * @version $Revision: 1. 39$ $Name: not supported by cvs2svn $24 * @date $Date: 2006-06- 03 03:55:12$23 * @version $Revision: 1.40 $ $Name: not supported by cvs2svn $ 24 * @date $Date: 2006-06-30 02:20:06 $ 25 25 * 26 26 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 42 42 #include "psVector.h" 43 43 #include "psMatrix.h" 44 #include "ps Constants.h"44 #include "psAssert.h" 45 45 #include "psErrorText.h" 46 46 #include "psTrace.h" -
trunk/psLib/src/math/psMinimizeLMM.c
r7325 r7766 10 10 * @author EAM, IfA 11 11 * 12 * @version $Revision: 1.1 6$ $Name: not supported by cvs2svn $13 * @date $Date: 2006-06- 03 03:55:12$12 * @version $Revision: 1.17 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2006-06-30 02:20:06 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 24 24 25 25 #include "psAbort.h" 26 #include "psAssert.h" 26 27 #include "psMinimizeLMM.h" 27 28 #include "psImage.h" -
trunk/psLib/src/math/psMinimizeLMM.h
r7102 r7766 8 8 * @author GLG, MHPCC 9 9 * 10 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $11 * @date $Date: 2006-0 5-10 00:49:38$10 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2006-06-30 02:20:06 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 37 37 #include "psError.h" 38 38 #include "psConstants.h" 39 40 #define PS_DETERMINE_BRACKET_STEP_SIZE 0.10 41 #define PS_MAX_LMM_ITERATIONS 100 42 #define PS_MAX_MINIMIZE_ITERATIONS 100 39 43 40 44 /** A data structure for minimization routines. -
trunk/psLib/src/math/psMinimizePolyFit.c
r7753 r7766 10 10 * @author EAM, IfA 11 11 * 12 * @version $Revision: 1.1 5$ $Name: not supported by cvs2svn $13 * @date $Date: 2006-06- 29 20:37:51$12 * @version $Revision: 1.16 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2006-06-30 02:20:06 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 29 29 30 30 #include "psMinimizePolyFit.h" 31 #include "psAssert.h" 31 32 #include "psMinimizeLMM.h" // For Gauss-Jordan routines 32 33 #include "psStats.h" -
trunk/psLib/src/math/psMinimizePowell.c
r7764 r7766 11 11 * NOTE: XXX: The SDR is silent about data types. F32 is implemented here. 12 12 * 13 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $14 * @date $Date: 2006-06-30 0 1:56:22$13 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2006-06-30 02:20:06 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 25 25 26 26 #include "psMinimizePowell.h" 27 #include "psAssert.h" 27 28 #include "psStats.h" 28 29 #include "psImage.h" -
trunk/psLib/src/math/psPolynomial.c
r6500 r7766 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1.14 5$ $Name: not supported by cvs2svn $10 * @date $Date: 2006-0 2-28 02:53:02$9 * @version $Revision: 1.146 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2006-06-30 02:20:06 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 31 31 #include "psLogMsg.h" 32 32 #include "psPolynomial.h" 33 #include "ps Constants.h"33 #include "psAssert.h" 34 34 #include "psErrorText.h" 35 35 -
trunk/psLib/src/math/psPolynomial.h
r6348 r7766 11 11 * @author GLG, MHPCC 12 12 * 13 * @version $Revision: 1.6 2$ $Name: not supported by cvs2svn $14 * @date $Date: 2006-0 2-07 23:36:15$13 * @version $Revision: 1.63 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2006-06-30 02:20:06 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 307 307 308 308 309 /***************************************************************************** 310 PS_POLY macros: 311 *****************************************************************************/ 312 #define PS_ASSERT_POLY1D(NAME, RVAL) \ 313 if (false == psMemCheckPolynomial1D(NAME)) { \ 314 psError(PS_ERR_BAD_PARAMETER_NULL, true, \ 315 "Unallowable operation: argument %s is not a psPolynomial1D struct.\n",\ 316 #NAME); \ 317 return(RVAL); \ 318 } \ 319 320 #define PS_ASSERT_POLY_NON_NULL(NAME, RVAL) \ 321 if ((NAME) == NULL || (NAME)->coeff == NULL) { \ 322 psError(PS_ERR_BAD_PARAMETER_NULL, true, \ 323 "Unallowable operation: polynomial %s or its coeffs is NULL.", \ 324 #NAME); \ 325 return(RVAL); \ 326 } \ 327 328 #define PS_ASSERT_POLY_TYPE(NAME, TYPE, RVAL) \ 329 if ((NAME)->type != TYPE) { \ 330 psError(PS_ERR_BAD_PARAMETER_TYPE, true, \ 331 "Unallowable operation: polynomial %s has wrong type.", #NAME); \ 332 return(RVAL); \ 333 } \ 334 335 #define PS_POLY_PRINT_1D(NAME) \ 336 printf("Poly %s: (nX) is (%d)\n", #NAME, NAME->nX);\ 337 for (psS32 i = 0 ; i < NAME->nX+1 ; i++) {\ 338 printf("%s->coeff[%d] is %f\n", #NAME, i, NAME->coeff[i]); \ 339 }\ 340 341 #define PS_POLY_PRINT_2D(NAME) \ 342 printf("Poly %s: (nX, nY) is (%d, %d)\n", #NAME, NAME->nX, NAME->nY);\ 343 for (psS32 i = 0 ; i < NAME->nX+1 ; i++) {\ 344 for (psS32 j = 0 ; j < NAME->nY+1 ; j++) {\ 345 printf("%s->coeff[%d][%d] is %f\n", #NAME, i, j, NAME->coeff[i][j]); \ 346 }\ 347 }\ 309 348 310 349 /** \} */ // End of MathGroup Functions -
trunk/psLib/src/math/psPolynomialUtils.c
r7541 r7766 7 7 #include "psBinaryOp.h" 8 8 #include "psStats.h" 9 #include "ps Constants.h"9 #include "psAssert.h" 10 10 #include "psPolynomial.h" 11 11 #include "psMinimizePolyFit.h" -
trunk/psLib/src/math/psRandom.c
r4857 r7766 10 10 * @author GLG, MHPCC 11 11 * 12 * @version $Revision: 1.1 1$ $Name: not supported by cvs2svn $13 * @date $Date: 200 5-08-23 23:23:05$12 * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2006-06-30 02:20:06 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 30 30 #include "psTrace.h" 31 31 #include "psLogMsg.h" 32 #include "ps Constants.h"32 #include "psAssert.h" 33 33 #include "psErrorText.h" 34 34 -
trunk/psLib/src/math/psSparse.c
r7550 r7766 9 9 #include "psLogMsg.h" 10 10 #include "psVector.h" 11 #include "psAssert.h" 11 12 #include "psConstants.h" 12 13 #include "psSparse.h" -
trunk/psLib/src/math/psSpline.c
r6788 r7766 6 6 * This file contains the routines that allocate, free, and evaluate splines. 7 7 * 8 * @version $Revision: 1.14 8$ $Name: not supported by cvs2svn $9 * @date $Date: 2006-0 4-05 02:19:00$8 * @version $Revision: 1.149 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-06-30 02:20:06 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 27 27 #include "psPolynomial.h" 28 28 #include "psSpline.h" 29 #include "ps Constants.h"29 #include "psAssert.h" 30 30 #include "psErrorText.h" 31 31 #include "psMathUtils.h" … … 131 131 // 132 132 // The second derivatives at the endpoints, undefined in the SDR, 133 // are set in ps Constants.h: PS_LEFT_SPLINE_DERIV, PS_RIGHT_SPLINE_DERIV.133 // are set in psAssert.h: PS_LEFT_SPLINE_DERIV, PS_RIGHT_SPLINE_DERIV. 134 134 // 135 135 derivs2[0] = -0.5; -
trunk/psLib/src/math/psSpline.h
r6305 r7766 12 12 * @author GLG, MHPCC 13 13 * 14 * @version $Revision: 1. 59$ $Name: not supported by cvs2svn $15 * @date $Date: 2006-0 2-02 21:09:08$14 * @version $Revision: 1.60 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2006-06-30 02:20:06 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 29 29 #include "psScalar.h" 30 30 #include "psPolynomial.h" 31 32 #define PS_LEFT_SPLINE_DERIV 0.0 33 #define PS_RIGHT_SPLINE_DERIV 0.0 31 34 32 35 /** \addtogroup GROUP00 … … 92 95 ); 93 96 97 /***************************************************************************** 98 PS_SPLINE macros: 99 *****************************************************************************/ 100 #define PS_ASSERT_SPLINE(NAME, RVAL) \ 101 if (false == psMemCheckSpline1D(NAME)) { \ 102 psError(PS_ERR_BAD_PARAMETER_NULL, true, \ 103 "Unallowable operation: argument %s is not a psSpline1D struct.\n",\ 104 #NAME); \ 105 return(RVAL); \ 106 } \ 107 108 #define PS_ASSERT_SPLINE_NON_NULL(NAME, RVAL) \ 109 if ((NAME) == NULL) { \ 110 psError(PS_ERR_BAD_PARAMETER_NULL, true, \ 111 "Unallowable operation: psSpline1D %s is NULL.", \ 112 #NAME); \ 113 return(RVAL); \ 114 } \ 115 116 94 117 /** \} */ // End of MathGroup Functions 95 118 -
trunk/psLib/src/math/psStats.c
r7167 r7766 16 16 * use ->min and ->max (PS_STAT_USE_RANGE) 17 17 * 18 * @version $Revision: 1.17 5$ $Name: not supported by cvs2svn $19 * @date $Date: 2006-0 5-22 23:08:22$18 * @version $Revision: 1.176 $ $Name: not supported by cvs2svn $ 19 * @date $Date: 2006-06-30 02:20:06 $ 20 20 * 21 21 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 43 43 #include "psMinimizePolyFit.h" 44 44 #include "psPolynomial.h" 45 #include "ps Constants.h"45 #include "psAssert.h" 46 46 #include "psMathUtils.h" 47 47 -
trunk/psLib/src/math/psUnaryOp.c
r7193 r7766 30 30 * @author Robert DeSonia, MHPCC 31 31 * 32 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $33 * @date $Date: 2006-0 5-24 03:25:14$32 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 33 * @date $Date: 2006-06-30 02:20:06 $ 34 34 * 35 35 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 50 50 #include "psScalar.h" 51 51 #include "psLogMsg.h" 52 #include "ps Constants.h"52 #include "psAssert.h" 53 53 #include "psErrorText.h" 54 54 -
trunk/psLib/src/math/psVectorSmooth.c
r7380 r7766 10 10 #include "psVector.h" 11 11 #include "psVectorSmooth.h" 12 #include "ps Constants.h"12 #include "psAssert.h" 13 13 14 14 -
trunk/psLib/src/mathtypes/psImage.c
r7663 r7766 9 9 * @author Ross Harman, MHPCC 10 10 * 11 * @version $Revision: 1.11 0$ $Name: not supported by cvs2svn $12 * @date $Date: 2006-06- 24 00:22:54$11 * @version $Revision: 1.111 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2006-06-30 02:20:06 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 23 23 #include "psMemory.h" 24 24 #include "psError.h" 25 //#include "psAbort.h"25 #include "psAssert.h" 26 26 #include "psImage.h" 27 27 #include "psString.h" -
trunk/psLib/src/mathtypes/psImage.h
r7579 r7766 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1. 79$ $Name: not supported by cvs2svn $14 * @date $Date: 2006-06- 15 02:29:12$13 * @version $Revision: 1.80 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2006-06-30 02:20:06 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 242 242 #undef PIXEL_INTERPOLATE_FCNS 243 243 244 /***************************************************************************** 245 PS_IMAGE macros: 246 *****************************************************************************/ 247 #define PS_ASSERT_IMAGE_NON_NULL(NAME, RVAL) PS_ASSERT_GENERAL_IMAGE_NON_NULL(NAME, return RVAL) 248 #define PS_ASSERT_GENERAL_IMAGE_NON_NULL(NAME, CLEANUP) \ 249 if ((NAME) == NULL || (NAME)->data.V == NULL) { \ 250 psError(PS_ERR_BAD_PARAMETER_NULL, true, \ 251 "Unallowable operation: psImage %s or its data is NULL.", \ 252 #NAME); \ 253 CLEANUP; \ 254 } 255 256 #define PS_ASSERT_IMAGE_NON_EMPTY(NAME, RVAL) PS_ASSERT_GENERAL_IMAGE_NON_EMPTY(NAME, return RVAL) 257 #define PS_ASSERT_GENERAL_IMAGE_NON_EMPTY(NAME, CLEANUP) \ 258 if ((NAME)->numCols < 1 || (NAME)->numRows < 1) { \ 259 psError(PS_ERR_BAD_PARAMETER_SIZE, true, \ 260 "Unallowable operation: psImage %s has zero rows or columns (%dx%d).", \ 261 #NAME, (NAME)->numCols, (NAME)->numRows); \ 262 CLEANUP; \ 263 } 264 265 #define PS_ASSERT_IMAGE_TYPE(NAME, TYPE, RVAL) \ 266 if ((NAME)->type.type != TYPE) { \ 267 psError(PS_ERR_BAD_PARAMETER_TYPE, true, \ 268 "Unallowable operation: psImage %s has incorrect type.", \ 269 #NAME); \ 270 return(RVAL); \ 271 } 272 273 #define PS_ASSERT_IMAGES_SIZE_EQUAL(NAME1, NAME2, RVAL) \ 274 if (((NAME1)->numCols != (NAME2)->numCols) || \ 275 ((NAME1)->numRows != (NAME2)->numRows)) { \ 276 psError(PS_ERR_BAD_PARAMETER_SIZE, true, \ 277 "Unallowable operation: psImages %s and %s are not the same size.", \ 278 #NAME1, #NAME2); \ 279 return(RVAL); \ 280 } 281 282 #define PS_ASSERT_IMAGE_SIZE(NAME1, NUM_COLS, NUM_ROWS, RVAL) \ 283 if (((NAME1)->numCols != NUM_COLS) || \ 284 ((NAME1)->numRows != NUM_ROWS)) { \ 285 psError(PS_ERR_BAD_PARAMETER_SIZE, true, \ 286 "Unallowable operation: psImages %s is not the correct size.", \ 287 #NAME1); \ 288 return(RVAL); \ 289 } 290 291 #define PS_IMAGE_PRINT_F32(NAME) \ 292 printf("======== printing %s ========\n", #NAME); \ 293 for (int i = 0 ; i < (NAME)->numRows ; i++) { \ 294 for (int j = 0 ; j < (NAME)->numCols ; j++) { \ 295 printf("%.2f ", (NAME)->data.F32[i][j]); \ 296 } \ 297 printf("\n"); \ 298 }\ 299 300 #define PS_IMAGE_PRINT_F64(NAME) \ 301 printf("======== printing %s ========\n", #NAME); \ 302 for (int i = 0 ; i < (NAME)->numRows ; i++) { \ 303 for (int j = 0 ; j < (NAME)->numCols ; j++) { \ 304 printf("%.2f ", (NAME)->data.F64[i][j]); \ 305 } \ 306 printf("\n"); \ 307 }\ 308 244 309 /// @} 245 310 -
trunk/psLib/src/mathtypes/psVector.h
r7579 r7766 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.5 3$ $Name: not supported by cvs2svn $14 * @date $Date: 2006-06- 15 02:29:12$13 * @version $Revision: 1.54 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2006-06-30 02:20:06 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 269 269 270 270 271 /***************************************************************************** 272 PS_VECTOR macros: 273 *****************************************************************************/ 274 275 #define PS_ASSERT_VECTOR_NON_NULL(NAME, RVAL) PS_ASSERT_GENERAL_VECTOR_NON_NULL(NAME, return RVAL) 276 #define PS_ASSERT_GENERAL_VECTOR_NON_NULL(NAME, CLEANUP) \ 277 if ((NAME) == NULL || (NAME)->data.U8 == NULL) { \ 278 psError(PS_ERR_BAD_PARAMETER_NULL, true, \ 279 "Unallowable operation: psVector %s or its data is NULL.", \ 280 #NAME); \ 281 CLEANUP; \ 282 } \ 283 284 #define PS_ASSERT_VECTOR_NON_EMPTY(NAME, RVAL) PS_ASSERT_GENERAL_VECTOR_NON_EMPTY(NAME, return RVAL) 285 #define PS_ASSERT_GENERAL_VECTOR_NON_EMPTY(NAME, CLEANUP) \ 286 if ((NAME)->n < 1) { \ 287 psError(PS_ERR_BAD_PARAMETER_SIZE, true, \ 288 "Unallowable operation: psVector %s has no elements.", \ 289 #NAME); \ 290 CLEANUP; \ 291 } \ 292 293 #define PS_ASSERT_VECTOR_TYPE_F32_OR_F64(NAME, RVAL) \ 294 if (((NAME)->type.type != PS_TYPE_F32) && ((NAME)->type.type != PS_TYPE_F64)) { \ 295 psError(PS_ERR_BAD_PARAMETER_TYPE, true, \ 296 "psVector %s: bad type(%d)", \ 297 #NAME, NAME->type.type); \ 298 return(RVAL); \ 299 } \ 300 301 #define PS_ASSERT_VECTOR_TYPE_S16_S32_F32(NAME, RVAL) \ 302 if (((NAME)->type.type != PS_TYPE_S16) && ((NAME)->type.type != PS_TYPE_S32) && ((NAME)->type.type != PS_TYPE_F32)) { \ 303 psError(PS_ERR_BAD_PARAMETER_TYPE, true, \ 304 "psVector %s: bad type(%d)", \ 305 #NAME, NAME->type.type); \ 306 return(RVAL); \ 307 } \ 308 309 #define PS_ASSERT_VECTOR_TYPE(NAME, TYPE, RVAL) \ 310 if ((NAME)->type.type != TYPE) { \ 311 psError(PS_ERR_BAD_PARAMETER_TYPE, true, \ 312 "Unallowable operation: psVector %s has incorrect type.", \ 313 #NAME); \ 314 return(RVAL); \ 315 } 316 317 #define PS_ASSERT_VECTORS_SIZE_EQUAL(VEC1, VEC2, RVAL) \ 318 if (VEC1->n != VEC2->n) { \ 319 psError(PS_ERR_BAD_PARAMETER_SIZE, true, \ 320 "psVector %s has size %d, psVector %s has size %d.", \ 321 #VEC1, VEC1->n, #VEC2, VEC2->n); \ 322 return(RVAL); \ 323 } 324 325 #define PS_ASSERT_VECTOR_SIZE(VEC, SIZE, RVAL) \ 326 if (VEC->n != SIZE) { \ 327 psError(PS_ERR_BAD_PARAMETER_SIZE, true, \ 328 "psVector %s has size %d, should be %d.", \ 329 #VEC, VEC->n, SIZE); \ 330 return(RVAL); \ 331 } 332 333 #define PS_ASSERT_VECTOR_TYPE_EQUAL(VEC1, VEC2, RVAL) \ 334 if (VEC1->type.type != VEC2->type.type) { \ 335 psError(PS_ERR_BAD_PARAMETER_SIZE, true, \ 336 "psVector %s has size %d, psVector %s has size %d.", \ 337 #VEC1, VEC1->type.type, #VEC2, VEC2->type.type); \ 338 return(RVAL); \ 339 } 340 341 #define PS_VECTOR_PRINT_F32(NAME) \ 342 if (NAME != NULL) { \ 343 for (int my_i=0;my_i<(NAME)->n;my_i++) { \ 344 printf("%s->data.F32[%d] is %f\n", #NAME, my_i, (NAME)->data.F32[my_i]); \ 345 } \ 346 printf("\n"); \ 347 } else {\ 348 printf("MACRO WARNING: vector %s is NULL.\n", #NAME); \ 349 }\ 350 351 #define PS_VECTOR_PRINT_F64(NAME) \ 352 if (NAME != NULL) { \ 353 for (int my_i=0;my_i<(NAME)->n;my_i++) { \ 354 printf("%s->data.F64[%d] is %f\n", #NAME, my_i, (NAME)->data.F64[my_i]); \ 355 } \ 356 printf("\n"); \ 357 } else {\ 358 printf("MACRO WARNING: vector %s is NULL.\n", #NAME); \ 359 }\ 360 271 361 /// @} 272 362 -
trunk/psLib/src/sys/Makefile.am
r7380 r7766 30 30 pslibinclude_HEADERS = \ 31 31 psAbort.h \ 32 psAssert.h \ 32 33 psConfigure.h \ 33 34 psError.h \ -
trunk/psLib/src/sys/psString.c
r7653 r7766 13 13 * @author David Robbins, MHPCC 14 14 * 15 * @version $Revision: 1.3 2$ $Name: not supported by cvs2svn $16 * @date $Date: 2006-06- 23 20:29:39$15 * @version $Revision: 1.33 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2006-06-30 02:20:06 $ 17 17 * 18 18 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 25 25 #include "psMemory.h" 26 26 #include "psError.h" 27 #include "ps Constants.h"27 #include "psAssert.h" 28 28 29 29 #include "psErrorText.h" -
trunk/psLib/src/types/psHash.c
r4898 r7766 12 12 * @author GLG, MHPCC 13 13 * 14 * @version $Revision: 1.2 4$ $Name: not supported by cvs2svn $15 * @date $Date: 200 5-08-30 01:14:13$14 * @version $Revision: 1.25 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2006-06-30 02:20:06 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 25 25 #include "psTrace.h" 26 26 #include "psError.h" 27 #include "ps Constants.h"27 #include "psAssert.h" 28 28 29 29 #include "psErrorText.h" -
trunk/psLib/src/types/psLookupTable.c
r7545 r7766 7 7 * @author Ross Harman, MHPCC 8 8 * 9 * @version $Revision: 1.3 1$ $Name: not supported by cvs2svn $10 * @date $Date: 2006-06- 13 23:54:57$9 * @version $Revision: 1.32 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2006-06-30 02:20:06 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii … … 26 26 #include "psLookupTable.h" 27 27 #include "psErrorText.h" 28 #include "ps Constants.h"28 #include "psAssert.h" 29 29 30 30 /******************************************************************************/ -
trunk/psLib/src/types/psMetadata.c
r7699 r7766 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1.11 4$ $Name: not supported by cvs2svn $15 * @date $Date: 2006-06- 27 03:42:01$14 * @version $Revision: 1.115 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2006-06-30 02:20:06 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 37 37 #include "psString.h" 38 38 #include "psErrorText.h" 39 #include "ps Constants.h"39 #include "psAssert.h" 40 40 #include "psLogMsg.h" 41 41 #include "psTrace.h" -
trunk/psLib/src/types/psMetadataConfig.c
r7472 r7766 10 10 * @author Eric Van Alst, MHPCC 11 11 * 12 * @version $Revision: 1.6 1$ $Name: not supported by cvs2svn $13 * @date $Date: 2006-06- 10 02:28:17$12 * @version $Revision: 1.62 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2006-06-30 02:20:06 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 31 31 #include "psMetadata.h" 32 32 #include "psMetadataConfig.h" 33 #include "ps Constants.h"33 #include "psAssert.h" 34 34 #include "psErrorText.h" 35 35 -
trunk/psLib/src/types/psMetadataItemParse.c
r7380 r7766 4 4 5 5 #include "psMemory.h" 6 #include "psAssert.h" 6 7 #include "psError.h" 7 8 #include "psMetadata.h" -
trunk/psLib/src/xml/psXML.c
r5841 r7766 10 10 * @author David Robbins, MHPCC 11 11 * 12 * @version $Revision: 1.4 4$ $Name: not supported by cvs2svn $13 * @date $Date: 200 5-12-24 00:33:22$12 * @version $Revision: 1.45 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2006-06-30 02:20:06 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 17 17 18 18 #include "psXML.h" 19 #include "psAssert.h" 19 20 #include <unistd.h> 20 21 #include <fcntl.h>
Note:
See TracChangeset
for help on using the changeset viewer.
