Changeset 4901 for trunk/psphot/src/psPolynomials.c
- Timestamp:
- Aug 29, 2005, 5:44:55 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psPolynomials.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psPolynomials.c
r4375 r4901 42 42 } 43 43 44 static void psPolynomial1DFree (psPolynomial1D *poly) { 45 46 if (poly == NULL) return; 47 psFree (poly->coeff); 48 psFree (poly->coeffErr); 49 psFree (poly->mask); 50 return; 51 } 52 44 53 // XXX EAM : use Nterm = Norder + 1 definition 45 54 // XXX EAM : should we provide both order and nterms in struct? … … 54 63 55 64 newPoly = (psPolynomial1D* ) psAlloc(sizeof(psPolynomial1D)); 56 // p_psMemSetDeallocator(newPoly, (psFreeFcn) polynomial1DFree);57 // XXX EAM : me, being lazy58 59 65 newPoly->type = type; 60 66 newPoly->n = nOrder; … … 67 73 newPoly->mask[i] = 0; 68 74 } 75 p_psMemSetDeallocator(newPoly, (psFreeFcn) psPolynomial1DFree); 69 76 return(newPoly); 70 77 } … … 185 192 myPoly->coeff[k] = coeffs->data.F64[k]; 186 193 } 194 psFree (ALUD); 195 psFree (outPerm); 196 psFree (coeffs); 187 197 } 188 198 … … 262 272 } 263 273 274 static void psPolynomial2DFree(psPolynomial2D *poly) { 275 276 if (poly == NULL) return; 277 for (int i = 0; i < poly->nX + 1; i++) { 278 psFree (poly->coeff[i]); 279 psFree (poly->coeffErr[i]); 280 psFree (poly->mask[i]); 281 } 282 psFree (poly->coeff); 283 psFree (poly->coeffErr); 284 psFree (poly->mask); 285 return; 286 } 287 264 288 // XXX EAM : use Nterm = Norder + 1 definition 265 289 // the user requests a polynomial of order Norder … … 277 301 278 302 newPoly = (psPolynomial2D* ) psAlloc(sizeof(psPolynomial2D)); 279 // p_psMemSetDeallocator(newPoly, (psFreeFcn) polynomial2DFree);280 // XXX EAM : me, being lazy281 282 303 newPoly->type = type; 283 304 newPoly->nX = nXorder; … … 299 320 } 300 321 } 322 p_psMemSetDeallocator(newPoly, (psFreeFcn) psPolynomial2DFree); 301 323 return(newPoly); 302 324 }
Note:
See TracChangeset
for help on using the changeset viewer.
