Changeset 4898
- Timestamp:
- Aug 29, 2005, 3:14:13 PM (21 years ago)
- Location:
- trunk/psLib
- Files:
-
- 41 edited
-
src/astro/psCoord.c (modified) (4 diffs)
-
src/astro/psCoord.h (modified) (2 diffs)
-
src/astro/psSphereOps.c (modified) (3 diffs)
-
src/astro/psSphereOps.h (modified) (2 diffs)
-
src/astro/psTime.c (modified) (4 diffs)
-
src/astro/psTime.h (modified) (2 diffs)
-
src/fits/psFits.c (modified) (2 diffs)
-
src/fits/psFits.h (modified) (2 diffs)
-
src/imageops/psImageConvolve.c (modified) (2 diffs)
-
src/imageops/psImageConvolve.h (modified) (2 diffs)
-
src/math/psFunctions.c (modified) (2 diffs)
-
src/math/psFunctions.h (modified) (2 diffs)
-
src/math/psMinimize.c (modified) (4 diffs)
-
src/math/psMinimize.h (modified) (2 diffs)
-
src/math/psStats.c (modified) (5 diffs)
-
src/math/psStats.h (modified) (3 diffs)
-
src/mathtypes/psImage.c (modified) (2 diffs)
-
src/mathtypes/psImage.h (modified) (2 diffs)
-
src/mathtypes/psScalar.c (modified) (4 diffs)
-
src/mathtypes/psScalar.h (modified) (2 diffs)
-
src/mathtypes/psVector.c (modified) (2 diffs)
-
src/mathtypes/psVector.h (modified) (3 diffs)
-
src/sys/psMemory.c (modified) (3 diffs)
-
src/sys/psMemory.h (modified) (2 diffs)
-
src/types/psArray.c (modified) (2 diffs)
-
src/types/psArray.h (modified) (3 diffs)
-
src/types/psBitSet.c (modified) (2 diffs)
-
src/types/psBitSet.h (modified) (3 diffs)
-
src/types/psHash.c (modified) (2 diffs)
-
src/types/psHash.h (modified) (2 diffs)
-
src/types/psList.c (modified) (2 diffs)
-
src/types/psList.h (modified) (2 diffs)
-
src/types/psLookupTable.c (modified) (2 diffs)
-
src/types/psLookupTable.h (modified) (2 diffs)
-
src/types/psMetadata.c (modified) (3 diffs)
-
src/types/psMetadata.h (modified) (3 diffs)
-
src/types/psPixels.c (modified) (2 diffs)
-
src/types/psPixels.h (modified) (2 diffs)
-
test/sys/tst_psMemory.c (modified) (4 diffs)
-
test/sys/verified/tst_psMemory.stderr (modified) (1 diff)
-
test/types/tst_psArray.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astro/psCoord.c
r4857 r4898 10 10 * @author GLG, MHPCC 11 11 * 12 * @version $Revision: 1.8 3$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-08- 23 23:23:05$12 * @version $Revision: 1.84 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-08-30 01:14:10 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 219 219 } 220 220 221 222 bool psMemCheckPlane(psPtr ptr) 223 { 224 return ( psMemGetDeallocator(ptr) == (psFreeFunc)planeFree ); 225 } 226 227 bool psMemCheckSphere(psPtr ptr) 228 { 229 return ( psMemGetDeallocator(ptr) == (psFreeFunc)sphereFree ); 230 } 231 232 bool psMemCheckCube(psPtr ptr) 233 { 234 return ( psMemGetDeallocator(ptr) == (psFreeFunc)cubeFree ); 235 } 236 237 bool psMemCheckPlaneTransform(psPtr ptr) 238 { 239 return ( psMemGetDeallocator(ptr) == (psFreeFunc)planeTransformFree ); 240 } 241 221 242 psPlane* psPlaneTransformApply(psPlane* out, 222 243 const psPlaneTransform* transform, … … 267 288 return(pt); 268 289 } 290 291 bool psMemCheckPlaneDistort(psPtr ptr) 292 { 293 return ( psMemGetDeallocator(ptr) == (psFreeFunc)planeDistortFree ); 294 } 295 296 269 297 270 298 /****************************************************************************** … … 343 371 return(p); 344 372 } 373 374 bool psMemCheckProjection(psPtr ptr) 375 { 376 return ( psMemGetDeallocator(ptr) == (psFreeFunc)projectionFree ); 377 } 378 379 345 380 346 381 psPlane* psProject(const psSphere* coord, -
trunk/psLib/src/astro/psCoord.h
r4877 r4898 10 10 * @author GLG, MHPCC 11 11 * 12 * @version $Revision: 1.4 1$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-08- 25 23:42:01$12 * @version $Revision: 1.42 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-08-30 01:14:10 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 219 219 ); 220 220 221 /** Checks the type of a particular pointer. 222 * 223 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 224 * 225 * @return bool: True if the pointer matches a psPlane structure, false otherwise. 226 */ 227 bool psMemCheckPlane( 228 psPtr ptr ///< the pointer whose type to check 229 ); 230 231 /** Checks the type of a particular pointer. 232 * 233 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 234 * 235 * @return bool: True if the pointer matches a psSphere structure, false otherwise. 236 */ 237 bool psMemCheckSphere( 238 psPtr ptr ///< the pointer whose type to check 239 ); 240 241 /** Checks the type of a particular pointer. 242 * 243 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 244 * 245 * @return bool: True if the pointer matches a psCube structure, false otherwise. 246 */ 247 bool psMemCheckCube( 248 psPtr ptr ///< the pointer whose type to check 249 ); 250 251 /** Checks the type of a particular pointer. 252 * 253 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 254 * 255 * @return bool: True if the pointer matches a psPlaneTransform structure, false otherwise. 256 */ 257 bool psMemCheckPlaneTransform( 258 psPtr ptr ///< the pointer whose type to check 259 ); 260 261 /** Checks the type of a particular pointer. 262 * 263 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 264 * 265 * @return bool: True if the pointer matches a psPlaneDistort structure, false otherwise. 266 */ 267 bool psMemCheckPlaneDistort( 268 psPtr ptr ///< the pointer whose type to check 269 ); 270 271 /** Checks the type of a particular pointer. 272 * 273 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 274 * 275 * @return bool: True if the pointer matches a psProjection structure, false otherwise. 276 */ 277 bool psMemCheckProjection( 278 psPtr ptr ///< the pointer whose type to check 279 ); 280 281 221 282 /** Projects a spherical coordinate to a linear coordinate system 222 283 * -
trunk/psLib/src/astro/psSphereOps.c
r4708 r4898 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-08- 05 01:40:45$9 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-08-30 01:14:10 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 33 33 #define JULIAN_CENTURY 36525.0 34 34 35 static void sphereRotFree(psSphereRot *result) 36 { 37 // There are non dynamic allocated items 38 } 35 39 36 40 psSphereRot* psSphereRotAlloc(double alphaP, … … 58 62 // calculate t*s*r. 59 63 psSphereRot* result = psSphereRotCombine(NULL,&t,&s); 64 psMemSetDeallocator(result, (psFreeFunc)sphereRotFree); 60 65 psSphereRotCombine(result,result,&r); 61 66 62 67 return result; 63 68 } 69 70 bool psMemCheckSphereRot(psPtr ptr) 71 { 72 return ( psMemGetDeallocator(ptr) == (psFreeFunc)sphereRotFree ); 73 } 74 64 75 65 76 psSphereRot* psSphereRotQuat(double q0, -
trunk/psLib/src/astro/psSphereOps.h
r4708 r4898 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-08- 05 01:40:45$9 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-08-30 01:14:10 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 72 72 ); 73 73 74 75 /** Checks the type of a particular pointer. 76 * 77 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 78 * 79 * @return bool: True if the pointer matches a psSphereRot structure, false otherwise. 80 */ 81 bool psMemCheckSphereRot( 82 psPtr ptr ///< the pointer whose type to check 83 ); 84 85 74 86 /** Allocator for psSphereRot given quaternions. 75 87 * -
trunk/psLib/src/astro/psTime.c
r4540 r4898 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.6 6$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-0 7-12 19:12:00 $12 * @version $Revision: 1.67 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-08-30 01:14:10 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 434 434 } 435 435 436 static void timeFree(psTime *outTime) 437 { 438 // There are non dynamic allocated items 439 } 440 436 441 psTime* psTimeAlloc(psTimeType type) 437 442 { … … 449 454 // Allocate memory for structure 450 455 outTime = (psTime*)psAlloc(sizeof(psTime)); 451 456 psMemSetDeallocator(outTime, (psFreeFunc)timeFree); 452 457 // Initialize members 453 458 outTime->sec = 0; … … 458 463 return outTime; 459 464 } 465 466 467 bool psMemCheckTime(psPtr ptr) 468 { 469 return ( psMemGetDeallocator(ptr) == (psFreeFunc)timeFree ); 470 } 471 460 472 461 473 psTime* psTimeGetNow(psTimeType type) -
trunk/psLib/src/astro/psTime.h
r4590 r4898 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.3 4$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-0 7-21 02:39:57$13 * @version $Revision: 1.35 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-08-30 01:14:10 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 100 100 ); 101 101 102 103 /** Checks the type of a particular pointer. 104 * 105 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 106 * 107 * @return bool: True if the pointer matches a psTime structure, false otherwise. 108 */ 109 bool psMemCheckTime( 110 psPtr ptr ///< the pointer whose type to check 111 ); 112 113 102 114 /** Get current time. 103 115 * -
trunk/psLib/src/fits/psFits.c
r4891 r4898 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.4 2$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-08- 27 01:33:41$9 * @version $Revision: 1.43 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-08-30 01:14:13 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 253 253 return fits; 254 254 } 255 256 257 bool psMemCheckFits(psPtr ptr) 258 { 259 return ( psMemGetDeallocator(ptr) == (psFreeFunc)fitsFree ); 260 } 261 255 262 256 263 bool psFitsMoveExtName(const psFits* fits, -
trunk/psLib/src/fits/psFits.h
r4343 r4898 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1. 19$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-0 6-22 03:00:27$9 * @version $Revision: 1.20 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-08-30 01:14:13 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 62 62 ); 63 63 64 /** Checks the type of a particular pointer. 65 * 66 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 67 * 68 * @return bool: True if the pointer matches a psFits structure, false otherwise. 69 */ 70 bool psMemCheckFits( 71 psPtr ptr ///< the pointer whose type to check 72 ); 73 74 64 75 /** Moves the FITS HDU to the specified extension name. 65 76 * -
trunk/psLib/src/imageops/psImageConvolve.c
r4815 r4898 5 5 * @author Robert DeSonia, MHPCC 6 6 * 7 * @version $Revision: 1.2 3$ $Name: not supported by cvs2svn $8 * @date $Date: 2005-08- 18 21:44:40$7 * @version $Revision: 1.24 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2005-08-30 01:14:13 $ 9 9 * 10 10 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 86 86 } 87 87 } 88 89 90 bool psMemCheckKernel(psPtr ptr) 91 { 92 return ( psMemGetDeallocator(ptr) == (psFreeFunc)freeKernel ); 93 } 94 88 95 89 96 psKernel* psKernelGenerate(const psVector* tShifts, -
trunk/psLib/src/imageops/psImageConvolve.h
r4815 r4898 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.1 0$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-08- 18 21:44:40$9 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-08-30 01:14:13 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 77 77 ); 78 78 79 /** Checks the type of a particular pointer. 80 * 81 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 82 * 83 * @return bool: True if the pointer matches a psKernel structure, false otherwise. 84 */ 85 bool psMemCheckKernel( 86 psPtr ptr ///< the pointer whose type to check 87 ); 88 89 79 90 /** Generates a kernel given a list of shift values 80 91 * -
trunk/psLib/src/math/psFunctions.c
r4876 r4898 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-08- 25 22:52:29$9 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-08-30 01:14:13 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 871 871 return(newPoly); 872 872 } 873 874 875 bool psMemCheckPolynomial1D(psPtr ptr) 876 { 877 return ( psMemGetDeallocator(ptr) == (psFreeFunc)polynomial1DFree ); 878 } 879 880 bool psMemCheckPolynomial2D(psPtr ptr) 881 { 882 return ( psMemGetDeallocator(ptr) == (psFreeFunc)polynomial2DFree ); 883 } 884 885 bool psMemCheckPolynomial3D(psPtr ptr) 886 { 887 return ( psMemGetDeallocator(ptr) == (psFreeFunc)polynomial3DFree ); 888 } 889 890 bool psMemCheckPolynomial4D(psPtr ptr) 891 { 892 return ( psMemGetDeallocator(ptr) == (psFreeFunc)polynomial4DFree ); 893 } 894 895 bool psMemCheckSpline1D(psPtr ptr) 896 { 897 return ( psMemGetDeallocator(ptr) == (psFreeFunc)spline1DFree ); 898 } 899 873 900 874 901 psF64 psPolynomial1DEval(const psPolynomial1D* poly, psF64 x) -
trunk/psLib/src/math/psFunctions.h
r4581 r4898 12 12 * @author GLG, MHPCC 13 13 * 14 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-0 7-20 01:21:13 $14 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-08-30 01:14:13 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 163 163 ); 164 164 165 /** Checks the type of a particular pointer. 166 * 167 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 168 * 169 * @return bool: True if the pointer matches a psPolynomial1D structure, false otherwise. 170 */ 171 bool psMemCheckPolynomial1D( 172 psPtr ptr ///< the pointer whose type to check 173 ); 174 175 /** Checks the type of a particular pointer. 176 * 177 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 178 * 179 * @return bool: True if the pointer matches a psPolynomial2D structure, false otherwise. 180 */ 181 bool psMemCheckPolynomial2D( 182 psPtr ptr ///< the pointer whose type to check 183 ); 184 185 /** Checks the type of a particular pointer. 186 * 187 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 188 * 189 * @return bool: True if the pointer matches a psPolynomial3D structure, false otherwise. 190 */ 191 bool psMemCheckPolynomial3D( 192 psPtr ptr ///< the pointer whose type to check 193 ); 194 195 /** Checks the type of a particular pointer. 196 * 197 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 198 * 199 * @return bool: True if the pointer matches a psPolynomial4D structure, false otherwise. 200 */ 201 bool psMemCheckPolynomial4D( 202 psPtr ptr ///< the pointer whose type to check 203 ); 204 205 /** Checks the type of a particular pointer. 206 * 207 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 208 * 209 * @return bool: True if the pointer matches a psSpline1D structure, false otherwise. 210 */ 211 bool psMemCheckSpline1D( 212 psPtr ptr ///< the pointer whose type to check 213 ); 214 215 216 165 217 /** Evaluates a 1-D polynomial at specific coordinates. 166 218 * -
trunk/psLib/src/math/psMinimize.c
r4858 r4898 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.13 1$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-08- 24 01:04:37$11 * @version $Revision: 1.132 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-08-30 01:14:13 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 1372 1372 } 1373 1373 1374 1374 static void minimizationFree(psMinimization *min) 1375 { 1376 // There are non dynamic allocated items 1377 } 1375 1378 1376 1379 /****************************************************************************** … … 1382 1385 1383 1386 psMinimization *min = psAlloc(sizeof(psMinimization)); 1387 psMemSetDeallocator(min, (psFreeFunc)minimizationFree); 1384 1388 *(int*)&min->maxIter = maxIter; 1385 1389 *(float*)&min->tol = tol; … … 1390 1394 return(min); 1391 1395 } 1396 1397 bool psMemCheckMinimization(psPtr ptr) 1398 { 1399 return ( psMemGetDeallocator(ptr) == (psFreeFunc)minimizationFree ); 1400 } 1401 1392 1402 1393 1403 // This macro takes as input the vector BASE and adds a multiple of the vector -
trunk/psLib/src/math/psMinimize.h
r4760 r4898 8 8 * @author GLG, MHPCC 9 9 * 10 * @version $Revision: 1.5 2$ $Name: not supported by cvs2svn $11 * @date $Date: 2005-08- 11 23:04:32$10 * @version $Revision: 1.53 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-08-30 01:14:13 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 60 60 ); 61 61 62 /** Checks the type of a particular pointer. 63 * 64 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 65 * 66 * @return bool: True if the pointer matches a psMinimization structure, false otherwise. 67 */ 68 bool psMemCheckMinimization( 69 psPtr ptr ///< the pointer whose type to check 70 ); 71 72 62 73 /** Derive a polynomial fit. 63 74 * -
trunk/psLib/src/math/psStats.c
r4620 r4898 14 14 * stats->binsize 15 15 * 16 * @version $Revision: 1.13 8$ $Name: not supported by cvs2svn $17 * @date $Date: 2005-0 7-27 19:55:16$16 * @version $Revision: 1.139 $ $Name: not supported by cvs2svn $ 17 * @date $Date: 2005-08-30 01:14:13 $ 18 18 * 19 19 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 1753 1753 static void histogramFree(psHistogram* myHist); 1754 1754 1755 static void statsFree(psStats *newStruct) 1756 { 1757 // There are non dynamic allocated items 1758 } 1759 1755 1760 /****************************************************************************** 1756 1761 psStatsAlloc(): This routine must create a new psStats data structure. … … 1761 1766 1762 1767 newStruct = (psStats* ) psAlloc(sizeof(psStats)); 1768 psMemSetDeallocator(newStruct, (psFreeFunc)statsFree); 1763 1769 newStruct->sampleMean = NAN; 1764 1770 newStruct->sampleMedian = NAN; … … 1787 1793 } 1788 1794 1795 1796 bool psMemCheckStats(psPtr ptr) 1797 { 1798 return ( psMemGetDeallocator(ptr) == (psFreeFunc)statsFree ); 1799 } 1800 1801 1802 1789 1803 /****************************************************************************** 1790 1804 psHistogramAlloc(lower, upper, n): allocate a uniform histogram structure … … 1885 1899 psFree(myHist->nums); 1886 1900 } 1901 1902 1903 bool psMemCheckHistogram(psPtr ptr) 1904 { 1905 return ( psMemGetDeallocator(ptr) == (psFreeFunc)histogramFree ); 1906 } 1907 1908 1887 1909 1888 1910 /***************************************************************************** -
trunk/psLib/src/math/psStats.h
r4857 r4898 14 14 * @author GLG, MHPCC 15 15 * 16 * @version $Revision: 1.4 7$ $Name: not supported by cvs2svn $17 * @date $Date: 2005-08- 23 23:23:05$16 * @version $Revision: 1.48 $ $Name: not supported by cvs2svn $ 17 * @date $Date: 2005-08-30 01:14:13 $ 18 18 * 19 19 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 105 105 ); 106 106 107 108 /** Checks the type of a particular pointer. 109 * 110 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 111 * 112 * @return bool: True if the pointer matches a psStats structure, false otherwise. 113 */ 114 bool psMemCheckStats( 115 psPtr ptr ///< the pointer whose type to check 116 ); 117 118 107 119 /****************************************************************************** 108 120 Histogram functions and data structures. … … 140 152 ); 141 153 154 155 /** Checks the type of a particular pointer. 156 * 157 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 158 * 159 * @return bool: True if the pointer matches a psHistogram structure, false otherwise. 160 */ 161 bool psMemCheckHistogram( 162 psPtr ptr ///< the pointer whose type to check 163 ); 164 165 142 166 /** Allocator for psHistogram where the bounds of the bins are explicitly 143 167 * specified. -
trunk/psLib/src/mathtypes/psImage.c
r4887 r4898 9 9 * @author Ross Harman, MHPCC 10 10 * 11 * @version $Revision: 1.7 7$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-08- 26 23:01:17$11 * @version $Revision: 1.78 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-08-30 01:14:13 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 90 90 return image; 91 91 } 92 93 94 bool psMemCheckImage(psPtr ptr) 95 { 96 return ( psMemGetDeallocator(ptr) == (psFreeFunc)imageFree ); 97 } 98 92 99 93 100 psRegion psRegionSet(float x0, -
trunk/psLib/src/mathtypes/psImage.h
r4886 r4898 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.6 3$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-08- 26 03:35:02$13 * @version $Revision: 1.64 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-08-30 01:14:13 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 111 111 ; 112 112 113 114 /** Checks the type of a particular pointer. 115 * 116 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 117 * 118 * @return bool: True if the pointer matches a psImage structure, false otherwise. 119 */ 120 bool psMemCheckImage( 121 psPtr ptr ///< the pointer whose type to check 122 ); 123 124 113 125 /** Create a psRegion with the specified attributes. 114 126 * -
trunk/psLib/src/mathtypes/psScalar.c
r4540 r4898 8 8 * @author Ross Harman, MHPCC 9 9 * 10 * @version $Revision: 1.1 7$ $Name: not supported by cvs2svn $11 * @date $Date: 2005-0 7-12 19:12:01$10 * @version $Revision: 1.18 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-08-30 01:14:13 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 22 22 #include "psErrorText.h" 23 23 24 static void scalarFree(psScalar *scalar) 25 { 26 // There are non dynamic allocated items 27 } 28 24 29 psScalar* psScalarAlloc(complex value, psElemType type) 25 30 { … … 28 33 // Create scalar 29 34 scalar = (psScalar* ) psAlloc(sizeof(psScalar)); 30 35 psMemSetDeallocator(scalar, (psFreeFunc)scalarFree); 31 36 scalar->type.dimen = PS_DIMEN_SCALAR; 32 37 scalar->type.type = type; … … 79 84 return scalar; 80 85 } 86 87 88 bool psMemCheckScalar(psPtr ptr) 89 { 90 return ( psMemGetDeallocator(ptr) == (psFreeFunc)scalarFree ); 91 } 92 81 93 82 94 psScalar* psScalarCopy(const psScalar *value) -
trunk/psLib/src/mathtypes/psScalar.h
r4540 r4898 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.1 5$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-0 7-12 19:12:01$13 * @version $Revision: 1.16 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-08-30 01:14:13 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 70 70 ); 71 71 72 73 /** Checks the type of a particular pointer. 74 * 75 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 76 * 77 * @return bool: True if the pointer matches a psScalar structure, false otherwise. 78 */ 79 bool psMemCheckScalar( 80 psPtr ptr ///< the pointer whose type to check 81 ); 82 83 72 84 /** Copy a scalar. 73 85 * -
trunk/psLib/src/mathtypes/psVector.c
r4887 r4898 9 9 * @author Robert DeSonia, MHPCC 10 10 * 11 * @version $Revision: 1. 49$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-08- 26 23:01:17$11 * @version $Revision: 1.50 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-08-30 01:14:13 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 60 60 61 61 // FUNCTION IMPLEMENTATION - PUBLIC 62 bool psMemCheckVector(psPtr ptr) 63 { 64 return ( psMemGetDeallocator(ptr) == (psFreeFunc)vectorFree ); 65 } 66 62 67 63 68 psVector* psVectorAlloc(long nalloc, -
trunk/psLib/src/mathtypes/psVector.h
r4887 r4898 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.4 1$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-08- 26 23:01:17$13 * @version $Revision: 1.42 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-08-30 01:14:13 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 61 61 /*****************************************************************************/ 62 62 63 /** Checks the type of a particular pointer. 64 * 65 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 66 * 67 * @return bool: True if the pointer matches a psVector structure, false otherwise. 68 */ 69 bool psMemCheckVector( 70 psPtr ptr ///< the pointer whose type to check 71 ) 72 ; 63 73 64 74 /** Allocate a vector. … … 72 82 long nalloc, ///< Total number of elements to make available. 73 83 psElemType type ///< Type of data to be held by vector. 74 ) 75 ; 84 ); 76 85 77 86 /** Reallocate a vector. -
trunk/psLib/src/sys/psMemory.c
r4877 r4898 8 8 * @author Robert Lupton, Princeton University 9 9 * 10 * @version $Revision: 1.6 1$ $Name: not supported by cvs2svn $11 * @date $Date: 2005-08- 25 23:42:07$10 * @version $Revision: 1.62 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-08-30 01:14:13 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 24 24 #include "psAbort.h" 25 25 #include "psLogMsg.h" 26 27 #include "psBitSet.h" 28 //#include "psArray.h" 29 //#include "psImage.h" 30 //#include "psList.h" 31 //#include "psLookupTable.h" 32 //#include "psHash.h" 33 34 //#include "psMetadata.h" 35 #include "psFits.h" 36 #include "psPixels.h" 37 //#include "psScalar.h" 38 //#include "psVector.h" 39 //#include "psFunctions.h" 40 //#include "psTime.h" 41 //#include "psCoord.h" 42 #include "psSphereOps.h" 43 //#include "psStats.h" 44 #include "psMinimize.h" 45 #include "psImageConvolve.h" 46 #include "psTime.h" 26 47 27 48 #include "psErrorText.h" … … 688 709 } 689 710 711 712 bool psMemCheckType(psDataType type, 713 psPtr ptr) 714 { 715 switch(type) { 716 case PS_DATA_ARRAY: 717 if ( psMemCheckArray(ptr) ) 718 return true; 719 else { 720 psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer. Datatypes do not match.\n"); 721 break; 722 } 723 case PS_DATA_BITSET: 724 if ( psMemCheckBitSet(ptr) ) 725 return true; 726 else { 727 psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer. Datatypes do not match.\n"); 728 break; 729 } 730 /* case PS_DATA_CELL: 731 if ( psMemCheckCell(ptr) ) 732 return true; 733 else 734 { 735 psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer. Datatypes do not match.\n"); 736 break; 737 } 738 case PS_DATA_CHIP: 739 if ( psMemCheckChip(ptr) ) 740 return true; 741 else 742 { 743 psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer. Datatypes do not match.\n"); 744 break; 745 } 746 */ 747 case PS_DATA_CUBE: 748 if ( psMemCheckCube(ptr) ) 749 return true; 750 else { 751 psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer. Datatypes do not match.\n"); 752 break; 753 } 754 755 756 case PS_DATA_FITS: 757 if ( psMemCheckFits(ptr) ) 758 return true; 759 else { 760 psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer. Datatypes do not match.\n"); 761 break; 762 } 763 764 case PS_DATA_HASH: 765 if ( psMemCheckHash(ptr) ) 766 return true; 767 else { 768 psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer. Datatypes do not match.\n"); 769 break; 770 } 771 case PS_DATA_HISTOGRAM: 772 if ( psMemCheckHistogram(ptr) ) 773 return true; 774 else { 775 psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer. Datatypes do not match.\n"); 776 break; 777 } 778 case PS_DATA_IMAGE: 779 if ( psMemCheckImage(ptr) ) 780 return true; 781 else { 782 psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer. Datatypes do not match.\n"); 783 break; 784 } 785 case PS_DATA_KERNEL: 786 if ( psMemCheckKernel(ptr) ) 787 return true; 788 else { 789 psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer. Datatypes do not match.\n"); 790 break; 791 } 792 case PS_DATA_LIST: 793 if ( psMemCheckList(ptr) ) 794 return true; 795 else { 796 psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer. Datatypes do not match.\n"); 797 break; 798 } 799 case PS_DATA_LOOKUPTABLE: 800 if ( psMemCheckLookupTable(ptr) ) 801 return true; 802 else { 803 psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer. Datatypes do not match.\n"); 804 break; 805 } 806 case PS_DATA_METADATA: 807 if ( psMemCheckMetadata(ptr) ) 808 return true; 809 else { 810 psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer. Datatypes do not match.\n"); 811 break; 812 } 813 case PS_DATA_METADATAITEM: 814 if ( psMemCheckMetadataItem(ptr) ) 815 return true; 816 else { 817 psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer. Datatypes do not match.\n"); 818 break; 819 } 820 case PS_DATA_MINIMIZATION: 821 if ( psMemCheckMinimization(ptr) ) 822 return true; 823 else { 824 psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer. Datatypes do not match.\n"); 825 break; 826 } 827 case PS_DATA_PIXELS: 828 if ( psMemCheckPixels(ptr) ) 829 return true; 830 else { 831 psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer. Datatypes do not match.\n"); 832 break; 833 } 834 case PS_DATA_PLANE: 835 if ( psMemCheckPlane(ptr) ) 836 return true; 837 else { 838 psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer. Datatypes do not match.\n"); 839 break; 840 } 841 case PS_DATA_PLANEDISTORT: 842 if ( psMemCheckPlaneDistort(ptr) ) 843 return true; 844 else { 845 psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer. Datatypes do not match.\n"); 846 break; 847 } 848 case PS_DATA_PLANETRANSFORM: 849 if ( psMemCheckPlaneTransform(ptr) ) 850 return true; 851 else { 852 psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer. Datatypes do not match.\n"); 853 break; 854 } 855 case PS_DATA_POLYNOMIAL1D: 856 if ( psMemCheckPolynomial1D(ptr) ) 857 return true; 858 else { 859 psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer. Datatypes do not match.\n"); 860 break; 861 } 862 case PS_DATA_POLYNOMIAL2D: 863 if ( psMemCheckPolynomial2D(ptr) ) 864 return true; 865 else { 866 psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer. Datatypes do not match.\n"); 867 break; 868 } 869 case PS_DATA_POLYNOMIAL3D: 870 if ( psMemCheckPolynomial3D(ptr) ) 871 return true; 872 else { 873 psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer. Datatypes do not match.\n"); 874 break; 875 } 876 case PS_DATA_POLYNOMIAL4D: 877 if ( psMemCheckPolynomial4D(ptr) ) 878 return true; 879 else { 880 psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer. Datatypes do not match.\n"); 881 break; 882 } 883 case PS_DATA_PROJECTION: 884 if ( psMemCheckProjection(ptr) ) 885 return true; 886 else { 887 psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer. Datatypes do not match.\n"); 888 break; 889 } 890 891 /* case PS_DATA_READOUT: 892 if ( psMemCheckReadout(ptr) ) 893 return true; 894 else 895 { 896 psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer. Datatypes do not match.\n"); 897 break; 898 } 899 900 *//* case PS_DATA_REGION: 901 if ( psMemCheckRegion(ptr) ) 902 return true; 903 else 904 { 905 psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer. Datatypes do not match.\n"); 906 break; 907 } 908 */ 909 case PS_DATA_SCALAR: 910 if ( psMemCheckScalar(ptr) ) 911 return true; 912 else { 913 psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer. Datatypes do not match.\n"); 914 break; 915 } 916 case PS_DATA_SPHERE: 917 if ( psMemCheckSphere(ptr) ) 918 return true; 919 else { 920 psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer. Datatypes do not match.\n"); 921 break; 922 } 923 case PS_DATA_SPHEREROT: 924 if ( psMemCheckSphereRot(ptr) ) 925 return true; 926 else { 927 psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer. Datatypes do not match.\n"); 928 break; 929 } 930 case PS_DATA_SPLINE1D: 931 if ( psMemCheckSpline1D(ptr) ) 932 return true; 933 else { 934 psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer. Datatypes do not match.\n"); 935 break; 936 } 937 case PS_DATA_STATS: 938 if ( psMemCheckStats(ptr) ) 939 return true; 940 else { 941 psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer. Datatypes do not match.\n"); 942 break; 943 } 944 case PS_DATA_TIME: 945 if ( psMemCheckTime(ptr) ) 946 return true; 947 else { 948 psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer. Datatypes do not match.\n"); 949 break; 950 } 951 case PS_DATA_VECTOR: 952 if ( psMemCheckVector(ptr) ) 953 return true; 954 else { 955 psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer. Datatypes do not match.\n"); 956 break; 957 } 958 default: 959 psError(PS_ERR_BAD_PARAMETER_TYPE, true, "Invalid datatype specified.\n"); 960 } 961 return false; 962 } 963 964 690 965 bool p_psMemGetPersistent(psPtr vptr) 691 966 { -
trunk/psLib/src/sys/psMemory.h
r4590 r4898 12 12 * @ingroup MemoryManagement 13 13 * 14 * @version $Revision: 1.4 8$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-0 7-21 02:39:57$14 * @version $Revision: 1.49 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-08-30 01:14:13 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 172 172 ); 173 173 174 /** Checks the deallocator to see if the pointer matches the desired datatype. 175 * 176 * @return bool: True if type matches, otherwise false. 177 */ 178 bool psMemCheckType( 179 psDataType type, ///< The desired psDataType to match 180 psPtr ptr ///< The desired pointer to match 181 ); 182 183 174 184 /** Set the memory as persistent so that it is ignored when detecting memory leaks. 175 185 * -
trunk/psLib/src/types/psArray.c
r4600 r4898 9 9 * @author Ross Harman, MHPCC 10 10 * 11 * @version $Revision: 1.3 6$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-0 7-22 23:47:13 $11 * @version $Revision: 1.37 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-08-30 01:14:13 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 45 45 psFree(psArr->data); 46 46 } 47 48 bool psMemCheckArray(psPtr ptr) 49 { 50 return ( psMemGetDeallocator(ptr) == (psFreeFunc)arrayFree ); 51 } 52 47 53 48 54 /***************************************************************************** -
trunk/psLib/src/types/psArray.h
r4600 r4898 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1.3 0$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-0 7-22 23:47:13 $14 * @version $Revision: 1.31 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-08-30 01:14:13 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 47 47 /*****************************************************************************/ 48 48 49 /** Checks the type of a particular pointer. 50 * 51 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 52 * 53 * @return bool: True if the pointer matches a psArray structure, false otherwise. 54 */ 55 bool psMemCheckArray( 56 psPtr ptr ///< the pointer whose type to check 57 ) 58 ; 59 60 49 61 /** Allocate an array. 50 62 * … … 57 69 psArray* psArrayAlloc( 58 70 long nalloc ///< Total number of elements to make available. 59 ) 60 ; 71 ); 61 72 62 73 /** Reallocate an array. -
trunk/psLib/src/types/psBitSet.c
r4819 r4898 11 11 * @author Robert DeSonia, MHPCC 12 12 * 13 * @version $Revision: 1.3 0$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-08- 19 00:31:42$13 * @version $Revision: 1.31 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-08-30 01:14:13 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 65 65 psFree(inBitSet->bits); 66 66 } 67 68 bool psMemCheckBitSet(psPtr ptr) 69 { 70 return ( psMemGetDeallocator(ptr) == (psFreeFunc)bitSetFree ); 71 } 72 67 73 68 74 psBitSet* psBitSetAlloc(long nalloc) -
trunk/psLib/src/types/psBitSet.h
r4610 r4898 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1.2 2$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-0 7-26 00:44:45$14 * @version $Revision: 1.23 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-08-30 01:14:13 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 47 47 /*****************************************************************************/ 48 48 49 /** Checks the type of a particular pointer. 50 * 51 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 52 * 53 * @return bool: True if the pointer matches a psBitSet structure, false otherwise. 54 */ 55 bool psMemCheckBitSet( 56 psPtr ptr ///< the pointer whose type to check 57 ) 58 ; 59 60 49 61 /** Allocate a psBitSet. 50 62 * … … 56 68 psBitSet* psBitSetAlloc( 57 69 long nalloc ///< Number of bits in psBitSet array 58 ) 59 ; 70 ); 60 71 61 72 /** Set a bit. -
trunk/psLib/src/types/psHash.c
r4556 r4898 12 12 * @author GLG, MHPCC 13 13 * 14 * @version $Revision: 1.2 3$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-0 7-15 02:33:54$14 * @version $Revision: 1.24 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-08-30 01:14:13 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 160 160 } 161 161 162 bool psMemCheckHash(psPtr ptr) 163 { 164 return ( psMemGetDeallocator(ptr) == (psFreeFunc)hashFree ); 165 } 166 167 162 168 /****************************************************************************** 163 169 hashFree(table): This procedure deallocates the specified hash -
trunk/psLib/src/types/psHash.h
r4556 r4898 11 11 * @author GLG, MHPCC 12 12 * 13 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-0 7-15 02:33:54$13 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-08-30 01:14:13 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 46 46 psHash; 47 47 48 /** Checks the type of a particular pointer. 49 * 50 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 51 * 52 * @return bool: True if the pointer matches a psHash structure, false otherwise. 53 */ 54 bool psMemCheckHash( 55 psPtr ptr ///< the pointer whose type to check 56 ) 57 ; 58 59 48 60 /// Allocate hash buckets in table. 49 61 psHash* psHashAlloc( 50 62 long nalloc ///< The number of buckets to allocate. 51 ) 52 ; 63 ); 53 64 54 65 /// Insert entry into table. -
trunk/psLib/src/types/psList.c
r4556 r4898 6 6 * @author Robert Daniel DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.4 1$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-0 7-15 02:33:54$8 * @version $Revision: 1.42 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-08-30 01:14:13 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 148 148 return list; 149 149 } 150 151 bool psMemCheckList(psPtr ptr) 152 { 153 return ( psMemGetDeallocator(ptr) == (psFreeFunc)listFree ); 154 } 155 156 150 157 151 158 psListIterator* psListIteratorAlloc(psList* list, long location, bool mutable) -
trunk/psLib/src/types/psList.h
r4590 r4898 7 7 * @ingroup LinkedList 8 8 * 9 * @version $Revision: 1.3 0$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-0 7-21 02:39:57$9 * @version $Revision: 1.31 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-08-30 01:14:13 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 84 84 85 85 86 /** Creates a psList linked list object. 87 * 88 * @return psList* A new psList object. 89 */ 90 psList* psListAlloc( 91 psPtr data 92 ///< initial data item; may be NULL if no an empty psList is desired 86 /** Checks the type of a particular pointer. 87 * 88 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 89 * 90 * @return bool: True if the pointer matches a psList structure, false otherwise. 91 */ 92 bool psMemCheckList( 93 psPtr ptr ///< the pointer whose type to check 93 94 ) 94 95 ; 96 97 98 /** Creates a psList linked list object. 99 * 100 * @return psList* A new psList object. 101 */ 102 psList* psListAlloc( 103 psPtr data ///< initial data item; may be NULL if an empty psList is desired 104 ); 95 105 96 106 /** Creates a psListIterator object and associates it with a psList. -
trunk/psLib/src/types/psLookupTable.c
r4589 r4898 7 7 * @author Ross Harman, MHPCC 8 8 * 9 * @version $Revision: 1.2 4$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-0 7-21 01:40:10$9 * @version $Revision: 1.25 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-08-30 01:14:13 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii … … 263 263 /* FUNCTION IMPLEMENTATION - PUBLIC */ 264 264 /*****************************************************************************/ 265 266 bool psMemCheckLookupTable(psPtr ptr) 267 { 268 return ( psMemGetDeallocator(ptr) == (psFreeFunc)lookupTableFree ); 269 } 270 265 271 266 272 psLookupTable* psLookupTableAlloc(const char *filename, -
trunk/psLib/src/types/psLookupTable.h
r4589 r4898 7 7 * @author Ross Harman, MHPCC 8 8 * 9 * @version $Revision: 1.1 1$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-0 7-21 01:40:10$9 * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-08-30 01:14:13 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 60 60 PS_PARSE_ERROR_GENERAL = 0x0104 ///< Any other type of lookup error 61 61 }psParseErrorType; 62 63 /** Checks the type of a particular pointer. 64 * 65 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 66 * 67 * @return bool: True if the pointer matches a psLookupTable structure, false otherwise. 68 */ 69 bool psMemCheckLookupTable( 70 psPtr ptr ///< the pointer whose type to check 71 ); 72 62 73 63 74 /** Allocator for psLookupTable struct -
trunk/psLib/src/types/psMetadata.c
r4891 r4898 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1.7 8$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-08- 27 01:33:41$14 * @version $Revision: 1.79 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-08-30 01:14:13 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 162 162 return metadataItem; 163 163 } 164 165 bool psMemCheckMetadataItem(psPtr ptr) 166 { 167 return ( psMemGetDeallocator(ptr) == (psFreeFunc)metadataItemFree ); 168 } 169 164 170 165 171 #define METADATAITEM_ALLOC_TYPE(NAME,TYPE,METATYPE) \ … … 273 279 return metadata; 274 280 } 281 282 283 bool psMemCheckMetadata(psPtr ptr) 284 { 285 return ( psMemGetDeallocator(ptr) == (psFreeFunc)metadataFree ); 286 } 287 288 275 289 276 290 bool psMetadataAddItem(psMetadata *md, -
trunk/psLib/src/types/psMetadata.h
r4891 r4898 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1. 59$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-08- 27 01:33:41$13 * @version $Revision: 1.60 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-08-30 01:14:13 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 155 155 ; 156 156 157 158 /** Checks the type of a particular pointer. 159 * 160 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 161 * 162 * @return bool: True if the pointer matches a psMetadataItem structure, false otherwise. 163 */ 164 bool psMemCheckMetadataItem( 165 psPtr ptr ///< the pointer whose type to check 166 ); 167 168 157 169 /** Create a metadata item with specified string data. 158 170 * … … 253 265 psMetadata* psMetadataAlloc(void); 254 266 267 268 /** Checks the type of a particular pointer. 269 * 270 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 271 * 272 * @return bool: True if the pointer matches a psMetadata structure, false otherwise. 273 */ 274 bool psMemCheckMetadata( 275 psPtr ptr ///< the pointer whose type to check 276 ); 277 278 255 279 /** Add existing metadata item to metadata collection. 256 280 * -
trunk/psLib/src/types/psPixels.c
r4597 r4898 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.1 5$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-0 7-22 22:19:27$9 * @version $Revision: 1.16 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-08-30 01:14:13 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 71 71 return out; 72 72 } 73 74 75 bool psMemCheckPixels(psPtr ptr) 76 { 77 return ( psMemGetDeallocator(ptr) == (psFreeFunc)pixelsFree ); 78 } 79 73 80 74 81 psPixels* psPixelsRealloc(psPixels* pixels, long nalloc) -
trunk/psLib/src/types/psPixels.h
r4608 r4898 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.1 1$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-0 7-25 20:49:04$9 * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-08-30 01:14:13 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 57 57 ) 58 58 ; 59 60 /** Checks the type of a particular pointer. 61 * 62 * Uses the appropriate deallocation function in psMemBlock to check the ptr datatype. 63 * 64 * @return bool: True if the pointer matches a psPixels structure, false otherwise. 65 */ 66 bool psMemCheckPixels( 67 psPtr ptr ///< the pointer whose type to check 68 ); 69 59 70 60 71 /** resizes a psPixels structure -
trunk/psLib/test/sys/tst_psMemory.c
r4877 r4898 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-08- 25 23:42:07$8 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-08-30 01:14:13 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 35 35 static psS32 TPmemCorruption( void ); 36 36 static psS32 TPmultipleFree( void ); 37 static psS32 memCheckTypes( void ); 37 38 void memProblemCallback( psMemBlock *ptr, const char *filename, unsigned int lineno ); 38 39 … … 53 54 {TPFreeReferencedMemory, 456, "freeReferencedMemory", 0, false}, 54 55 {TPmultipleFree, 699, "multipleFree", -6, false}, 56 {memCheckTypes, 700, "psMemCheckType", 0, false}, 55 57 {NULL} 56 58 }; … … 534 536 return 0; 535 537 } 538 539 static psS32 memCheckTypes( void ) 540 { 541 // psArray *negative; 542 // negative = psArrayAlloc(2); 543 // psMetadata *neg; 544 // neg = psMetadataAlloc(); 545 546 psArray *array; 547 array = psArrayAlloc(100); 548 if ( !psMemCheckType(PS_DATA_ARRAY, array) ) { 549 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckArray failed in memCheckType. \n"); 550 psFree(array); 551 return 1; 552 } 553 // if ( psMemCheckType(PS_DATA_ARRAY, neg) ) 554 // { 555 // psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckArray failed in memCheckType. \n"); 556 // return 1; 557 // } 558 psFree(array); 559 560 psBitSet *bits; 561 bits = psBitSetAlloc(100); 562 if ( !psMemCheckType(PS_DATA_BITSET, bits) ) { 563 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckBitSet failed in memCheckType. \n"); 564 psFree(bits); 565 return 1; 566 } 567 // if ( psMemCheckType(PS_DATA_BITSET, negative) ) 568 // { 569 // psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckBitSet failed in memCheckType. \n"); 570 // return 1; 571 // } 572 psFree(bits); 573 574 psCube *cube; 575 cube = psCubeAlloc(); 576 if ( !psMemCheckType(PS_DATA_CUBE, cube) ) { 577 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckCube failed in memCheckType. \n"); 578 psFree(cube); 579 return 1; 580 } 581 psFree(cube); 582 583 /* 584 psFits *fits; 585 char *filename = ""; 586 fits = psFitsAlloc(filename); 587 if ( !psMemCheckType(PS_DATA_FITS, fits) ) 588 { 589 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckFits failed in memCheckType. \n"); 590 psFree(fits); 591 return 1; 592 } 593 psFree(fits); 594 */ 595 psHash *hash; 596 hash = psHashAlloc(100); 597 if ( !psMemCheckType(PS_DATA_HASH, hash) ) { 598 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckHash failed in memCheckType. \n"); 599 psFree(hash); 600 return 1; 601 } 602 psFree(hash); 603 604 psHistogram *histogram; 605 histogram = psHistogramAlloc(1.1, 2.2, 2); 606 if ( !psMemCheckType(PS_DATA_HISTOGRAM, histogram) ) { 607 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckHistogram failed in memCheckType. \n"); 608 psFree(histogram); 609 return 1; 610 } 611 psFree(histogram); 612 613 psImage *image; 614 image = psImageAlloc(5, 5, PS_TYPE_F32); 615 if ( !psMemCheckType(PS_DATA_IMAGE, image) ) { 616 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckImage failed in memCheckType. \n"); 617 psFree(image); 618 return 1; 619 } 620 psFree(image); 621 622 psKernel *kernel; 623 kernel = psKernelAlloc(0, 1, 0, 1); 624 if ( !psMemCheckType(PS_DATA_KERNEL, kernel) ) { 625 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckKernel failed in memCheckType. \n"); 626 psFree(kernel); 627 return 1; 628 } 629 psFree(kernel); 630 631 psList *list; 632 list = psListAlloc(NULL); 633 if ( !psMemCheckType(PS_DATA_LIST, list) ) { 634 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckList failed in memCheckType. \n"); 635 psFree(list); 636 return 1; 637 } 638 psFree(list); 639 640 /* 641 psLookupTable *lookup; 642 char *filename = ""; 643 char *format = "%d"; 644 lookup = psLookupTableAlloc(filename, format, 0); 645 if ( !psMemCheckType(PS_DATA_LOOKUPTABLE, lookup) ) 646 { 647 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckLookupTable failed in memCheckType. \n"); 648 psFree(lookup); 649 return 1; 650 } 651 psFree(lookup); 652 */ 653 psMetadata *metadata; 654 metadata = psMetadataAlloc(); 655 if ( !psMemCheckType(PS_DATA_METADATA, metadata) ) { 656 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckMetadata failed in memCheckType. \n"); 657 psFree(metadata); 658 return 1; 659 } 660 psFree(metadata); 661 662 psMetadataItem *metaItem; 663 metaItem = psMetadataItemAlloc("name", PS_DATA_S32, "COMMENT", 1); 664 if ( !psMemCheckType(PS_DATA_METADATAITEM, metaItem) ) { 665 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckMetadataItem failed in memCheckType. \n"); 666 psFree(metaItem); 667 return 1; 668 } 669 psFree(metaItem); 670 671 psMinimization *min; 672 min = psMinimizationAlloc(3, 0.1); 673 if ( !psMemCheckType(PS_DATA_MINIMIZATION, min) ) { 674 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckMinimization failed in memCheckType. \n"); 675 psFree(min); 676 return 1; 677 } 678 psFree(min); 679 680 psPixels *pixels; 681 pixels = psPixelsAlloc(100); 682 if ( !psMemCheckType(PS_DATA_PIXELS, pixels) ) { 683 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckPixels failed in memCheckType. \n"); 684 psFree(pixels); 685 return 1; 686 } 687 psFree(pixels); 688 689 psPlane *plane; 690 plane = psPlaneAlloc(); 691 if ( !psMemCheckType(PS_DATA_PLANE, plane) ) { 692 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckPlane failed in memCheckType. \n"); 693 psFree(plane); 694 return 1; 695 } 696 psFree(plane); 697 698 psPlaneDistort *planeDistort; 699 planeDistort = psPlaneDistortAlloc(1, 1, 1, 1); 700 if ( !psMemCheckType(PS_DATA_PLANEDISTORT, planeDistort) ) { 701 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckPlaneDistort failed in memCheckType. \n"); 702 psFree(planeDistort); 703 return 1; 704 } 705 psFree(planeDistort); 706 707 psPlaneTransform *planeTransform; 708 planeTransform = psPlaneTransformAlloc(1, 1); 709 if ( !psMemCheckType(PS_DATA_PLANETRANSFORM, planeTransform) ) { 710 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckPlaneTransform failed in memCheckType. \n"); 711 psFree(planeTransform); 712 return 1; 713 } 714 psFree(planeTransform); 715 716 psPolynomial1D *poly1; 717 poly1 = psPolynomial1DAlloc(2, PS_POLYNOMIAL_ORD); 718 if ( !psMemCheckType(PS_DATA_POLYNOMIAL1D, poly1) ) { 719 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckPolynomial1D failed in memCheckType. \n"); 720 psFree(poly1); 721 return 1; 722 } 723 psFree(poly1); 724 725 psPolynomial2D *poly2; 726 poly2 = psPolynomial2DAlloc(2, 1, PS_POLYNOMIAL_ORD); 727 if ( !psMemCheckType(PS_DATA_POLYNOMIAL2D, poly2) ) { 728 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckPolynomial2D failed in memCheckType. \n"); 729 psFree(poly2); 730 return 1; 731 } 732 psFree(poly2); 733 734 psPolynomial3D *poly3; 735 poly3 = psPolynomial3DAlloc(2, 1, 2, PS_POLYNOMIAL_ORD); 736 if ( !psMemCheckType(PS_DATA_POLYNOMIAL3D, poly3) ) { 737 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckPolynomial3D failed in memCheckType. \n"); 738 psFree(poly3); 739 return 1; 740 } 741 psFree(poly3); 742 743 psPolynomial4D *poly4; 744 poly4 = psPolynomial4DAlloc(2, 1, 2, 1, PS_POLYNOMIAL_ORD); 745 if ( !psMemCheckType(PS_DATA_POLYNOMIAL4D, poly4) ) { 746 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckPolynomial4D failed in memCheckType. \n"); 747 psFree(poly4); 748 return 1; 749 } 750 psFree(poly4); 751 752 psProjection *proj; 753 proj = psProjectionAlloc(1, 1, 2.1, 2.1, PS_PROJ_TAN); 754 if ( !psMemCheckType(PS_DATA_PROJECTION, proj) ) { 755 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckProjection failed in memCheckType. \n"); 756 psFree(proj); 757 return 1; 758 } 759 psFree(proj); 760 761 psScalar *scalar; 762 psC64 c64 = 1.1 + 7I; 763 scalar = psScalarAlloc(c64, PS_TYPE_F64); 764 if ( !psMemCheckType(PS_DATA_SCALAR, scalar) ) { 765 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckScalar failed in memCheckType. \n"); 766 psFree(scalar); 767 return 1; 768 } 769 psFree(scalar); 770 771 psSphere *sphere; 772 sphere = psSphereAlloc(); 773 if ( !psMemCheckType(PS_DATA_SPHERE, sphere) ) { 774 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckSphere failed in memCheckType. \n"); 775 psFree(sphere); 776 return 1; 777 } 778 psFree(sphere); 779 780 psSphereRot *sphereRot; 781 sphereRot = psSphereRotAlloc(0, 0, 20); 782 if ( !psMemCheckType(PS_DATA_SPHEREROT, sphereRot) ) { 783 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckSphereRot failed in memCheckType. \n"); 784 psFree(sphereRot); 785 return 1; 786 } 787 psFree(sphereRot); 788 789 psSpline1D *spline; 790 spline = psSpline1DAlloc(2, 1, 0, 2); 791 if ( !psMemCheckType(PS_DATA_SPLINE1D, spline) ) { 792 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckSpline1D failed in memCheckType. \n"); 793 psFree(spline); 794 return 1; 795 } 796 psFree(spline); 797 798 psStats *stats; 799 stats = psStatsAlloc(PS_STAT_MAX); 800 if ( !psMemCheckType(PS_DATA_STATS, stats) ) { 801 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckStats failed in memCheckType. \n"); 802 psFree(stats); 803 return 1; 804 } 805 psFree(stats); 806 807 /* psTime *time; 808 time = psTimeAlloc(PS_TIME_UT1); 809 if ( !psMemCheckType(PS_DATA_TIME, time) ) 810 { 811 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckTime failed in memCheckType. \n"); 812 psFree(time); 813 return 1; 814 } 815 psFree(time); 816 */ 817 psVector *vector; 818 vector = psVectorAlloc(100, PS_TYPE_F32); 819 if ( !psMemCheckType(PS_DATA_VECTOR, vector) ) { 820 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "psMemCheckVector failed in memCheckType. \n"); 821 psFree(vector); 822 return 1; 823 } 824 psFree(vector); 825 826 827 // psFree(negative); 828 // psFree(neg); 829 830 return 0; 831 } -
trunk/psLib/test/sys/verified/tst_psMemory.stderr
r4547 r4898 151 151 ---> TESTPOINT PASSED (psMemory{multipleFree} | tst_psMemory.c) 152 152 153 /***************************** TESTPOINT ******************************************\ 154 * TestFile: tst_psMemory.c * 155 * TestPoint: psMemory{psMemCheckType} * 156 * TestType: Positive * 157 \**********************************************************************************/ 158 159 160 ---> TESTPOINT PASSED (psMemory{psMemCheckType} | tst_psMemory.c) 161 -
trunk/psLib/test/types/tst_psArray.c
r4547 r4898 17 17 * @author Ross Harman, MHPCC 18 18 * 19 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $20 * @date $Date: 2005-0 7-13 02:47:01$19 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 20 * @date $Date: 2005-08-30 01:14:13 $ 21 21 * 22 22 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 52 52 static psS32 testArray01( void ); 53 53 static psS32 testArrayAdd( void ); 54 54 55 55 56 testDescription tests[] = { … … 439 440 return 0; // the value that indicates success is part of the testDescription 440 441 } 441
Note:
See TracChangeset
for help on using the changeset viewer.
