Changeset 42822 for trunk/psLib/test/math
- Timestamp:
- May 8, 2025, 4:42:12 PM (12 months ago)
- Location:
- trunk/psLib/test
- Files:
-
- 39 deleted
- 9 edited
- 2 copied
-
. (modified) (1 prop)
-
math (modified) (1 prop)
-
math/Makefile.am (modified) (2 diffs)
-
math/tap_psMatrix08.c (modified) (7 diffs)
-
math/tap_psMinimizeLMM.c (modified) (4 diffs)
-
math/tap_psMinimizePowell.c (modified) (2 diffs)
-
math/tap_psPolyFit1D.c (modified) (2 diffs)
-
math/tap_psPolyFit_IRLS_1D.c (copied) (copied from branches/eam_branches/ipp-20230313/psLib/test/math/tap_psPolyFit_IRLS_1D.c )
-
math/tap_psPolyFit_IRLS_2D.c (copied) (copied from branches/eam_branches/ipp-20230313/psLib/test/math/tap_psPolyFit_IRLS_2D.c )
-
math/tap_psSparse.c (modified) (4 diffs)
-
math/tap_psSpline1D.c (modified) (6 diffs)
-
math/tst_psFunc01.c (deleted)
-
math/tst_psHist00.c (deleted)
-
math/tst_psHist01.c (deleted)
-
math/tst_psHist02.c (deleted)
-
math/tst_psHist03.c (deleted)
-
math/tst_psMathUtils.c (deleted)
-
math/tst_psMatrix01.c (deleted)
-
math/tst_psMatrix02.c (deleted)
-
math/tst_psMatrix04.c (deleted)
-
math/tst_psMatrix05.c (deleted)
-
math/tst_psMatrix06.c (deleted)
-
math/tst_psMatrix07.c (deleted)
-
math/tst_psMatrixVectorArithmetic01.c (deleted)
-
math/tst_psMatrixVectorArithmetic02.c (deleted)
-
math/tst_psMatrixVectorArithmetic03.c (deleted)
-
math/tst_psMatrixVectorArithmetic04.c (deleted)
-
math/tst_psMinimizeLMM.c (deleted)
-
math/tst_psMinimizePowell.c (deleted)
-
math/tst_psPolyFit1D.c (deleted)
-
math/tst_psPolyFit2D.c (deleted)
-
math/tst_psPolyFit3D.c (deleted)
-
math/tst_psPolyFit4D.c (deleted)
-
math/tst_psPolynomial.c (deleted)
-
math/tst_psPolynomialEval1D.c (deleted)
-
math/tst_psPolynomialEval2D.c (deleted)
-
math/tst_psPolynomialEval3D.c (deleted)
-
math/tst_psPolynomialEval4D.c (deleted)
-
math/tst_psRandom.c (deleted)
-
math/tst_psSparse.c (deleted)
-
math/tst_psSpline1D.c (deleted)
-
math/tst_psStats00.c (deleted)
-
math/tst_psStats01.c (deleted)
-
math/tst_psStats02.c (deleted)
-
math/tst_psStats03.c (deleted)
-
math/tst_psStats05.c (deleted)
-
math/tst_psStats06.c (deleted)
-
math/tst_psStats07.c (deleted)
-
math/tst_psStats08.c (deleted)
-
math/tst_psStats09.c (deleted)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test
- Property svn:ignore
-
old new 6 6 *.da 7 7 gmon.out 8 test.00.jpg 9 test.01.jpg 10 test.02.jpg 11 test.03.jpg 12 test.04.jpg 13 test.05.jpg 14 test.06.jpg 15 test.07.jpg 16 test.08.jpg 17 test.09.jpg 18 test.10.jpg 19 test.11.jpg 20 test.12.jpg 21 test.im.fits 22 test.mk.fits 23 test.sm1.fits 24 test.sm2.fits 25 test.sm3.fits 26 test.sm4.fits 27 tmpImages 28 tst_psTrace02_OUT
-
- Property svn:ignore
-
trunk/psLib/test/math
- Property svn:ignore
-
old new 53 53 tap_psSpline1D 54 54 tap_psPolynomialMD 55 tap_psMinimizeLMM 56 tap_psMinimizeLMM_Alt 57 tap_psMinimizeLMM_Trail 58 tap_psPolyFit_IRLS_1D 59 tap_psPolyFit_IRLS_2D 60 tap_psPolynomialMD_sampleDark 61 test-suite.log
-
- Property svn:ignore
-
trunk/psLib/test/math/Makefile.am
r35767 r42822 23 23 tap_psMatrix07 \ 24 24 tap_psMatrix08 \ 25 tap_psPolyFit1D \26 tap_psPolyFit2D \27 tap_psPolyFit3D \28 tap_psPolyFit4D \29 25 tap_psPolynomial \ 30 26 tap_psPolynomialEval1D \ … … 33 29 tap_psPolynomialEval4D \ 34 30 tap_psPolynomialUtils_Derivatives \ 31 tap_psPolyFit1D \ 32 tap_psPolyFit2D \ 33 tap_psPolyFit3D \ 34 tap_psPolyFit4D \ 35 tap_psPolyFit_IRLS_1D \ 36 tap_psPolyFit_IRLS_2D \ 35 37 tap_psSparse \ 36 38 tap_psStats00 \ -
trunk/psLib/test/math/tap_psMatrix08.c
r24087 r42822 20 20 psS32 main( psS32 argc, char* argv[] ) 21 21 { 22 fprintf (stderr, "path: %s\n", argv[0]); 23 24 char imApath[1024]; 25 char imBpath[1024]; 26 char topPath[1024]; 27 char *libpath = strstr (argv[0], ".libs/"); 28 if (!libpath) { 29 fprintf (stderr, "ERROR: cannot find input data\n"); 30 exit (2); 31 } 32 33 // if (strncmp(argv[0], ".libs/", 6)) 34 int nTopPath = libpath - argv[0]; // 35 if (nTopPath) { 36 ps_strncpy_nowarn (topPath, argv[0], nTopPath); topPath[nTopPath] = 0; 37 ps_snprintf_nowarn (imApath, 1024, "%s/%s", topPath, "data/Agj.fits"); 38 ps_snprintf_nowarn (imBpath, 1024, "%s/%s", topPath, "data/Bgj.fits"); 39 } else { 40 ps_snprintf_nowarn (imApath, 1024, "%s", "data/Agj.fits"); 41 ps_snprintf_nowarn (imBpath, 1024, "%s", "data/Bgj.fits"); 42 } 43 22 44 plan_tests(23); 23 45 // psTraceSetLevel("psLib.math.psMatrixGJSolve", 4); … … 32 54 // XXX this is an ill-conditioned matrix. LU Decomposition does not inform us that it is ill-conditioned. 33 55 // the result solves the equation, but what are the errors on the values? 34 fits = psFitsOpen ( "data/Agj.fits", "r");56 fits = psFitsOpen (imApath, "r"); 35 57 ok(fits, "opened test image Agj.fits"); 36 58 … … 43 65 psFitsClose (fits); 44 66 45 fits = psFitsOpen ( "data/Bgj.fits", "r");67 fits = psFitsOpen (imBpath, "r"); 46 68 ok(fits, "opened test image Bgj.fits"); 47 69 … … 98 120 99 121 // we have a specific ill-conditioned matrix in Agj.fits. psMatrixGJSolve detects this and reports a failure. 100 fits = psFitsOpen ( "data/Agj.fits", "r");122 fits = psFitsOpen (imApath, "r"); 101 123 ok(fits, "opened test image Agj.fits"); 102 124 … … 106 128 psFitsClose (fits); 107 129 108 fits = psFitsOpen ( "data/Bgj.fits", "r");130 fits = psFitsOpen (imBpath, "r"); 109 131 ok(fits, "opened test image Bgj.fits"); 110 132 … … 147 169 148 170 // we have a specific ill-conditioned matrix in Agj.fits. psMatrixGJSolve detects this and reports a failure. 149 fits = psFitsOpen ( "data/Agj.fits", "r");171 fits = psFitsOpen (imApath, "r"); 150 172 ok(fits, "opened test image Agj.fits"); 151 173 … … 158 180 psFitsClose (fits); 159 181 160 fits = psFitsOpen ( "data/Bgj.fits", "r");182 fits = psFitsOpen (imBpath, "r"); 161 183 ok(fits, "opened test image Bgj.fits"); 162 184 -
trunk/psLib/test/math/tap_psMinimizeLMM.c
r23259 r42822 53 53 54 54 #define NUM_ITER 10 55 #define TOL 20.0 55 #define MIN_TOL 20.0 56 #define MAX_TOL 40.0 56 57 psS32 main(psS32 argc, char* argv[]) 57 58 { … … 64 65 { 65 66 psMemId id = psMemGetId(); 66 psMinimization *tmp = psMinimizationAlloc(NUM_ITER, TOL);67 psMinimization *tmp = psMinimizationAlloc(NUM_ITER, MIN_TOL, MAX_TOL); 67 68 ok(tmp != NULL, "psMinimizationAlloc() returned non-NULL"); 68 69 skip_start(tmp == NULL, 5, "Skipping tests because psMinimizationAlloc() failed"); 69 70 ok(tmp->maxIter == NUM_ITER, "psMinimizationAlloc() properly set ->maxIter"); 70 ok(tmp->tol == TOL, "psMinimizationAlloc() properly set ->tol"); 71 ok(tmp->minTol == MIN_TOL, "psMinimizationAlloc() properly set ->tol"); 72 ok(tmp->maxTol == MAX_TOL, "psMinimizationAlloc() properly set ->tol"); 71 73 ok(tmp->value == 0.0, "psMinimizationAlloc() properly set ->value"); 72 74 ok(tmp->iter == 0, "psMinimizationAlloc() properly set ->iter (%d)", tmp->iter); … … 96 98 psMemId id = psMemGetId(); 97 99 psRandom *rng = psRandomAllocSpecific(PS_RANDOM_TAUS, 1); // Random number generator; using known seed 98 psMinimization *min = psMinimizationAlloc(NUM_ITERATIONS, ERR_TOL );100 psMinimization *min = psMinimizationAlloc(NUM_ITERATIONS, ERR_TOL, 100); 99 101 psArray *ordinates = psArrayAlloc(NUM_DATA_POINTS); 100 102 psVector *coordinates = psVectorAlloc(NUM_DATA_POINTS, PS_TYPE_F32); … … 204 206 psMemId id = psMemGetId(); 205 207 psRandom *rng = psRandomAllocSpecific(PS_RANDOM_TAUS, 1); // Random number generator; using known seed 206 psMinimization *min = psMinimizationAlloc(NUM_ITERATIONS, ERR_TOL );208 psMinimization *min = psMinimizationAlloc(NUM_ITERATIONS, ERR_TOL, 100); 207 209 psArray *ordinates = psArrayAlloc(NUM_DATA_POINTS); 208 210 psVector *coordinates = psVectorAlloc(NUM_DATA_POINTS, PS_TYPE_F32); -
trunk/psLib/test/math/tap_psMinimizePowell.c
r13124 r42822 81 81 psVector *myParams = psVectorAlloc(NUM_PARAMS, PS_TYPE_F32); 82 82 psVector *myParamMask = psVectorAlloc(NUM_PARAMS, PS_TYPE_U8); 83 psMinimization *min = psMinimizationAlloc(100, 0.01 );83 psMinimization *min = psMinimizationAlloc(100, 0.01, 0.1); 84 84 psArray *myCoords = psArrayAlloc(N); 85 85 … … 136 136 psMemId id = psMemGetId(); 137 137 psVector *myParams = psVectorAlloc(NUM_PARAMS, PS_TYPE_F32); 138 psMinimization *min = psMinimizationAlloc(100, 0.01 );138 psMinimization *min = psMinimizationAlloc(100, 0.01, 0.1); 139 139 psArray *myCoords = psArrayAlloc(N); 140 140 psVector *myParamMask = psVectorAlloc(NUM_PARAMS, PS_TYPE_U8); -
trunk/psLib/test/math/tap_psPolyFit1D.c
r23259 r42822 8 8 9 9 XXX: Try null stats. 10 11 XXX: this function is confused about POLY_ORDER (5 should have x^5, but setData stops at x^4) 10 12 *****************************************************************************/ 11 13 #include <stdio.h> … … 350 352 plan_tests(104); 351 353 354 // psTraceSetLevel ("psLib.math.psMatrixGJSolve", 4); 352 355 353 356 // psVectorFitPolynomial1D() -
trunk/psLib/test/math/tap_psSparse.c
r13124 r42822 1 #include <stdio.h>1 #include <stdio.h> 2 2 #include <string.h> 3 3 #include <pslib.h> … … 227 227 // test the support functions: LowerProduct 228 228 fVec = psSparseBorderLowerProduct(NULL, border, xRef); 229 is_ float(fVec->n, 1.0, "f dimen: %d", fVec->n);229 is_int(fVec->n, 1.0, "f dimen: %d", fVec->n); 230 230 is_float(fVec->data.F32[0], 0.3, "f(0): %f", fVec->data.F32[0]); 231 231 psFree(fVec); … … 233 233 // test the support functions: Upper Product 234 234 fVec = psSparseBorderUpperProduct(NULL, border, yRef); 235 is_ float(fVec->n, 2.0, "f dimen: %d", fVec->n);235 is_int(fVec->n, 2.0, "f dimen: %d", fVec->n); 236 236 is_float(fVec->data.F32[0], 0.05, "f(0): %f", fVec->data.F32[0]); 237 237 is_float(fVec->data.F32[1], 0.10, "f(0): %f", fVec->data.F32[1]); … … 240 240 // test the support functions: Square Product 241 241 fVec = psSparseBorderSquareProduct(NULL, border, yRef); 242 is_ float(fVec->n, 1.0, "f dimen: %d", fVec->n);242 is_int(fVec->n, 1.0, "f dimen: %d", fVec->n); 243 243 is_float(fVec->data.F32[0], 0.25, "f(0): %f", fVec->data.F32[0]); 244 244 psFree(fVec); -
trunk/psLib/test/math/tap_psSpline1D.c
r42336 r42822 107 107 psSpline1D *tmpSpline = NULL; 108 108 if (!xNull) { 109 tmpSpline = psSpline1DFitVector(xF32, yF32);109 tmpSpline = psSpline1DFitVector(xF32, yF32, NAN, NAN); 110 110 } else { 111 tmpSpline = psSpline1DFitVector(NULL, yF32 );111 tmpSpline = psSpline1DFitVector(NULL, yF32, NAN, NAN); 112 112 } 113 113 … … 120 120 testStatus = false; 121 121 } 122 if(tmpSpline->spline == NULL) { 123 diag("psSpline1DFitVector() returned a NULL psSpline1D->spline member."); 124 testStatus = false; 125 } 126 for (psS32 i = 0 ; i < NumSplines ; i++) { 127 if (tmpSpline->spline[i] == NULL) { 128 diag("psSpline1DFitVector() returned a NULL psSpline1D->spline[%d] member.", i); 129 testStatus = false; 130 } 131 } 132 if (tmpSpline->knots == NULL) { 122 if (tmpSpline->xKnots == NULL) { 133 123 diag("psSpline1DFitVector() returned a NULL psSpline1D->knots member"); 134 124 testStatus = false; 135 125 } 136 if (tmpSpline->p_psDeriv2 == NULL) { 126 if (tmpSpline->yKnots == NULL) { 127 diag("psSpline1DFitVector() returned a NULL psSpline1D->knots member"); 128 testStatus = false; 129 } 130 if (tmpSpline->d2yKnots == NULL) { 137 131 diag("psSpline1DFitVector()returned a NULL psSpline1D->p_psDeriv2 member"); 138 132 testStatus = false; 139 }140 141 // Test psSpline1DEval()142 for (psS32 i=0;i<NumSplines;i++) {143 psF32 x = 0.5 + (float) i;144 psF32 y = psSpline1DEval(tmpSpline, x);145 if (CheckErrorF32(y, func(x))) {146 testStatus = false;147 diag("TEST ERROR: f(%f) is %f, should be %f", x, y, myFunc00(x));148 // XXX EAM : the truth value above should be 'func' not myFunc00149 }150 133 } 151 134 … … 196 179 psSpline1D *tmpSpline = NULL; 197 180 if (!xNull) { 198 tmpSpline = psSpline1DFitVector(xF64, yF64 );181 tmpSpline = psSpline1DFitVector(xF64, yF64, NAN, NAN); 199 182 } else { 200 tmpSpline = psSpline1DFitVector(NULL, yF64 );183 tmpSpline = psSpline1DFitVector(NULL, yF64, NAN, NAN); 201 184 } 202 185 if(tmpSpline == NULL) { … … 208 191 testStatus = false; 209 192 } 210 if(tmpSpline->spline == NULL) { 211 diag("psSpline1DFitVector() returned a NULL psSpline1D->spline member."); 212 testStatus = false; 213 } 214 for (psS32 i = 0 ; i < NumSplines ; i++) { 215 if (tmpSpline->spline[i] == NULL) { 216 diag("psSpline1DFitVector() returned a NULL psSpline1D->spline[%d] member.", i); 217 testStatus = false; 218 } 219 } 220 if (tmpSpline->knots == NULL) { 221 diag("psSpline1DFitVector() returned a NULL psSpline1D->knots member"); 222 testStatus = false; 223 } 224 if (tmpSpline->p_psDeriv2 == NULL) { 225 diag("psSpline1DFitVector()returned a NULL psSpline1D->p_psDeriv2 member"); 193 if (tmpSpline->xKnots == NULL) { 194 diag("psSpline1DFitVector() returned a NULL psSpline1D->xKnots member"); 195 testStatus = false; 196 } 197 if (tmpSpline->yKnots == NULL) { 198 diag("psSpline1DFitVector() returned a NULL psSpline1D->yKnots member"); 199 testStatus = false; 200 } 201 if (tmpSpline->d2yKnots == NULL) { 202 diag("psSpline1DFitVector()returned a NULL psSpline1D->d2yKnots member"); 226 203 testStatus = false; 227 204 } … … 278 255 skip_start(tmpSpline == NULL, 4, "Skipping tests because psSpline1DAlloc() failed"); 279 256 ok(tmpSpline->n == 0, "psSpline1DAlloc() properly set the psSpline1D->n member"); 280 ok(tmpSpline-> spline == NULL, "psSpline1DAlloc() properly set the psSpline1D->splinemember");281 ok(tmpSpline-> knots == NULL, "psSpline1DAlloc() properly set the psSpline1D->knots member");282 ok(tmpSpline-> p_psDeriv2 == NULL, "psSpline1DAlloc() properly set the psSpline1D->p_psDeriv2member");257 ok(tmpSpline->xKnots == NULL, "psSpline1DAlloc() properly set the psSpline1D->xKnots member"); 258 ok(tmpSpline->yKnots == NULL, "psSpline1DAlloc() properly set the psSpline1D->yKnots member"); 259 ok(tmpSpline->d2yKnots == NULL, "psSpline1DAlloc() properly set the psSpline1D->d2yKnots member"); 283 260 psFree(tmpSpline); 284 261 skip_end(); … … 289 266 { 290 267 psMemId id = psMemGetId(); 291 psSpline1D *tmpSpline = psSpline1DFitVector(NULL, NULL );268 psSpline1D *tmpSpline = psSpline1DFitVector(NULL, NULL, NAN, NAN); 292 269 ok(tmpSpline == NULL, "psSpline1DFitVector() returns NULL with NULL arguments"); 293 270 ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
Note:
See TracChangeset
for help on using the changeset viewer.
