Changeset 1073 for trunk/psLib/src/dataManip
- Timestamp:
- Jun 23, 2004, 1:00:17 PM (22 years ago)
- Location:
- trunk/psLib/src/dataManip
- Files:
-
- 6 edited
-
psFFT.c (modified) (37 diffs)
-
psFunctions.c (modified) (18 diffs)
-
psFunctions.h (modified) (3 diffs)
-
psStats.c (modified) (12 diffs)
-
psStats.h (modified) (3 diffs)
-
psVectorFFT.c (modified) (37 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/dataManip/psFFT.c
r1010 r1073 5 5 * @author Robert DeSonia, MHPCC 6 6 * 7 * @version $Revision: 1.1 0$ $Name: not supported by cvs2svn $8 * @date $Date: 2004-06- 12 02:17:25 $7 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2004-06-23 23:00:15 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 35 35 /* got good image data? */ 36 36 if (in==NULL) { 37 ps ImageFree(out);37 psFree(out); 38 38 return NULL; 39 39 } … … 44 44 psError(__func__,"Input image must be a 32-bit float or complex image (type=%d)", 45 45 type); 46 ps ImageFree(out);46 psFree(out); 47 47 return NULL; 48 48 } … … 51 51 psError(__func__,"Input image must be complex image for reverse FFT (type=%d).", 52 52 type); 53 ps ImageFree(out);53 psFree(out); 54 54 return NULL; 55 55 … … 76 76 if (plan == NULL) { 77 77 psError(__func__,"Failed to create FFTW plan."); 78 ps ImageFree(out);78 psFree(out); 79 79 return NULL; 80 80 } … … 98 98 99 99 if (in == NULL) { 100 ps ImageFree(out);100 psFree(out); 101 101 return NULL; 102 102 } … … 143 143 psError(__func__,"Can not extract real component from given image type (%d).", 144 144 type); 145 ps ImageFree(out);145 psFree(out); 146 146 return NULL; 147 147 } … … 158 158 159 159 if (in == NULL) { 160 ps ImageFree(out);160 psFree(out); 161 161 return NULL; 162 162 } … … 205 205 psError(__func__,"Can not extract imaginary component from given image type (%d).", 206 206 type); 207 ps ImageFree(out);207 psFree(out); 208 208 return NULL; 209 209 } … … 220 220 221 221 if (real == NULL || imag == NULL) { 222 ps ImageFree(out);222 psFree(out); 223 223 return NULL; 224 224 } … … 230 230 if (imag->type.type != type) { 231 231 psError(__func__,"The inputs to psImageComplex must be the same type."); 232 ps ImageFree(out);232 psFree(out); 233 233 return NULL; 234 234 } … … 237 237 imag->numRows != numRows) { 238 238 psError(__func__,"The inputs to psImageComplex must be the same dimensions."); 239 ps ImageFree(out);239 psFree(out); 240 240 return NULL; 241 241 } … … 243 243 if (PS_IS_PSELEMTYPE_COMPLEX(type)) { 244 244 psError(__func__,"The inputs to psImageComplex can not be complex."); 245 ps ImageFree(out);245 psFree(out); 246 246 return NULL; 247 247 } … … 249 249 if (type != PS_TYPE_F32 && type != PS_TYPE_F64) { 250 250 psError(__func__,"The input type to psImageComplex must be a floating point."); 251 ps ImageFree(out);251 psFree(out); 252 252 return NULL; 253 253 } … … 287 287 psError(__func__,"Can not merge real and imaginary portions for given image type (%d).", 288 288 type); 289 ps ImageFree(out);289 psFree(out); 290 290 return NULL; 291 291 } … … 302 302 303 303 if (in == NULL) { 304 ps ImageFree(out);304 psFree(out); 305 305 return NULL; 306 306 } … … 347 347 psError(__func__,"Can not compute complex conjugate for given image type (%d).", 348 348 type); 349 ps ImageFree(out);349 psFree(out); 350 350 return NULL; 351 351 } … … 362 362 363 363 if (in == NULL) { 364 ps ImageFree(out);364 psFree(out); 365 365 return NULL; 366 366 } … … 374 374 if (! PS_IS_PSELEMTYPE_COMPLEX(type)) { 375 375 psError(__func__,"Power Spectrum for non-complex inputs is not implemented."); 376 ps ImageFree(out);376 psFree(out); 377 377 return NULL; 378 378 } … … 417 417 psError(__func__,"Can not power spectrum for given image type (%d).", 418 418 type); 419 ps ImageFree(out);419 psFree(out); 420 420 return NULL; 421 421 } … … 435 435 /* got good image data? */ 436 436 if (in==NULL) { 437 ps VectorFree(out);437 psFree(out); 438 438 return NULL; 439 439 } … … 444 444 psError(__func__,"Input image must be a 32-bit float or complex image (type=%d)", 445 445 type); 446 ps VectorFree(out);446 psFree(out); 447 447 return NULL; 448 448 } … … 451 451 psError(__func__,"Input image must be complex image for reverse FFT (type=%d).", 452 452 type); 453 ps VectorFree(out);453 psFree(out); 454 454 return NULL; 455 455 … … 491 491 if (plan == NULL) { 492 492 psError(__func__,"Failed to create FFTW plan."); 493 ps VectorFree(out);493 psFree(out); 494 494 return NULL; 495 495 } … … 510 510 511 511 if (in == NULL) { 512 ps VectorFree(out);512 psFree(out); 513 513 return NULL; 514 514 } … … 542 542 psError(__func__,"Can not extract real component from given vector type (%d).", 543 543 type); 544 ps VectorFree(out);544 psFree(out); 545 545 return NULL; 546 546 } … … 556 556 557 557 if (in == NULL) { 558 ps VectorFree(out);558 psFree(out); 559 559 return NULL; 560 560 } … … 588 588 psError(__func__,"Can not extract imaginary component from given vector type (%d).", 589 589 type); 590 ps VectorFree(out);590 psFree(out); 591 591 return NULL; 592 592 } … … 602 602 603 603 if (real == NULL || imag == NULL) { 604 ps VectorFree(out);604 psFree(out); 605 605 return NULL; 606 606 } … … 615 615 if (imag->type.type != type) { 616 616 psError(__func__,"The inputs to psVectorComplex must be the same type."); 617 ps VectorFree(out);617 psFree(out); 618 618 return NULL; 619 619 } … … 621 621 if (PS_IS_PSELEMTYPE_COMPLEX(type)) { 622 622 psError(__func__,"The inputs to psVectorComplex can not be complex."); 623 ps VectorFree(out);623 psFree(out); 624 624 return NULL; 625 625 } … … 640 640 psError(__func__,"Can not merge real and imaginary portions for given vector type (%d).", 641 641 type); 642 ps VectorFree(out);642 psFree(out); 643 643 return NULL; 644 644 } … … 654 654 655 655 if (in == NULL) { 656 ps VectorFree(out);656 psFree(out); 657 657 return NULL; 658 658 } … … 687 687 psError(__func__,"Can not compute complex conjugate for given vector type (%d).", 688 688 type); 689 ps VectorFree(out);689 psFree(out); 690 690 return NULL; 691 691 } … … 703 703 704 704 if (in == NULL) { 705 ps VectorFree(out);705 psFree(out); 706 706 return NULL; 707 707 } … … 716 716 if (! PS_IS_PSELEMTYPE_COMPLEX(type)) { 717 717 psError(__func__,"Power Spectrum for non-complex inputs is not implemented."); 718 ps VectorFree(out);718 psFree(out); 719 719 return NULL; 720 720 } … … 747 747 psError(__func__,"Can not power spectrum for given vector type (%d).", 748 748 type); 749 ps VectorFree(out);750 return NULL; 751 } 752 753 return out; 754 755 } 749 psFree(out); 750 return NULL; 751 } 752 753 return out; 754 755 } -
trunk/psLib/src/dataManip/psFunctions.c
r1022 r1073 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-06- 14 19:40:14$9 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-06-23 23:00:15 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 34 34 #include <gsl/gsl_rng.h> 35 35 #include <gsl/gsl_randist.h> 36 37 static void polynomial1DFree(psPolynomial1D *myPoly); 38 static void polynomial2DFree(psPolynomial2D *myPoly); 39 static void polynomial3DFree(psPolynomial3D *myPoly); 40 static void polynomial4DFree(psPolynomial4D *myPoly); 41 static void dPolynomial1DFree(psDPolynomial1D *myPoly); 42 static void dPolynomial2DFree(psDPolynomial2D *myPoly); 43 static void dPolynomial3DFree(psDPolynomial3D *myPoly); 44 static void dPolynomial4DFree(psDPolynomial4D *myPoly); 45 36 46 /*****************************************************************************/ 37 47 /* FUNCTION IMPLEMENTATION - PUBLIC */ … … 108 118 109 119 newPoly = (psPolynomial1D *) psAlloc(sizeof(psPolynomial1D)); 120 p_psMemSetDeallocator(newPoly,(psFreeFcn)polynomial1DFree); 110 121 newPoly->n = n; 111 122 newPoly->coeff = (float *) psAlloc(n * sizeof(float)); … … 128 139 129 140 newPoly = (psPolynomial2D *) psAlloc(sizeof(psPolynomial2D)); 141 p_psMemSetDeallocator(newPoly,(psFreeFcn)polynomial2DFree); 130 142 newPoly->nX = nX; 131 143 newPoly->nY = nY; … … 158 170 159 171 newPoly = (psPolynomial3D *) psAlloc(sizeof(psPolynomial3D)); 172 p_psMemSetDeallocator(newPoly,(psFreeFcn)polynomial3DFree); 160 173 newPoly->nX = nX; 161 174 newPoly->nY = nY; … … 197 210 198 211 newPoly = (psPolynomial4D *) psAlloc(sizeof(psPolynomial4D)); 212 p_psMemSetDeallocator(newPoly,(psFreeFcn)polynomial4DFree); 199 213 newPoly->nW = nW; 200 214 newPoly->nX = nX; … … 235 249 } 236 250 237 void psPolynomial1DFree(psPolynomial1D *myPoly)251 static void polynomial1DFree(psPolynomial1D *myPoly) 238 252 { 239 253 psFree(myPoly->coeff); 240 254 psFree(myPoly->coeffErr); 241 255 psFree(myPoly->mask); 242 psFree(myPoly); 243 } 244 245 void psPolynomial2DFree(psPolynomial2D *myPoly) 256 } 257 258 static void polynomial2DFree(psPolynomial2D *myPoly) 246 259 { 247 260 int x = 0; … … 255 268 psFree(myPoly->coeffErr); 256 269 psFree(myPoly->mask); 257 258 psFree(myPoly); 259 } 260 261 void psPolynomial3DFree(psPolynomial3D *myPoly) 270 } 271 272 static void polynomial3DFree(psPolynomial3D *myPoly) 262 273 { 263 274 int x = 0; … … 278 289 psFree(myPoly->coeffErr); 279 290 psFree(myPoly->mask); 280 psFree(myPoly); 281 } 282 283 void psPolynomial4DFree(psPolynomial4D *myPoly) 291 } 292 293 static void polynomial4DFree(psPolynomial4D *myPoly) 284 294 { 285 295 int w = 0; … … 306 316 psFree(myPoly->coeffErr); 307 317 psFree(myPoly->mask); 308 psFree(myPoly);309 318 } 310 319 … … 434 443 435 444 newPoly = (psDPolynomial1D *) psAlloc(sizeof(psDPolynomial1D)); 445 p_psMemSetDeallocator(newPoly,(psFreeFcn)dPolynomial1DFree); 436 446 newPoly->n = n; 437 447 newPoly->coeff = (double *) psAlloc(n * sizeof(double)); … … 454 464 455 465 newPoly = (psDPolynomial2D *) psAlloc(sizeof(psDPolynomial2D)); 466 p_psMemSetDeallocator(newPoly,(psFreeFcn)dPolynomial2DFree); 456 467 newPoly->nX = nX; 457 468 newPoly->nY = nY; … … 484 495 485 496 newPoly = (psDPolynomial3D *) psAlloc(sizeof(psDPolynomial3D)); 497 p_psMemSetDeallocator(newPoly,(psFreeFcn)dPolynomial3DFree); 486 498 newPoly->nX = nX; 487 499 newPoly->nY = nY; … … 523 535 524 536 newPoly = (psDPolynomial4D *) psAlloc(sizeof(psDPolynomial4D)); 537 p_psMemSetDeallocator(newPoly,(psFreeFcn)dPolynomial4DFree); 525 538 newPoly->nW = nW; 526 539 newPoly->nX = nX; … … 561 574 } 562 575 563 void psDPolynomial1DFree(psDPolynomial1D *myPoly)576 static void dPolynomial1DFree(psDPolynomial1D *myPoly) 564 577 { 565 578 psFree(myPoly->coeff); 566 579 psFree(myPoly->coeffErr); 567 580 psFree(myPoly->mask); 568 psFree(myPoly); 569 } 570 571 void psDPolynomial2DFree(psDPolynomial2D *myPoly) 581 } 582 583 static void dPolynomial2DFree(psDPolynomial2D *myPoly) 572 584 { 573 585 int x = 0; … … 581 593 psFree(myPoly->coeffErr); 582 594 psFree(myPoly->mask); 583 584 psFree(myPoly); 585 } 586 587 void psDPolynomial3DFree(psDPolynomial3D *myPoly) 595 } 596 597 static void dPolynomial3DFree(psDPolynomial3D *myPoly) 588 598 { 589 599 int x = 0; … … 604 614 psFree(myPoly->coeffErr); 605 615 psFree(myPoly->mask); 606 psFree(myPoly); 607 } 608 609 void psDPolynomial4DFree(psDPolynomial4D *myPoly) 616 } 617 618 static void dPolynomial4DFree(psDPolynomial4D *myPoly) 610 619 { 611 620 int w = 0; … … 632 641 psFree(myPoly->coeffErr); 633 642 psFree(myPoly->mask); 634 psFree(myPoly);635 643 } 636 644 -
trunk/psLib/src/dataManip/psFunctions.h
r1020 r1073 12 12 * @author George Gusciora, MHPCC 13 13 * 14 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-06- 14 19:32:42$14 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-06-23 23:00:15 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 104 104 ); 105 105 106 /** Destructor */107 void psPolynomial1DFree(psPolynomial1D *myPoly ///< Polynomial to destroy108 );109 110 /** Destructor */111 void psPolynomial2DFree(psPolynomial2D *myPoly ///< Polynomial to destroy112 );113 /** Destructor */114 void psPolynomial3DFree(psPolynomial3D *myPoly ///< Polynomial to destroy115 );116 /** Destructor */117 void psPolynomial4DFree(psPolynomial4D *myPoly ///< Polynomial to destroy118 );119 120 121 106 /** Evaluate 1D polynomial */ 122 107 float … … 206 191 ); 207 192 208 209 /** Destructor */210 void psDPolynomial1DFree(psDPolynomial1D *myPoly ///< Polynomial to destroy211 );212 /** Destructor */213 void psDPolynomial2DFree(psDPolynomial2D *myPoly ///< Polynomial to destroy214 );215 /** Destructor */216 void psDPolynomial3DFree(psDPolynomial3D *myPoly ///< Polynomial to destroy217 );218 /** Destructor */219 void psDPolynomial4DFree(psDPolynomial4D *myPoly ///< Polynomial to destroy220 );221 222 223 193 /** Evaluate 1D polynomial (double precision) */ 224 194 double -
trunk/psLib/src/dataManip/psStats.c
r1071 r1073 32 32 psStats *stats); 33 33 #endif 34 35 static void histogramFree(psHistogram *myHist); 34 36 35 37 /****************************************************************************** … … 68 70 69 71 /****************************************************************************** 70 psStatsFree(): This routine must free the psStats data structure.71 *****************************************************************************/72 void psStatsFree(psStats *stats)73 {74 psFree(stats);75 }76 77 /******************************************************************************78 72 psHistogramAlloc(lower, upper, n): allocate a uniform histogram structure 79 73 with the specifed upper and lower limits, and the specifed number of bins. … … 108 102 // bins, then there are N+1 bounds to those bins. 109 103 newHist = (psHistogram *) psAlloc(sizeof(psHistogram)); 104 p_psMemSetDeallocator(newHist,(psFreeFcn)histogramFree); 110 105 newHist->bounds = psVectorAlloc(n+1, PS_TYPE_F32); 111 106 newHist->bounds->n = newHist->bounds->nalloc; … … 160 155 // Allocate memory for the new histogram structure. 161 156 newHist = (psHistogram *) psAlloc(sizeof(psHistogram)); 157 p_psMemSetDeallocator(newHist,(psFreeFcn)histogramFree); 162 158 newHist->bounds = psVectorAlloc(bounds->n, PS_TYPE_F32); 163 159 newHist->bounds->n = newHist->bounds->nalloc; … … 182 178 } 183 179 184 void psHistogramFree(psHistogram *myHist) 185 { 186 psVectorFree(myHist->bounds); 187 psVectorFree(myHist->nums); 188 psFree(myHist); 180 static void histogramFree(psHistogram *myHist) 181 { 182 psFree(myHist->bounds); 183 psFree(myHist->nums); 189 184 } 190 185 … … 618 613 619 614 // Free temporary data buffers. 620 ps StatsFree(stats2);615 psFree(stats2); 621 616 622 617 // Set the PS_STAT_ROBUST_FOR_SAMPLE bit in the stats structure. … … 688 683 689 684 // Free the temporary data structures. 690 ps VectorFree(unsortedVector);691 ps VectorFree(sortedVector);685 psFree(unsortedVector); 686 psFree(sortedVector); 692 687 } 693 688 … … 775 770 776 771 // Free temporary data buffers. 777 ps StatsFree(stats2);772 psFree(stats2); 778 773 779 774 // Set the PS_STAT_ROBUST_FOR_SAMPLE bit in the stats structure. … … 840 835 841 836 // Free the temporary data structures. 842 ps VectorFree(unsortedVector);843 ps VectorFree(sortedVector);837 psFree(unsortedVector); 838 psFree(sortedVector); 844 839 // NOTE: This is the 845 840 } … … 1043 1038 } 1044 1039 1045 ps VectorFree(tmpMask);1040 psFree(tmpMask); 1046 1041 } 1047 1042 … … 1125 1120 stats->robustLQ = stats->clippedMean; 1126 1121 } 1127 ps StatsFree(tmpStats);1128 ps HistogramFree(robustHistogram);1122 psFree(tmpStats); 1123 psFree(robustHistogram); 1129 1124 return; 1130 1125 } … … 1200 1195 stats->robustNfit = 0.0; 1201 1196 stats->robustN50 = 0.0; 1202 ps StatsFree(tmpStats);1203 ps HistogramFree(robustHistogram);1197 psFree(tmpStats); 1198 psFree(robustHistogram); 1204 1199 } 1205 1200 -
trunk/psLib/src/dataManip/psStats.h
r1020 r1073 9 9 * @author George Gusciora, MHPCC 10 10 * 11 * @version $Revision: 1.1 2$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-06- 14 19:33:09$11 * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-06-23 23:00:15 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 88 88 psStats *psStatsAlloc(psStatsOptions options); ///< Statistics to measure 89 89 90 /** A destructor for the stats structure.*/91 void psStatsFree(psStats *restrict stats); ///< Stats structure to destroy92 93 90 /****************************************************************************** 94 91 Histogram functions and data structures. … … 116 113 psHistogram * psHistogramAllocGeneric(const psVector *restrict bounds); ///< Bounds for the bins 117 114 118 119 /** Destructor \ingroup MathGroup **/120 void psHistogramFree(psHistogram *myHist); ///< Histogram to destroy121 122 123 115 /** Calculate a histogram \ingroup MathGroup **/ 124 116 psHistogram *psHistogramVector (psHistogram *out, ///< Histogram data -
trunk/psLib/src/dataManip/psVectorFFT.c
r1010 r1073 5 5 * @author Robert DeSonia, MHPCC 6 6 * 7 * @version $Revision: 1.1 0$ $Name: not supported by cvs2svn $8 * @date $Date: 2004-06- 12 02:17:25 $7 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2004-06-23 23:00:15 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 35 35 /* got good image data? */ 36 36 if (in==NULL) { 37 ps ImageFree(out);37 psFree(out); 38 38 return NULL; 39 39 } … … 44 44 psError(__func__,"Input image must be a 32-bit float or complex image (type=%d)", 45 45 type); 46 ps ImageFree(out);46 psFree(out); 47 47 return NULL; 48 48 } … … 51 51 psError(__func__,"Input image must be complex image for reverse FFT (type=%d).", 52 52 type); 53 ps ImageFree(out);53 psFree(out); 54 54 return NULL; 55 55 … … 76 76 if (plan == NULL) { 77 77 psError(__func__,"Failed to create FFTW plan."); 78 ps ImageFree(out);78 psFree(out); 79 79 return NULL; 80 80 } … … 98 98 99 99 if (in == NULL) { 100 ps ImageFree(out);100 psFree(out); 101 101 return NULL; 102 102 } … … 143 143 psError(__func__,"Can not extract real component from given image type (%d).", 144 144 type); 145 ps ImageFree(out);145 psFree(out); 146 146 return NULL; 147 147 } … … 158 158 159 159 if (in == NULL) { 160 ps ImageFree(out);160 psFree(out); 161 161 return NULL; 162 162 } … … 205 205 psError(__func__,"Can not extract imaginary component from given image type (%d).", 206 206 type); 207 ps ImageFree(out);207 psFree(out); 208 208 return NULL; 209 209 } … … 220 220 221 221 if (real == NULL || imag == NULL) { 222 ps ImageFree(out);222 psFree(out); 223 223 return NULL; 224 224 } … … 230 230 if (imag->type.type != type) { 231 231 psError(__func__,"The inputs to psImageComplex must be the same type."); 232 ps ImageFree(out);232 psFree(out); 233 233 return NULL; 234 234 } … … 237 237 imag->numRows != numRows) { 238 238 psError(__func__,"The inputs to psImageComplex must be the same dimensions."); 239 ps ImageFree(out);239 psFree(out); 240 240 return NULL; 241 241 } … … 243 243 if (PS_IS_PSELEMTYPE_COMPLEX(type)) { 244 244 psError(__func__,"The inputs to psImageComplex can not be complex."); 245 ps ImageFree(out);245 psFree(out); 246 246 return NULL; 247 247 } … … 249 249 if (type != PS_TYPE_F32 && type != PS_TYPE_F64) { 250 250 psError(__func__,"The input type to psImageComplex must be a floating point."); 251 ps ImageFree(out);251 psFree(out); 252 252 return NULL; 253 253 } … … 287 287 psError(__func__,"Can not merge real and imaginary portions for given image type (%d).", 288 288 type); 289 ps ImageFree(out);289 psFree(out); 290 290 return NULL; 291 291 } … … 302 302 303 303 if (in == NULL) { 304 ps ImageFree(out);304 psFree(out); 305 305 return NULL; 306 306 } … … 347 347 psError(__func__,"Can not compute complex conjugate for given image type (%d).", 348 348 type); 349 ps ImageFree(out);349 psFree(out); 350 350 return NULL; 351 351 } … … 362 362 363 363 if (in == NULL) { 364 ps ImageFree(out);364 psFree(out); 365 365 return NULL; 366 366 } … … 374 374 if (! PS_IS_PSELEMTYPE_COMPLEX(type)) { 375 375 psError(__func__,"Power Spectrum for non-complex inputs is not implemented."); 376 ps ImageFree(out);376 psFree(out); 377 377 return NULL; 378 378 } … … 417 417 psError(__func__,"Can not power spectrum for given image type (%d).", 418 418 type); 419 ps ImageFree(out);419 psFree(out); 420 420 return NULL; 421 421 } … … 435 435 /* got good image data? */ 436 436 if (in==NULL) { 437 ps VectorFree(out);437 psFree(out); 438 438 return NULL; 439 439 } … … 444 444 psError(__func__,"Input image must be a 32-bit float or complex image (type=%d)", 445 445 type); 446 ps VectorFree(out);446 psFree(out); 447 447 return NULL; 448 448 } … … 451 451 psError(__func__,"Input image must be complex image for reverse FFT (type=%d).", 452 452 type); 453 ps VectorFree(out);453 psFree(out); 454 454 return NULL; 455 455 … … 491 491 if (plan == NULL) { 492 492 psError(__func__,"Failed to create FFTW plan."); 493 ps VectorFree(out);493 psFree(out); 494 494 return NULL; 495 495 } … … 510 510 511 511 if (in == NULL) { 512 ps VectorFree(out);512 psFree(out); 513 513 return NULL; 514 514 } … … 542 542 psError(__func__,"Can not extract real component from given vector type (%d).", 543 543 type); 544 ps VectorFree(out);544 psFree(out); 545 545 return NULL; 546 546 } … … 556 556 557 557 if (in == NULL) { 558 ps VectorFree(out);558 psFree(out); 559 559 return NULL; 560 560 } … … 588 588 psError(__func__,"Can not extract imaginary component from given vector type (%d).", 589 589 type); 590 ps VectorFree(out);590 psFree(out); 591 591 return NULL; 592 592 } … … 602 602 603 603 if (real == NULL || imag == NULL) { 604 ps VectorFree(out);604 psFree(out); 605 605 return NULL; 606 606 } … … 615 615 if (imag->type.type != type) { 616 616 psError(__func__,"The inputs to psVectorComplex must be the same type."); 617 ps VectorFree(out);617 psFree(out); 618 618 return NULL; 619 619 } … … 621 621 if (PS_IS_PSELEMTYPE_COMPLEX(type)) { 622 622 psError(__func__,"The inputs to psVectorComplex can not be complex."); 623 ps VectorFree(out);623 psFree(out); 624 624 return NULL; 625 625 } … … 640 640 psError(__func__,"Can not merge real and imaginary portions for given vector type (%d).", 641 641 type); 642 ps VectorFree(out);642 psFree(out); 643 643 return NULL; 644 644 } … … 654 654 655 655 if (in == NULL) { 656 ps VectorFree(out);656 psFree(out); 657 657 return NULL; 658 658 } … … 687 687 psError(__func__,"Can not compute complex conjugate for given vector type (%d).", 688 688 type); 689 ps VectorFree(out);689 psFree(out); 690 690 return NULL; 691 691 } … … 703 703 704 704 if (in == NULL) { 705 ps VectorFree(out);705 psFree(out); 706 706 return NULL; 707 707 } … … 716 716 if (! PS_IS_PSELEMTYPE_COMPLEX(type)) { 717 717 psError(__func__,"Power Spectrum for non-complex inputs is not implemented."); 718 ps VectorFree(out);718 psFree(out); 719 719 return NULL; 720 720 } … … 747 747 psError(__func__,"Can not power spectrum for given vector type (%d).", 748 748 type); 749 ps VectorFree(out);750 return NULL; 751 } 752 753 return out; 754 755 } 749 psFree(out); 750 return NULL; 751 } 752 753 return out; 754 755 }
Note:
See TracChangeset
for help on using the changeset viewer.
