Changeset 17515 for trunk/psLib/test/math
- Timestamp:
- May 4, 2008, 2:09:04 PM (18 years ago)
- Location:
- trunk/psLib/test/math
- Files:
-
- 7 edited
-
tap_psPolyFit4D.c (modified) (2 diffs)
-
tap_psPolynomial.c (modified) (5 diffs)
-
tap_psPolynomialEval1D.c (modified) (5 diffs)
-
tap_psPolynomialEval2D.c (modified) (5 diffs)
-
tap_psPolynomialEval3D.c (modified) (5 diffs)
-
tap_psPolynomialEval4D.c (modified) (5 diffs)
-
tap_psPolynomialUtils_Derivatives.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/math/tap_psPolyFit4D.c
r13337 r17515 166 166 for (int iz = 0; iz < polyOrderZ + 1; iz++) { 167 167 for (int it = 0; it < polyOrderT + 1; it++) { 168 myPoly-> mask[ix][iy][iz][it] = 0xff; // Mask it out168 myPoly->coeffMask[ix][iy][iz][it] = 0xff; // Mask it out 169 169 } 170 170 } … … 173 173 174 174 // Put these back in 175 myPoly-> mask[0][0][0][0] = 0; // A176 myPoly-> mask[1][0][0][0] = 0; // B * x177 myPoly-> mask[0][1][0][0] = 0; // C * y178 myPoly-> mask[0][0][1][0] = 0; // D * z179 myPoly-> mask[0][0][0][1] = 0; // E * t180 myPoly-> mask[1][1][0][0] = 0; // F * xy175 myPoly->coeffMask[0][0][0][0] = 0; // A 176 myPoly->coeffMask[1][0][0][0] = 0; // B * x 177 myPoly->coeffMask[0][1][0][0] = 0; // C * y 178 myPoly->coeffMask[0][0][1][0] = 0; // D * z 179 myPoly->coeffMask[0][0][0][1] = 0; // E * t 180 myPoly->coeffMask[1][1][0][0] = 0; // F * xy 181 181 #endif 182 182 -
trunk/psLib/test/math/tap_psPolynomial.c
r13307 r17515 16 16 * XXX: Compare to FLT_EPSILON 17 17 * 18 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $19 * @date $Date: 200 7-05-08 06:35:16$18 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 19 * @date $Date: 2008-05-05 00:09:04 $ 20 20 * 21 21 * Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii … … 61 61 errorFlag = true; 62 62 } 63 if (my1DPoly-> mask[i] != 0) {64 diag("Mask[%d] %d not as expected %d", i, my1DPoly-> mask[i], 0);63 if (my1DPoly->coeffMask[i] != 0) { 64 diag("Mask[%d] %d not as expected %d", i, my1DPoly->coeffMask[i], 0); 65 65 errorFlag = true; 66 66 } … … 135 135 errorFlag = true; 136 136 } 137 if (my2DPoly-> mask[i][j] != 0) {138 diag("Mask[%d][%d] %d not as expected %d", i, j, my2DPoly-> mask[i][j], 0);137 if (my2DPoly->coeffMask[i][j] != 0) { 138 diag("Mask[%d][%d] %d not as expected %d", i, j, my2DPoly->coeffMask[i][j], 0); 139 139 errorFlag = true; 140 140 } … … 214 214 errorFlag = true; 215 215 } 216 if (my3DPoly-> mask[i][j][k] != 0) {216 if (my3DPoly->coeffMask[i][j][k] != 0) { 217 217 diag("Mask[%d][%d][%d] %d not as expected %d", 218 i, j, k, my3DPoly-> mask[i][j][k], 0);218 i, j, k, my3DPoly->coeffMask[i][j][k], 0); 219 219 errorFlag = true; 220 220 } … … 301 301 errorFlag = true; 302 302 } 303 if (my4DPoly-> mask[i][j][k][l] != 0) {303 if (my4DPoly->coeffMask[i][j][k][l] != 0) { 304 304 diag("Mask[%d][%d][%d][%d] %d not as expected %d", 305 i, j, k, l, my4DPoly-> mask[i][j][k][l], 0);305 i, j, k, l, my4DPoly->coeffMask[i][j][k][l], 0); 306 306 errorFlag = true; 307 307 } -
trunk/psLib/test/math/tap_psPolynomialEval1D.c
r13308 r17515 4 4 * ORD and CHEB type polynomials. 5 5 * 6 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $7 * @date $Date: 200 7-05-08 06:36:51$6 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2008-05-05 00:09:04 $ 8 8 * 9 9 * XXX: Probably should test single- and multi-dimensional polynomials in … … 68 68 for(psS32 i = 0; i < TERMS; i++) { 69 69 polyOrd->coeff[i] = poly1DCoeff[i]; 70 polyOrd-> mask[i] = poly1DMask[i];70 polyOrd->coeffMask[i] = poly1DMask[i]; 71 71 } 72 72 … … 97 97 { 98 98 polyCheb->coeff[i] = 1.0; 99 polyCheb-> mask[i] = poly1DMask[i];99 polyCheb->coeffMask[i] = poly1DMask[i]; 100 100 } 101 101 // Evaluate test points and verify results … … 133 133 { 134 134 polyOrd->coeff[i] = poly1DCoeff[i]; 135 polyOrd-> mask[i] = poly1DMask[i];135 polyOrd->coeffMask[i] = poly1DMask[i]; 136 136 } 137 137 … … 199 199 { 200 200 polyCheb->coeff[i] = 1.0; 201 polyCheb-> mask[i] = poly1DMask[i];201 polyCheb->coeffMask[i] = poly1DMask[i]; 202 202 } 203 203 -
trunk/psLib/test/math/tap_psPolynomialEval2D.c
r13308 r17515 4 4 * ORD and CHEB type polynomials. 5 5 * 6 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $7 * @date $Date: 200 7-05-08 06:36:51$6 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2008-05-05 00:09:04 $ 8 8 * 9 9 * Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii … … 96 96 for(psS32 j = 0; j < TERMS; j++) { 97 97 polyOrd->coeff[i][j] = poly2DCoeff[i][j]; 98 polyOrd-> mask[i][j] = poly2DMask[i][j];98 polyOrd->coeffMask[i][j] = poly2DMask[i][j]; 99 99 } 100 100 } … … 131 131 for(psS32 j = 0; j < TERMS; j++) { 132 132 polyCheb->coeff[i][j] = 1.0; 133 polyCheb-> mask[i][j] = poly2DMask[i][j];133 polyCheb->coeffMask[i][j] = poly2DMask[i][j]; 134 134 } 135 135 } … … 174 174 for(psS32 j = 0; j < TERMS; j++) { 175 175 polyOrd->coeff[i][j] = poly2DCoeff[i][j]; 176 polyOrd-> mask[i][j] = poly2DMask[i][j];176 polyOrd->coeffMask[i][j] = poly2DMask[i][j]; 177 177 } 178 178 } … … 268 268 for(psS32 j = 0; j < TERMS; j++) { 269 269 polyCheb->coeff[i][j] = 1.0; 270 polyCheb-> mask[i][j] = poly2DMask[i][j];270 polyCheb->coeffMask[i][j] = poly2DMask[i][j]; 271 271 } 272 272 } -
trunk/psLib/test/math/tap_psPolynomialEval3D.c
r13308 r17515 4 4 * ORD and CHEB type polynomials. 5 5 * 6 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $7 * @date $Date: 200 7-05-08 06:36:51$6 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2008-05-05 00:09:04 $ 8 8 * 9 9 * Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii … … 149 149 for(psS32 k = 0; k < TERMS; k++) { 150 150 polyOrd->coeff[i][j][k] = Dpoly3DCoeff[i][j][k]; 151 polyOrd-> mask[i][j][k] = poly3DMask[i][j][k];151 polyOrd->coeffMask[i][j][k] = poly3DMask[i][j][k]; 152 152 } 153 153 } … … 188 188 for(psS32 k = 0; k < TERMS; k++) { 189 189 polyCheb->coeff[i][j][k] = 1.0; 190 polyCheb-> mask[i][j][k] = poly3DMask[i][j][k];190 polyCheb->coeffMask[i][j][k] = poly3DMask[i][j][k]; 191 191 } 192 192 } … … 239 239 for(psS32 k = 0; k < TERMS; k++) { 240 240 polyOrd->coeff[i][j][k] = Dpoly3DCoeff[i][j][k]; 241 polyOrd-> mask[i][j][k] = poly3DMask[i][j][k];241 polyOrd->coeffMask[i][j][k] = poly3DMask[i][j][k]; 242 242 } 243 243 } … … 355 355 for(psS32 k = 0; k < TERMS; k++) { 356 356 polyCheb->coeff[i][j][k] = 1.0; 357 polyCheb-> mask[i][j][k] = poly3DMask[i][j][k];357 polyCheb->coeffMask[i][j][k] = poly3DMask[i][j][k]; 358 358 } 359 359 } -
trunk/psLib/test/math/tap_psPolynomialEval4D.c
r13308 r17515 4 4 * ORD and CHEB type polynomials. 5 5 * 6 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $7 * @date $Date: 200 7-05-08 06:36:51$6 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2008-05-05 00:09:04 $ 8 8 * 9 9 * Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii … … 389 389 for(psS32 l = 0; l < TERMS; l++) { 390 390 polyOrd->coeff[i][j][k][l] = Dpoly4DCoeff[i][j][k][l]; 391 polyOrd-> mask[i][j][k][l] = poly4DMask[i][j][k][l];391 polyOrd->coeffMask[i][j][k][l] = poly4DMask[i][j][k][l]; 392 392 } 393 393 } … … 428 428 for(psS32 l = 0; l < TERMS; l++) { 429 429 polyCheb->coeff[i][j][k][l] = 1.0; 430 polyCheb-> mask[i][j][k][l] = poly4DMask[i][j][k][l];430 polyCheb->coeffMask[i][j][k][l] = poly4DMask[i][j][k][l]; 431 431 } 432 432 } … … 485 485 for(psS32 l = 0; l < TERMS; l++) { 486 486 polyOrd->coeff[i][j][k][l] = Dpoly4DCoeff[i][j][k][l]; 487 polyOrd-> mask[i][j][k][l] = poly4DMask[i][j][k][l];487 polyOrd->coeffMask[i][j][k][l] = poly4DMask[i][j][k][l]; 488 488 } 489 489 } … … 629 629 for(psS32 l = 0; l < TERMS; l++) { 630 630 polyCheb->coeff[i][j][k][l] = 1.0; 631 polyCheb-> mask[i][j][k][l] = poly4DMask[i][j][k][l];631 polyCheb->coeffMask[i][j][k][l] = poly4DMask[i][j][k][l]; 632 632 } 633 633 } -
trunk/psLib/test/math/tap_psPolynomialUtils_Derivatives.c
r12607 r17515 33 33 34 34 // mask remaining elements 35 poly-> mask[2][1] = 1;36 poly-> mask[1][2] = 1;37 poly-> mask[2][2] = 1;35 poly->coeffMask[2][1] = 1; 36 poly->coeffMask[1][2] = 1; 37 poly->coeffMask[2][2] = 1; 38 38 39 39 psPolynomial2D *dX = psPolynomial2D_dX (NULL, poly); … … 46 46 is_float(dX->coeff[0][1], +4.0, "x^0 y^1 coeff is %f", dX->coeff[0][1]); 47 47 48 ok(!dX-> mask[0][0], "x^0 y^0 coeff is unmasked");49 ok(!dX-> mask[1][0], "x^1 y^0 coeff is unmasked");50 ok(!dX-> mask[0][1], "x^0 y^1 coeff is unmasked");51 52 ok(dX-> mask[1][1], "x^1 y^1 coeff is masked");53 ok(dX-> mask[1][2], "x^1 y^2 coeff is masked");48 ok(!dX->coeffMask[0][0], "x^0 y^0 coeff is unmasked"); 49 ok(!dX->coeffMask[1][0], "x^1 y^0 coeff is unmasked"); 50 ok(!dX->coeffMask[0][1], "x^0 y^1 coeff is unmasked"); 51 52 ok(dX->coeffMask[1][1], "x^1 y^1 coeff is masked"); 53 ok(dX->coeffMask[1][2], "x^1 y^2 coeff is masked"); 54 54 55 55 psFree (dX); … … 81 81 82 82 // mask remaining elements 83 poly-> mask[2][1] = 1;84 poly-> mask[1][2] = 1;85 poly-> mask[2][2] = 1;83 poly->coeffMask[2][1] = 1; 84 poly->coeffMask[1][2] = 1; 85 poly->coeffMask[2][2] = 1; 86 86 87 87 psPolynomial2D *dX = psPolynomial2DAlloc(PS_POLYNOMIAL_ORD, 2, 2); … … 95 95 is_float(dX->coeff[0][1], +4.0, "x^0 y^1 coeff is %f", dX->coeff[0][1]); 96 96 97 ok(!dX-> mask[0][0], "x^0 y^0 coeff is unmasked");98 ok(!dX-> mask[1][0], "x^1 y^0 coeff is unmasked");99 ok(!dX-> mask[0][1], "x^0 y^1 coeff is unmasked");100 101 ok(dX-> mask[1][1], "x^1 y^1 coeff is masked");102 ok(dX-> mask[1][2], "x^1 y^2 coeff is masked");97 ok(!dX->coeffMask[0][0], "x^0 y^0 coeff is unmasked"); 98 ok(!dX->coeffMask[1][0], "x^1 y^0 coeff is unmasked"); 99 ok(!dX->coeffMask[0][1], "x^0 y^1 coeff is unmasked"); 100 101 ok(dX->coeffMask[1][1], "x^1 y^1 coeff is masked"); 102 ok(dX->coeffMask[1][2], "x^1 y^2 coeff is masked"); 103 103 104 104 psFree (dX); … … 130 130 131 131 // mask remaining elements 132 poly-> mask[2][1] = 1;133 poly-> mask[1][2] = 1;134 poly-> mask[2][2] = 1;132 poly->coeffMask[2][1] = 1; 133 poly->coeffMask[1][2] = 1; 134 poly->coeffMask[2][2] = 1; 135 135 136 136 psPolynomial2D *result = psPolynomial2D_dX (poly, poly); … … 163 163 164 164 // mask remaining elements 165 poly-> mask[2][1] = 1;166 poly-> mask[1][2] = 1;167 poly-> mask[2][2] = 1;165 poly->coeffMask[2][1] = 1; 166 poly->coeffMask[1][2] = 1; 167 poly->coeffMask[2][2] = 1; 168 168 169 169 psPolynomial2D *dY = psPolynomial2D_dY (NULL, poly); … … 176 176 is_float(dY->coeff[0][1], -4.0, "x^0 y^1 coeff is %f", dY->coeff[0][1]); 177 177 178 ok(!dY-> mask[0][0], "x^0 y^0 coeff is unmasked");179 ok(!dY-> mask[1][0], "x^1 y^0 coeff is unmasked");180 ok(!dY-> mask[0][1], "x^0 y^1 coeff is unmasked");181 182 ok(dY-> mask[1][1], "x^1 y^1 coeff is masked");183 ok(dY-> mask[1][2], "x^1 y^2 coeff is masked");178 ok(!dY->coeffMask[0][0], "x^0 y^0 coeff is unmasked"); 179 ok(!dY->coeffMask[1][0], "x^1 y^0 coeff is unmasked"); 180 ok(!dY->coeffMask[0][1], "x^0 y^1 coeff is unmasked"); 181 182 ok(dY->coeffMask[1][1], "x^1 y^1 coeff is masked"); 183 ok(dY->coeffMask[1][2], "x^1 y^2 coeff is masked"); 184 184 185 185 psFree (dY); … … 211 211 212 212 // mask remaining elements 213 poly-> mask[2][1] = 1;214 poly-> mask[1][2] = 1;215 poly-> mask[2][2] = 1;213 poly->coeffMask[2][1] = 1; 214 poly->coeffMask[1][2] = 1; 215 poly->coeffMask[2][2] = 1; 216 216 217 217 psPolynomial2D *dY = psPolynomial2DAlloc(PS_POLYNOMIAL_ORD, 2, 2); … … 225 225 is_float(dY->coeff[0][1], -4.0, "x^0 y^1 coeff is %f", dY->coeff[0][1]); 226 226 227 ok(!dY-> mask[0][0], "x^0 y^0 coeff is unmasked");228 ok(!dY-> mask[1][0], "x^1 y^0 coeff is unmasked");229 ok(!dY-> mask[0][1], "x^0 y^1 coeff is unmasked");230 231 ok(dY-> mask[1][1], "x^1 y^1 coeff is masked");232 ok(dY-> mask[1][2], "x^1 y^2 coeff is masked");227 ok(!dY->coeffMask[0][0], "x^0 y^0 coeff is unmasked"); 228 ok(!dY->coeffMask[1][0], "x^1 y^0 coeff is unmasked"); 229 ok(!dY->coeffMask[0][1], "x^0 y^1 coeff is unmasked"); 230 231 ok(dY->coeffMask[1][1], "x^1 y^1 coeff is masked"); 232 ok(dY->coeffMask[1][2], "x^1 y^2 coeff is masked"); 233 233 234 234 psFree (dY); … … 260 260 261 261 // mask remaining elements 262 poly-> mask[2][1] = 1;263 poly-> mask[1][2] = 1;264 poly-> mask[2][2] = 1;262 poly->coeffMask[2][1] = 1; 263 poly->coeffMask[1][2] = 1; 264 poly->coeffMask[2][2] = 1; 265 265 266 266 psPolynomial2D *result = psPolynomial2D_dY (poly, poly);
Note:
See TracChangeset
for help on using the changeset viewer.
