Changeset 2221 for trunk/psLib/src/math/psPolynomial.c
- Timestamp:
- Oct 27, 2004, 1:31:44 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psPolynomial.c (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psPolynomial.c
r2218 r2221 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1.5 6$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-10-27 2 1:25:52$9 * @version $Revision: 1.57 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-10-27 23:31:43 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 32 32 #include "psTrace.h" 33 33 #include "psError.h" 34 #include "psAbort.h"35 34 #include "psLogMsg.h" 36 35 #include "psFunctions.h" … … 145 144 Gaussian distribution as well. 146 145 147 NOTE:XXX: There is no way to seed the random generator.146 XXX: There is no way to seed the random generator. 148 147 *****************************************************************************/ 149 148 psVector* psGaussianDev(float mean, float sigma, psS32 Npts) … … 167 166 } 168 167 169 // NOTE: Should I free r as well?168 // XXX: Should I free r, T as well? This is a memory leak. 170 169 return(gauss); 171 170 } … … 426 425 } 427 426 428 429 if (NULL == myPoly) {430 psAbort(__func__, "psPolynomial1DEval(): myPoly is NULL\n");431 }432 433 // NOTE: Do we want to flag this case?434 if (myPoly->n == 0) {435 return(1.0);436 }437 438 if (NULL == myPoly->coeff) {439 psAbort(__func__, "psPolynomial1DEval(): myPoly->coeff is NULL\n");440 }441 442 427 for (loop_x = 0; loop_x < myPoly->n; loop_x++) { 443 428 if (myPoly->mask[loop_x] == 0) { … … 508 493 return(p_psChebPolynomial1DEval(x, myPoly)); 509 494 } else { 510 ps Abort(__func__, "Unknown polynomial type 0x%x\n", myPoly->type);495 psError(__func__, "Unknown polynomial type 0x%x\n", myPoly->type); 511 496 } 512 497 return(0.0); … … 604 589 return(p_psChebPolynomial2DEval(x, y, myPoly)); 605 590 } else { 606 ps Abort(__func__, "Unknown polynomial type 0x%x\n", myPoly->type);591 psError(__func__, "Unknown polynomial type 0x%x\n", myPoly->type); 607 592 } 608 593 return(0.0); … … 727 712 return(p_psChebPolynomial3DEval(x, y, z, myPoly)); 728 713 } else { 729 ps Abort(__func__, "Unknown polynomial type 0x%x\n", myPoly->type);714 psError(__func__, "Unknown polynomial type 0x%x\n", myPoly->type); 730 715 } 731 716 return(0.0); … … 876 861 return(p_psChebPolynomial4DEval(w,x,y,z, myPoly)); 877 862 } else { 878 ps Abort(__func__, "Unknown polynomial type 0x%x\n", myPoly->type);863 psError(__func__, "Unknown polynomial type 0x%x\n", myPoly->type); 879 864 } 880 865 return(0.0); … … 1185 1170 double xSum = 1.0; 1186 1171 1187 // NOTE: Do we want to flag this case?1188 if (myPoly->n == 0) {1189 return(1.0);1190 }1191 1192 1172 for (loop_x = 0; loop_x < myPoly->n; loop_x++) { 1193 1173 if (myPoly->mask[loop_x] == 0) { … … 1236 1216 return(p_psDChebPolynomial1DEval(x, myPoly)); 1237 1217 } else { 1238 ps Abort(__func__, "Unknown polynomial type 0x%x\n", myPoly->type);1218 psError(__func__, "Unknown polynomial type 0x%x\n", myPoly->type); 1239 1219 } 1240 1220 return(0.0); … … 1330 1310 return(p_psDChebPolynomial2DEval(x, y, myPoly)); 1331 1311 } else { 1332 ps Abort(__func__, "Unknown polynomial type 0x%x\n", myPoly->type);1312 psError(__func__, "Unknown polynomial type 0x%x\n", myPoly->type); 1333 1313 } 1334 1314 return(0.0); … … 1452 1432 return(p_psDChebPolynomial3DEval(x, y, z, myPoly)); 1453 1433 } else { 1454 ps Abort(__func__, "Unknown polynomial type 0x%x\n", myPoly->type);1434 psError(__func__, "Unknown polynomial type 0x%x\n", myPoly->type); 1455 1435 } 1456 1436 return(0.0); … … 1603 1583 return(p_psDChebPolynomial4DEval(w,x,y,z, myPoly)); 1604 1584 } else { 1605 ps Abort(__func__, "Unknown polynomial type 0x%x\n", myPoly->type);1585 psError(__func__, "Unknown polynomial type 0x%x\n", myPoly->type); 1606 1586 } 1607 1587 return(0.0);
Note:
See TracChangeset
for help on using the changeset viewer.
