Changeset 2790
- Timestamp:
- Dec 22, 2004, 11:00:50 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/dataManip/tst_psFunc00.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/dataManip/tst_psFunc00.c
r2742 r2790 23 23 #define CN 6 24 24 #define DN 8 25 26 // XXX: This test comes from Paul Price. We should add into the code. 27 #define ORDER 3 28 #define BAD 1 29 int t01() 30 { 31 psPolynomial1D *poly = psPolynomial1DAlloc(ORDER, PS_POLYNOMIAL_ORD); 32 33 for (int i = 0; i < poly->n; i++) { 34 poly->coeff[i] = (float)i; 35 if (i == BAD) { 36 poly->mask[i] = 1; // Don't use this coefficient! 37 } else { 38 poly->mask[i] = 0; 39 } 40 } 41 42 fprintf(stderr,"Value using mask: %f\n", psPolynomial1DEval(poly, 0.5)); 43 44 // A different method of doing the same thing 45 poly->coeff[BAD] = 0.0; 46 poly->mask[BAD] = 0; 47 48 fprintf(stderr,"Value using coefficient zeroing: %f\n", psPolynomial1DEval(poly, 0.5)); 49 50 psFree(poly); 51 52 return(0); 53 } 54 55 25 56 psS32 main() 26 57 { 58 t01(); 59 27 60 psPolynomial1D *my1DPoly = NULL; 28 61 psPolynomial2D *my2DPoly = NULL; … … 605 638 return (!testStatus); 606 639 } 640
Note:
See TracChangeset
for help on using the changeset viewer.
