Changeset 6484
- Timestamp:
- Feb 24, 2006, 1:43:16 PM (20 years ago)
- Location:
- trunk/psLib
- Files:
-
- 41 edited
-
src/astro/psCoord.c (modified) (2 diffs)
-
src/db/psDB.c (modified) (3 diffs)
-
src/fits/psFitsTable.c (modified) (2 diffs)
-
src/imageops/psImageGeomManip.c (modified) (2 diffs)
-
src/imageops/psImagePixelExtract.c (modified) (5 diffs)
-
src/math/psConstants.h (modified) (2 diffs)
-
src/math/psMinimizeLMM.c (modified) (5 diffs)
-
src/math/psMinimizePolyFit.c (modified) (14 diffs)
-
src/math/psMinimizePowell.c (modified) (6 diffs)
-
src/math/psPolynomial.c (modified) (8 diffs)
-
src/math/psSpline.c (modified) (4 diffs)
-
src/math/psStats.c (modified) (24 diffs)
-
src/mathtypes/psVector.c (modified) (4 diffs)
-
src/types/psArray.c (modified) (3 diffs)
-
src/types/psLookupTable.c (modified) (3 diffs)
-
src/types/psMetadataConfig.c (modified) (2 diffs)
-
test/db/verified/tst_psDB.stderr (modified) (1 diff)
-
test/fits/tst_psFits.c (modified) (2 diffs)
-
test/imageops/tst_psImageConvolve.c (modified) (4 diffs)
-
test/imageops/tst_psImagePixelExtract.c (modified) (2 diffs)
-
test/imageops/verified/tst_psImagePixelExtract.stderr (modified) (1 diff)
-
test/math/tst_psMinimizeLMM.c (modified) (2 diffs)
-
test/math/tst_psMinimizePowell.c (modified) (5 diffs)
-
test/math/tst_psPolyFit1D.c (modified) (11 diffs)
-
test/math/tst_psPolyFit2D.c (modified) (13 diffs)
-
test/math/tst_psPolyFit3D.c (modified) (17 diffs)
-
test/math/tst_psPolyFit4D.c (modified) (20 diffs)
-
test/math/tst_psPolynomialEval1D.c (modified) (3 diffs)
-
test/math/tst_psPolynomialEval2D.c (modified) (2 diffs)
-
test/math/tst_psPolynomialEval3D.c (modified) (2 diffs)
-
test/math/tst_psPolynomialEval4D.c (modified) (2 diffs)
-
test/math/tst_psRandom.c (modified) (6 diffs)
-
test/math/tst_psSpline1D.c (modified) (9 diffs)
-
test/math/tst_psStats07.c (modified) (13 diffs)
-
test/math/tst_psStats09.c (modified) (12 diffs)
-
test/mathtypes/tst_psVector.c (modified) (9 diffs)
-
test/mathtypes/tst_psVectorSort_02.c (modified) (3 diffs)
-
test/mathtypes/verified/tst_psVector.stderr (modified) (4 diffs)
-
test/types/tst_psLookupTable_01.c (modified) (2 diffs)
-
test/types/tst_psMetadataIO.c (modified) (2 diffs)
-
test/types/verified/tst_psMetadataIO.stderr (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astro/psCoord.c
r6445 r6484 10 10 * @author GLG, MHPCC 11 11 * 12 * @version $Revision: 1.11 7$ $Name: not supported by cvs2svn $13 * @date $Date: 2006-02- 17 03:24:46$12 * @version $Revision: 1.118 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2006-02-24 23:43:15 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 760 760 for (psS32 g = 0; g < numCoords; g++) { 761 761 xIn->data.F64[g] = ((psPlane *) source->data[g])->x; 762 xIn->n++; 762 763 yIn->data.F64[g] = ((psPlane *) source->data[g])->y; 764 yIn->n++; 763 765 xOut->data.F64[g] = ((psPlane *) dest->data[g])->x; 766 xOut->n++; 764 767 yOut->data.F64[g] = ((psPlane *) dest->data[g])->y; 768 yOut->n++; 765 769 } 766 770 -
trunk/psLib/src/db/psDB.c
r6296 r6484 12 12 * @author Joshua Hoblitt 13 13 * 14 * @version $Revision: 1.4 6$ $Name: not supported by cvs2svn $15 * @date $Date: 2006-02- 02 04:48:47$14 * @version $Revision: 1.47 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2006-02-24 23:43:15 $ 16 16 * 17 17 * Copyright 2005 Joshua Hoblitt, University of Hawaii … … 381 381 382 382 column = psVectorAlloc(stringColumn->n, type); 383 // column->n = column->nalloc; 383 384 384 385 // conversion functions are a portability issue 385 386 switch (type) { 386 387 case PS_TYPE_S8: 388 column->n = column->nalloc; 387 389 PS_STR_ARRAY_TO_PTYPE(column->data.S8, stringColumn, atoi, psS8, PS_TYPE_S8); 388 390 break; 389 391 case PS_TYPE_S16: 392 column->n = column->nalloc; 390 393 PS_STR_ARRAY_TO_PTYPE(column->data.S16, stringColumn, atoi, psS16, PS_TYPE_S16); 391 394 break; 392 395 case PS_TYPE_S32: 396 column->n = column->nalloc; 393 397 PS_STR_ARRAY_TO_PTYPE(column->data.S32, stringColumn, atoi, psS32, PS_TYPE_S32); 394 398 break; 395 399 case PS_TYPE_S64: 400 column->n = column->nalloc; 396 401 PS_STR_ARRAY_TO_PTYPE(column->data.S64, stringColumn, atoll, psS64, PS_TYPE_S64); 397 402 break; 398 403 case PS_TYPE_U8: 404 column->n = column->nalloc; 399 405 PS_STR_ARRAY_TO_PTYPE(column->data.U8, stringColumn, atoi, psU8, PS_TYPE_U8); 400 406 break; 401 407 case PS_TYPE_U16: 408 column->n = column->nalloc; 402 409 PS_STR_ARRAY_TO_PTYPE(column->data.U16, stringColumn, atoi, psU16, PS_TYPE_U16); 403 410 break; 404 411 case PS_TYPE_U32: 412 column->n = column->nalloc; 405 413 PS_STR_ARRAY_TO_PTYPE(column->data.U32, stringColumn, atoi, psU32, PS_TYPE_U32); 406 414 break; 407 415 case PS_TYPE_U64: 416 column->n = column->nalloc; 408 417 PS_STR_ARRAY_TO_PTYPE(column->data.U64, stringColumn, atoll, psU64, PS_TYPE_U64); 409 418 break; 410 419 case PS_TYPE_F32: 420 column->n = column->nalloc; 411 421 PS_STR_ARRAY_TO_PTYPE(column->data.F32, stringColumn, atof, psF32, PS_TYPE_F32); 412 422 break; 413 423 case PS_TYPE_F64: 424 column->n = column->nalloc; 414 425 PS_STR_ARRAY_TO_PTYPE(column->data.F64, stringColumn, atof, psF64, PS_TYPE_F64); 415 426 break; 416 427 case PS_TYPE_C32: 417 428 // this is a bogus SQL type 429 column->n = column->nalloc; 418 430 PS_STR_ARRAY_TO_PTYPE(column->data.C32, stringColumn, atof, psC32, PS_TYPE_C32); 419 431 break; … … 424 436 case PS_TYPE_BOOL: 425 437 // valid for psVector? 438 column->n = column->nalloc; 426 439 PS_STR_ARRAY_TO_PTYPE(column->data.U8, stringColumn, atoi, psU8, PS_TYPE_U8); 440 break; 441 default: 442 psError(PS_ERR_BAD_PARAMETER_TYPE, true, 443 "Invalid type specified in psDBSelectColumnNum.\n"); 444 psFree(stringColumn); 445 psFree(column); 446 return NULL; 427 447 break; 428 448 } -
trunk/psLib/src/fits/psFitsTable.c
r6445 r6484 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $10 * @date $Date: 2006-02- 17 03:24:46$9 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2006-02-24 23:43:15 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 526 526 527 527 psVector* result = psVectorAlloc(numRows, convertFitsToPsType(typecode)); 528 result->n = numRows; 528 529 529 530 fits_read_col(fits->fd, -
trunk/psLib/src/imageops/psImageGeomManip.c
r6354 r6484 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 19$ $Name: not supported by cvs2svn $13 * @date $Date: 2006-02- 08 01:03:35 $12 * @version $Revision: 1.20 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2006-02-24 23:43:15 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 93 93 } 94 94 maskVec = psVectorAlloc(scale * scale, PS_TYPE_MASK); 95 maskVec->n = maskVec->nalloc; 95 96 maskData = maskVec->data.PS_TYPE_MASK_DATA; 96 97 } -
trunk/psLib/src/imageops/psImagePixelExtract.c
r6294 r6484 8 8 * @author Robert DeSonia, MHPCC 9 9 * 10 * @version $Revision: 1.1 1$ $Name: not supported by cvs2svn $11 * @date $Date: 2006-02- 02 04:41:42$10 * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2006-02-24 23:43:15 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 326 326 // psStats. 327 327 out = psVectorRecycle(out, numCols, PS_TYPE_F64); 328 out->n = numCols; 328 329 if (coords != NULL) { 329 330 coords = psPixelsRealloc(coords, numCols); … … 342 343 maskVec = psVectorAlloc(numRows, mask->type.type); 343 344 } 345 imgVec->n = imgVec->nalloc; 346 maskVec->n = maskVec->nalloc; 344 347 #define PSIMAGE_CUT_VERTICAL(TYPE) \ 345 348 case PS_TYPE_##TYPE: { \ … … 408 411 imgVec = psAlloc(sizeof(psVector)); 409 412 imgVec->type = input->type; 410 411 413 P_PSVECTOR_SET_NALLOC(imgVec,numCols); 412 imgVec->n = numCols;413 414 if (mask != NULL) { 414 415 maskVec = psAlloc(sizeof(psVector)); 415 416 maskVec->type = mask->type; 416 417 P_PSVECTOR_SET_NALLOC(maskVec,numCols); 417 maskVec->n = numCols;418 418 } 419 419 // recycle output to make a proper sized/type output structure … … 421 421 // psStats. 422 422 out = psVectorRecycle(out, numRows, PS_TYPE_F64); 423 out->n = numRows; 424 imgVec->n = imgVec->nalloc; 425 maskVec->n = maskVec->nalloc; 423 426 if (coords != NULL) { 424 427 coords = psPixelsRealloc(coords, numRows); -
trunk/psLib/src/math/psConstants.h
r6437 r6484 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1.8 5$ $Name: not supported by cvs2svn $9 * @date $Date: 2006-02- 17 00:56:48$8 * @version $Revision: 1.86 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-02-24 23:43:15 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 312 312 if (VEC->n != SIZE) { \ 313 313 psError(PS_ERR_BAD_PARAMETER_SIZE, true, \ 314 "psVector %s has size %d, should be %d." \314 "psVector %s has size %d, should be %d.", \ 315 315 #VEC, VEC->n, SIZE); \ 316 316 return(RVAL); \ -
trunk/psLib/src/math/psMinimizeLMM.c
r6346 r6484 10 10 * @author EAM, IfA 11 11 * 12 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $13 * @date $Date: 2006-02- 07 23:14:21$12 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2006-02-24 23:43:15 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 239 239 psF64 ymodel; 240 240 psVector *deriv = psVectorAlloc(params->n, PS_TYPE_F32); 241 deriv->n = deriv->nalloc; 241 242 242 243 // zero alpha and beta for summing below … … 370 371 psVector *Beta = psVectorAlloc(params->n, PS_TYPE_F64); 371 372 psVector *Params = psVectorAlloc(params->n, PS_TYPE_F32); 373 beta->n = beta->nalloc; 374 Beta->n = Beta->nalloc; 375 Params->n = Params->nalloc; 372 376 psVector *dy = NULL; 373 377 psF64 Chisq = 0.0; … … 385 389 param_min = psVectorAlloc(params->n, PS_TYPE_F32); 386 390 param_max = psVectorAlloc(params->n, PS_TYPE_F32); 391 beta_lim->n = beta_lim->nalloc; 392 param_min->n = param_min->nalloc; 393 param_max->n = param_max->nalloc; 387 394 for (int i = 0; i < params->n; i++) { 388 395 beta_lim->data.F32[i] = covar->data.F64[0][i]; … … 402 409 } else { 403 410 dy = psVectorAlloc(y->n, PS_TYPE_F32); 411 dy->n = dy->nalloc; 404 412 psVectorInit(dy, 1.0); 405 413 } -
trunk/psLib/src/math/psMinimizePolyFit.c
r6305 r6484 10 10 * @author EAM, IfA 11 11 * 12 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $13 * @date $Date: 2006-02- 02 21:09:07$12 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2006-02-24 23:43:15 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 44 44 for (psS32 i = 0 ; i < SIZE ; i++) { \ 45 45 VEC->data.F64[i] = ((2.0 / ((psF64) (SIZE - 1))) * ((psF64) i)) - 1.0; \ 46 VEC->n++; \ 46 47 }\ 47 48 } else if (TYPE == PS_TYPE_F32){ \ 48 49 for (psS32 i = 0 ; i < SIZE ; i++) { \ 49 50 VEC->data.F32[i] = ((2.0 / ((psF32) (SIZE - 1))) * ((psF32) i)) - 1.0; \ 51 VEC->n++; \ 50 52 }\ 51 53 }\ … … 87 89 if (sums == NULL) { 88 90 sums = psVectorAlloc(nSum, PS_TYPE_F64); 91 sums->n = sums->nalloc; 89 92 } else if (nSum > sums->n) { 90 93 sums = psVectorRealloc(sums, nSum); 94 sums->n = sums->nalloc; 91 95 } 92 96 … … 305 309 linear equations which can be easily solved. The resulting vector is the 306 310 coefficients of the Chebyshev polys. 307 311 308 312 This method is significantly slower than the standard NR algorithm. It 309 313 was explicitly requested that we not use the NR algorithm. … … 371 375 } 372 376 B->data.F64[i] = ordPoly->coeff[i]; 377 B->n++; 373 378 } 374 379 … … 534 539 // Compute the B vector 535 540 psVector *B = psVectorAlloc(NUM_POLY, PS_TYPE_F64); 541 B->n = B->nalloc; 536 542 for (psS32 i = 0 ; i < NUM_POLY ; i++) { 537 543 B->data.F64[i] = 0.0; … … 780 786 A = psImageAlloc(nTerm, nTerm, PS_TYPE_F64); 781 787 B = psVectorAlloc(nTerm, PS_TYPE_F64); 788 B->n = B->nalloc; 782 789 // Initialize data structures. 783 790 if (!psImageInit(A, 0.0) || !psVectorInit(B, 0.0)) { … … 1045 1052 psVector *fit = NULL; 1046 1053 psVector *resid = psVectorAlloc(f->n, PS_TYPE_F64); 1054 resid->n = resid->nalloc; 1047 1055 1048 1056 // eventual expansion: user supplies one of various stats option pairs, … … 1205 1213 A = psImageAlloc(nTerm, nTerm, PS_TYPE_F64); 1206 1214 B = psVectorAlloc(nTerm, PS_TYPE_F64); 1215 B->n = B->nalloc; 1207 1216 // Initialize data structures. 1208 1217 if (!psImageInit(A, 0.0) || !psVectorInit(B, 0.0)) { … … 1462 1471 } 1463 1472 psVector *resid = psVectorAlloc(f->n, PS_TYPE_F64); 1473 resid->n = resid->nalloc; 1464 1474 1465 1475 // eventual expansion: user supplies one of various stats option pairs, … … 1630 1640 A = psImageAlloc(nTerm, nTerm, PS_TYPE_F64); 1631 1641 B = psVectorAlloc(nTerm, PS_TYPE_F64); 1642 B->n = B->nalloc; 1632 1643 // Initialize data structures. 1633 1644 if (!psImageInit(A, 0.0) || !psVectorInit(B, 0.0)) { … … 2002 2013 psVector *fit = NULL; 2003 2014 psVector *resid = psVectorAlloc(f->n, PS_TYPE_F64); 2015 resid->n = resid->nalloc; 2004 2016 2005 2017 // eventual expansion: user supplies one of various stats option pairs, … … 2174 2186 A = psImageAlloc(nTerm, nTerm, PS_TYPE_F64); 2175 2187 B = psVectorAlloc(nTerm, PS_TYPE_F64); 2188 B->n = B->nalloc; 2176 2189 // Initialize data structures. 2177 2190 if (!psImageInit(A, 0.0) || !psVectorInit(B, 0.0)) { … … 2596 2609 psVector *fit = NULL; 2597 2610 psVector *resid = psVectorAlloc(f->n, PS_TYPE_F64); 2611 resid->n = resid->nalloc; 2598 2612 2599 2613 // eventual expansion: user supplies one of various stats option pairs, -
trunk/psLib/src/math/psMinimizePowell.c
r6449 r6484 11 11 * NOTE: XXX: The SDR is silent about data types. F32 is implemented here. 12 12 * 13 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $14 * @date $Date: 2006-02- 18 00:56:44$13 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2006-02-24 23:43:15 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 525 525 p_psMemSetPersistent(myParamMask, true); 526 526 p_psMemSetPersistent(myParamMask->data.U8, true); 527 for (i=0;i<myParamMask->n ;i++) {527 for (i=0;i<myParamMask->nalloc;i++) { 528 528 myParamMask->data.U8[i] = 0; 529 myParamMask->n++; 529 530 } 530 531 } else { … … 543 544 ((psVector *) (v->data[i]))->data.F32[j] = 0.0; 544 545 } 546 ((psVector *)(v->data[i]))->n++; 545 547 } 546 548 v->n++; … … 550 552 for (i=0;i<numDims;i++) { 551 553 Q->data.F32[i] = params->data.F32[i]; 554 Q->n++; 552 555 } 553 556 … … 595 598 if (myParamMask->data.U8[i] == 0) { 596 599 u->data.F32[i] = Q->data.F32[i] - params->data.F32[i]; 600 u->n++; 597 601 598 602 psTrace(__func__, 6, "u[i]=Q[i]-P[i] (%f = %f - %f)\n", u->data.F32[i], … … 602 606 } else { 603 607 u->data.F32[i] = 0.0; 608 u->n++; 604 609 } 605 610 } -
trunk/psLib/src/math/psPolynomial.c
r6437 r6484 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1.14 3$ $Name: not supported by cvs2svn $10 * @date $Date: 2006-02- 17 00:56:48$9 * @version $Revision: 1.144 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2006-02-24 23:43:15 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 589 589 for (unsigned int i = 0; i < Npts; i++) { 590 590 gauss->data.F32[i] = mean + p_psRandomGaussian(r, sigma); 591 gauss->n++; 591 592 } 592 593 psFree(r); … … 802 803 for (unsigned int i=0;i<x->n;i++) { 803 804 tmp->data.F64[i] = psPolynomial1DEval(poly, x->data.F64[i]); 805 tmp->n++; 804 806 } 805 807 break; … … 808 810 for (unsigned int i=0;i<x->n;i++) { 809 811 tmp->data.F32[i] = psPolynomial1DEval(poly, x->data.F32[i]); 812 tmp->n++; 810 813 } 811 814 break; … … 869 872 for (unsigned int i=0; i<vecLen; i++) { 870 873 tmp->data.F32[i] = psPolynomial2DEval(poly,x->data.F32[i],y->data.F32[i]); 874 tmp->n++; 871 875 } 872 876 break; … … 883 887 for (unsigned int i=0; i<vecLen; i++) { 884 888 tmp->data.F64[i] = psPolynomial2DEval(poly,x->data.F64[i],y->data.F64[i]); 889 tmp->n++; 885 890 } 886 891 break; … … 944 949 // Evaluate polynomial 945 950 // XXX: Consult with IfA: is this how they want to handle multiple data types? 946 if ((x->type.type == PS_TYPE_F32) && (y->type.type == PS_TYPE_F32) && (z->type.type == PS_TYPE_F32)) { 947 for (unsigned int i = 0; i < vecLen; i++) { 948 tmp->data.F64[i] = psPolynomial3DEval(poly, x->data.F32[i], y->data.F32[i], z->data.F32[i]); 949 } 950 } else if ((x->type.type == PS_TYPE_F32) && (y->type.type == PS_TYPE_F32) && (z->type.type == PS_TYPE_F64)) { 951 for (unsigned int i = 0; i < vecLen; i++) { 952 tmp->data.F64[i] = psPolynomial3DEval(poly, x->data.F32[i], y->data.F32[i], z->data.F64[i]); 953 } 954 } else if ((x->type.type == PS_TYPE_F32) && (y->type.type == PS_TYPE_F64) && (z->type.type == PS_TYPE_F32)) { 955 for (unsigned int i = 0; i < vecLen; i++) { 956 tmp->data.F64[i] = psPolynomial3DEval(poly, x->data.F32[i], y->data.F64[i], z->data.F32[i]); 957 } 958 } else if ((x->type.type == PS_TYPE_F32) && (y->type.type == PS_TYPE_F64) && (z->type.type == PS_TYPE_F64)) { 959 for (unsigned int i = 0; i < vecLen; i++) { 960 tmp->data.F64[i] = psPolynomial3DEval(poly, x->data.F32[i], y->data.F64[i], z->data.F64[i]); 961 } 962 } else if ((x->type.type == PS_TYPE_F64) && (y->type.type == PS_TYPE_F32) && (z->type.type == PS_TYPE_F32)) { 963 for (unsigned int i = 0; i < vecLen; i++) { 964 tmp->data.F64[i] = psPolynomial3DEval(poly, x->data.F64[i], y->data.F32[i], z->data.F32[i]); 965 } 966 } else if ((x->type.type == PS_TYPE_F64) && (y->type.type == PS_TYPE_F32) && (z->type.type == PS_TYPE_F64)) { 967 for (unsigned int i = 0; i < vecLen; i++) { 968 tmp->data.F64[i] = psPolynomial3DEval(poly, x->data.F64[i], y->data.F32[i], z->data.F64[i]); 969 } 970 } else if ((x->type.type == PS_TYPE_F64) && (y->type.type == PS_TYPE_F64) && (z->type.type == PS_TYPE_F32)) { 971 for (unsigned int i = 0; i < vecLen; i++) { 972 tmp->data.F64[i] = psPolynomial3DEval(poly, x->data.F64[i], y->data.F64[i], z->data.F32[i]); 973 } 974 } else if ((x->type.type == PS_TYPE_F64) && (y->type.type == PS_TYPE_F64) && (z->type.type == PS_TYPE_F64)) { 975 for (unsigned int i = 0; i < vecLen; i++) { 976 tmp->data.F64[i] = psPolynomial3DEval(poly, x->data.F64[i], y->data.F64[i], z->data.F64[i]); 951 if ((x->type.type == PS_TYPE_F32) && (y->type.type == PS_TYPE_F32) 952 && (z->type.type == PS_TYPE_F32)) { 953 for (unsigned int i = 0; i < vecLen; i++) { 954 tmp->data.F64[i] = psPolynomial3DEval(poly, x->data.F32[i], 955 y->data.F32[i], z->data.F32[i]); 956 tmp->n++; 957 } 958 } else if ((x->type.type == PS_TYPE_F32) && (y->type.type == PS_TYPE_F32) 959 && (z->type.type == PS_TYPE_F64)) { 960 for (unsigned int i = 0; i < vecLen; i++) { 961 tmp->data.F64[i] = psPolynomial3DEval(poly, x->data.F32[i], 962 y->data.F32[i], z->data.F64[i]); 963 tmp->n++; 964 } 965 } else if ((x->type.type == PS_TYPE_F32) && (y->type.type == PS_TYPE_F64) 966 && (z->type.type == PS_TYPE_F32)) { 967 for (unsigned int i = 0; i < vecLen; i++) { 968 tmp->data.F64[i] = psPolynomial3DEval(poly, x->data.F32[i], 969 y->data.F64[i], z->data.F32[i]); 970 tmp->n++; 971 } 972 } else if ((x->type.type == PS_TYPE_F32) && (y->type.type == PS_TYPE_F64) 973 && (z->type.type == PS_TYPE_F64)) { 974 for (unsigned int i = 0; i < vecLen; i++) { 975 tmp->data.F64[i] = psPolynomial3DEval(poly, x->data.F32[i], 976 y->data.F64[i], z->data.F64[i]); 977 tmp->n++; 978 } 979 } else if ((x->type.type == PS_TYPE_F64) && (y->type.type == PS_TYPE_F32) 980 && (z->type.type == PS_TYPE_F32)) { 981 for (unsigned int i = 0; i < vecLen; i++) { 982 tmp->data.F64[i] = psPolynomial3DEval(poly, x->data.F64[i], 983 y->data.F32[i], z->data.F32[i]); 984 tmp->n++; 985 } 986 } else if ((x->type.type == PS_TYPE_F64) && (y->type.type == PS_TYPE_F32) 987 && (z->type.type == PS_TYPE_F64)) { 988 for (unsigned int i = 0; i < vecLen; i++) { 989 tmp->data.F64[i] = psPolynomial3DEval(poly, x->data.F64[i], 990 y->data.F32[i], z->data.F64[i]); 991 tmp->n++; 992 } 993 } else if ((x->type.type == PS_TYPE_F64) && (y->type.type == PS_TYPE_F64) 994 && (z->type.type == PS_TYPE_F32)) { 995 for (unsigned int i = 0; i < vecLen; i++) { 996 tmp->data.F64[i] = psPolynomial3DEval(poly, x->data.F64[i], 997 y->data.F64[i], z->data.F32[i]); 998 tmp->n++; 999 } 1000 } else if ((x->type.type == PS_TYPE_F64) && (y->type.type == PS_TYPE_F64) 1001 && (z->type.type == PS_TYPE_F64)) { 1002 for (unsigned int i = 0; i < vecLen; i++) { 1003 tmp->data.F64[i] = psPolynomial3DEval(poly, x->data.F64[i], 1004 y->data.F64[i], z->data.F64[i]); 1005 tmp->n++; 977 1006 } 978 1007 } … … 1040 1069 // Evaluate polynomial 1041 1070 // XXX: Consult with IfA: is this how they want to handle multiple data types? 1042 if ((x->type.type == PS_TYPE_F32) && (y->type.type == PS_TYPE_F32) && (z->type.type == PS_TYPE_F32) && (t->type.type == PS_TYPE_F32)) { 1043 for (unsigned int i = 0; i < vecLen; i++) { 1044 tmp->data.F64[i] = psPolynomial4DEval(poly, x->data.F32[i], y->data.F32[i], z->data.F32[i], t->data.F32[i]); 1045 } 1046 } else if ((x->type.type == PS_TYPE_F32) && (y->type.type == PS_TYPE_F32) && (z->type.type == PS_TYPE_F32) && (t->type.type == PS_TYPE_F64)) { 1047 for (unsigned int i = 0; i < vecLen; i++) { 1048 tmp->data.F64[i] = psPolynomial4DEval(poly, x->data.F32[i], y->data.F32[i], z->data.F32[i], t->data.F64[i]); 1049 } 1050 } else if ((x->type.type == PS_TYPE_F32) && (y->type.type == PS_TYPE_F32) && (z->type.type == PS_TYPE_F64) && (t->type.type == PS_TYPE_F32)) { 1051 for (unsigned int i = 0; i < vecLen; i++) { 1052 tmp->data.F64[i] = psPolynomial4DEval(poly, x->data.F32[i], y->data.F32[i], z->data.F64[i], t->data.F32[i]); 1053 } 1054 } else if ((x->type.type == PS_TYPE_F32) && (y->type.type == PS_TYPE_F32) && (z->type.type == PS_TYPE_F64) && (t->type.type == PS_TYPE_F64)) { 1055 for (unsigned int i = 0; i < vecLen; i++) { 1056 tmp->data.F64[i] = psPolynomial4DEval(poly, x->data.F32[i], y->data.F32[i], z->data.F64[i], t->data.F64[i]); 1057 } 1058 } else if ((x->type.type == PS_TYPE_F32) && (y->type.type == PS_TYPE_F64) && (z->type.type == PS_TYPE_F32) && (t->type.type == PS_TYPE_F32)) { 1059 for (unsigned int i = 0; i < vecLen; i++) { 1060 tmp->data.F64[i] = psPolynomial4DEval(poly, x->data.F32[i], y->data.F64[i], z->data.F32[i], t->data.F32[i]); 1061 } 1062 } else if ((x->type.type == PS_TYPE_F32) && (y->type.type == PS_TYPE_F64) && (z->type.type == PS_TYPE_F32) && (t->type.type == PS_TYPE_F64)) { 1063 for (unsigned int i = 0; i < vecLen; i++) { 1064 tmp->data.F64[i] = psPolynomial4DEval(poly, x->data.F32[i], y->data.F64[i], z->data.F32[i], t->data.F64[i]); 1065 } 1066 } else if ((x->type.type == PS_TYPE_F32) && (y->type.type == PS_TYPE_F64) && (z->type.type == PS_TYPE_F64) && (t->type.type == PS_TYPE_F32)) { 1067 for (unsigned int i = 0; i < vecLen; i++) { 1068 tmp->data.F64[i] = psPolynomial4DEval(poly, x->data.F32[i], y->data.F64[i], z->data.F64[i], t->data.F32[i]); 1069 } 1070 } else if ((x->type.type == PS_TYPE_F32) && (y->type.type == PS_TYPE_F64) && (z->type.type == PS_TYPE_F64) && (t->type.type == PS_TYPE_F64)) { 1071 for (unsigned int i = 0; i < vecLen; i++) { 1072 tmp->data.F64[i] = psPolynomial4DEval(poly, x->data.F32[i], y->data.F64[i], z->data.F64[i], t->data.F64[i]); 1073 } 1074 } else if ((x->type.type == PS_TYPE_F64) && (y->type.type == PS_TYPE_F32) && (z->type.type == PS_TYPE_F32) && (t->type.type == PS_TYPE_F32)) { 1075 for (unsigned int i = 0; i < vecLen; i++) { 1076 tmp->data.F64[i] = psPolynomial4DEval(poly, x->data.F64[i], y->data.F32[i], z->data.F32[i], t->data.F32[i]); 1077 } 1078 } else if ((x->type.type == PS_TYPE_F64) && (y->type.type == PS_TYPE_F32) && (z->type.type == PS_TYPE_F32) && (t->type.type == PS_TYPE_F64)) { 1079 for (unsigned int i = 0; i < vecLen; i++) { 1080 tmp->data.F64[i] = psPolynomial4DEval(poly, x->data.F64[i], y->data.F32[i], z->data.F32[i], t->data.F64[i]); 1081 } 1082 } else if ((x->type.type == PS_TYPE_F64) && (y->type.type == PS_TYPE_F32) && (z->type.type == PS_TYPE_F64) && (t->type.type == PS_TYPE_F32)) { 1083 for (unsigned int i = 0; i < vecLen; i++) { 1084 tmp->data.F64[i] = psPolynomial4DEval(poly, x->data.F64[i], y->data.F32[i], z->data.F64[i], t->data.F32[i]); 1085 } 1086 } else if ((x->type.type == PS_TYPE_F64) && (y->type.type == PS_TYPE_F32) && (z->type.type == PS_TYPE_F64) && (t->type.type == PS_TYPE_F64)) { 1087 for (unsigned int i = 0; i < vecLen; i++) { 1088 tmp->data.F64[i] = psPolynomial4DEval(poly, x->data.F64[i], y->data.F32[i], z->data.F64[i], t->data.F64[i]); 1089 } 1090 } else if ((x->type.type == PS_TYPE_F64) && (y->type.type == PS_TYPE_F64) && (z->type.type == PS_TYPE_F32) && (t->type.type == PS_TYPE_F32)) { 1091 for (unsigned int i = 0; i < vecLen; i++) { 1092 tmp->data.F64[i] = psPolynomial4DEval(poly, x->data.F64[i], y->data.F64[i], z->data.F32[i], t->data.F32[i]); 1093 } 1094 } else if ((x->type.type == PS_TYPE_F64) && (y->type.type == PS_TYPE_F64) && (z->type.type == PS_TYPE_F32) && (t->type.type == PS_TYPE_F64)) { 1095 for (unsigned int i = 0; i < vecLen; i++) { 1096 tmp->data.F64[i] = psPolynomial4DEval(poly, x->data.F64[i], y->data.F64[i], z->data.F32[i], t->data.F64[i]); 1097 } 1098 } else if ((x->type.type == PS_TYPE_F64) && (y->type.type == PS_TYPE_F64) && (z->type.type == PS_TYPE_F64) && (t->type.type == PS_TYPE_F32)) { 1099 for (unsigned int i = 0; i < vecLen; i++) { 1100 tmp->data.F64[i] = psPolynomial4DEval(poly, x->data.F64[i], y->data.F64[i], z->data.F64[i], t->data.F32[i]); 1101 } 1102 } else if ((x->type.type == PS_TYPE_F64) && (y->type.type == PS_TYPE_F64) && (z->type.type == PS_TYPE_F64) && (t->type.type == PS_TYPE_F64)) { 1103 for (unsigned int i = 0; i < vecLen; i++) { 1104 tmp->data.F64[i] = psPolynomial4DEval(poly, x->data.F64[i], y->data.F64[i], z->data.F64[i], 1071 if ((x->type.type == PS_TYPE_F32) && (y->type.type == PS_TYPE_F32) 1072 && (z->type.type == PS_TYPE_F32) && (t->type.type == PS_TYPE_F32)) { 1073 for (unsigned int i = 0; i < vecLen; i++) { 1074 tmp->data.F64[i] = psPolynomial4DEval(poly, x->data.F32[i], 1075 y->data.F32[i], z->data.F32[i], t->data.F32[i]); 1076 tmp->n++; 1077 } 1078 } else if ((x->type.type == PS_TYPE_F32) && (y->type.type == PS_TYPE_F32) 1079 && (z->type.type == PS_TYPE_F32) && (t->type.type == PS_TYPE_F64)) { 1080 for (unsigned int i = 0; i < vecLen; i++) { 1081 tmp->data.F64[i] = psPolynomial4DEval(poly, x->data.F32[i], 1082 y->data.F32[i], z->data.F32[i], t->data.F64[i]); 1083 tmp->n++; 1084 } 1085 } else if ((x->type.type == PS_TYPE_F32) && (y->type.type == PS_TYPE_F32) 1086 && (z->type.type == PS_TYPE_F64) && (t->type.type == PS_TYPE_F32)) { 1087 for (unsigned int i = 0; i < vecLen; i++) { 1088 tmp->data.F64[i] = psPolynomial4DEval(poly, x->data.F32[i], 1089 y->data.F32[i], z->data.F64[i], t->data.F32[i]); 1090 tmp->n++; 1091 } 1092 } else if ((x->type.type == PS_TYPE_F32) && (y->type.type == PS_TYPE_F32) 1093 && (z->type.type == PS_TYPE_F64) && (t->type.type == PS_TYPE_F64)) { 1094 for (unsigned int i = 0; i < vecLen; i++) { 1095 tmp->data.F64[i] = psPolynomial4DEval(poly, x->data.F32[i], 1096 y->data.F32[i], z->data.F64[i], t->data.F64[i]); 1097 tmp->n++; 1098 } 1099 } else if ((x->type.type == PS_TYPE_F32) && (y->type.type == PS_TYPE_F64) 1100 && (z->type.type == PS_TYPE_F32) && (t->type.type == PS_TYPE_F32)) { 1101 for (unsigned int i = 0; i < vecLen; i++) { 1102 tmp->data.F64[i] = psPolynomial4DEval(poly, x->data.F32[i], 1103 y->data.F64[i], z->data.F32[i], t->data.F32[i]); 1104 tmp->n++; 1105 } 1106 } else if ((x->type.type == PS_TYPE_F32) && (y->type.type == PS_TYPE_F64) 1107 && (z->type.type == PS_TYPE_F32) && (t->type.type == PS_TYPE_F64)) { 1108 for (unsigned int i = 0; i < vecLen; i++) { 1109 tmp->data.F64[i] = psPolynomial4DEval(poly, x->data.F32[i], 1110 y->data.F64[i], z->data.F32[i], t->data.F64[i]); 1111 tmp->n++; 1112 } 1113 } else if ((x->type.type == PS_TYPE_F32) && (y->type.type == PS_TYPE_F64) 1114 && (z->type.type == PS_TYPE_F64) && (t->type.type == PS_TYPE_F32)) { 1115 for (unsigned int i = 0; i < vecLen; i++) { 1116 tmp->data.F64[i] = psPolynomial4DEval(poly, x->data.F32[i], 1117 y->data.F64[i], z->data.F64[i], t->data.F32[i]); 1118 tmp->n++; 1119 } 1120 } else if ((x->type.type == PS_TYPE_F32) && (y->type.type == PS_TYPE_F64) 1121 && (z->type.type == PS_TYPE_F64) && (t->type.type == PS_TYPE_F64)) { 1122 for (unsigned int i = 0; i < vecLen; i++) { 1123 tmp->data.F64[i] = psPolynomial4DEval(poly, x->data.F32[i], 1124 y->data.F64[i], z->data.F64[i], t->data.F64[i]); 1125 tmp->n++; 1126 } 1127 } else if ((x->type.type == PS_TYPE_F64) && (y->type.type == PS_TYPE_F32) 1128 && (z->type.type == PS_TYPE_F32) && (t->type.type == PS_TYPE_F32)) { 1129 for (unsigned int i = 0; i < vecLen; i++) { 1130 tmp->data.F64[i] = psPolynomial4DEval(poly, x->data.F64[i], 1131 y->data.F32[i], z->data.F32[i], t->data.F32[i]); 1132 tmp->n++; 1133 } 1134 } else if ((x->type.type == PS_TYPE_F64) && (y->type.type == PS_TYPE_F32) 1135 && (z->type.type == PS_TYPE_F32) && (t->type.type == PS_TYPE_F64)) { 1136 for (unsigned int i = 0; i < vecLen; i++) { 1137 tmp->data.F64[i] = psPolynomial4DEval(poly, x->data.F64[i], 1138 y->data.F32[i], z->data.F32[i], t->data.F64[i]); 1139 tmp->n++; 1140 } 1141 } else if ((x->type.type == PS_TYPE_F64) && (y->type.type == PS_TYPE_F32) 1142 && (z->type.type == PS_TYPE_F64) && (t->type.type == PS_TYPE_F32)) { 1143 for (unsigned int i = 0; i < vecLen; i++) { 1144 tmp->data.F64[i] = psPolynomial4DEval(poly, x->data.F64[i], 1145 y->data.F32[i], z->data.F64[i], t->data.F32[i]); 1146 tmp->n++; 1147 } 1148 } else if ((x->type.type == PS_TYPE_F64) && (y->type.type == PS_TYPE_F32) 1149 && (z->type.type == PS_TYPE_F64) && (t->type.type == PS_TYPE_F64)) { 1150 for (unsigned int i = 0; i < vecLen; i++) { 1151 tmp->data.F64[i] = psPolynomial4DEval(poly, x->data.F64[i], 1152 y->data.F32[i], z->data.F64[i], t->data.F64[i]); 1153 tmp->n++; 1154 } 1155 } else if ((x->type.type == PS_TYPE_F64) && (y->type.type == PS_TYPE_F64) 1156 && (z->type.type == PS_TYPE_F32) && (t->type.type == PS_TYPE_F32)) { 1157 for (unsigned int i = 0; i < vecLen; i++) { 1158 tmp->data.F64[i] = psPolynomial4DEval(poly, x->data.F64[i], 1159 y->data.F64[i], z->data.F32[i], t->data.F32[i]); 1160 tmp->n++; 1161 } 1162 } else if ((x->type.type == PS_TYPE_F64) && (y->type.type == PS_TYPE_F64) 1163 && (z->type.type == PS_TYPE_F32) && (t->type.type == PS_TYPE_F64)) { 1164 for (unsigned int i = 0; i < vecLen; i++) { 1165 tmp->data.F64[i] = psPolynomial4DEval(poly, x->data.F64[i], 1166 y->data.F64[i], z->data.F32[i], t->data.F64[i]); 1167 tmp->n++; 1168 } 1169 } else if ((x->type.type == PS_TYPE_F64) && (y->type.type == PS_TYPE_F64) 1170 && (z->type.type == PS_TYPE_F64) && (t->type.type == PS_TYPE_F32)) { 1171 for (unsigned int i = 0; i < vecLen; i++) { 1172 tmp->data.F64[i] = psPolynomial4DEval(poly, x->data.F64[i], 1173 y->data.F64[i], z->data.F64[i], t->data.F32[i]); 1174 tmp->n++; 1175 } 1176 } else if ((x->type.type == PS_TYPE_F64) && (y->type.type == PS_TYPE_F64) 1177 && (z->type.type == PS_TYPE_F64) && (t->type.type == PS_TYPE_F64)) { 1178 for (unsigned int i = 0; i < vecLen; i++) { 1179 tmp->data.F64[i] = psPolynomial4DEval(poly, x->data.F64[i], 1180 y->data.F64[i], z->data.F64[i], 1105 1181 t->data.F64[i]); 1182 tmp->n++; 1106 1183 } 1107 1184 } -
trunk/psLib/src/math/psSpline.c
r6437 r6484 1 1 /** @file psSpline.c 2 2 * 3 * @brief Contains basic spline allocation, deallocation, fitting, 3 * @brief Contains basic spline allocation, deallocation, fitting, 4 4 * and evaluation routines. 5 5 * 6 6 * This file contains the routines that allocate, free, and evaluate splines. 7 7 * 8 * @version $Revision: 1.13 6$ $Name: not supported by cvs2svn $9 * @date $Date: 2006-02- 17 00:56:48$8 * @version $Revision: 1.137 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-02-24 23:43:15 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 239 239 for (psS32 i = 0 ; i < x->n ; i++) { 240 240 spline->knots->data.F32[i] = x->data.F32[i]; 241 spline->knots->n++; 241 242 } 242 243 } else if (x->type.type == PS_TYPE_F64) { 243 244 for (psS32 i = 0 ; i < x->n ; i++) { 244 245 spline->knots->data.F32[i] = (psF32) x->data.F64[i]; 246 spline->knots->n++; 245 247 } 246 248 } … … 248 250 for (psS32 i = 0 ; i < y->n ; i++) { 249 251 spline->knots->data.F32[i] = (psF32) i; 252 spline->knots->n++; 250 253 } 251 254 } … … 412 415 for (psS32 i=0;i<x->n;i++) { 413 416 tmpVector->data.F32[i] = psSpline1DEval(spline, x->data.F32[i]); 417 tmpVector->n++; 414 418 } 415 419 } else if (x->type.type == PS_TYPE_F64) { 416 420 for (psS32 i=0;i<x->n;i++) { 417 421 tmpVector->data.F32[i] = psSpline1DEval(spline, (psF32) x->data.F64[i]); 422 tmpVector->n++; 418 423 } 419 424 } -
trunk/psLib/src/math/psStats.c
r6449 r6484 16 16 * use ->min and ->max (PS_STAT_USE_RANGE) 17 17 * 18 * @version $Revision: 1.1 69$ $Name: not supported by cvs2svn $19 * @date $Date: 2006-02- 18 00:56:44$18 * @version $Revision: 1.170 $ $Name: not supported by cvs2svn $ 19 * @date $Date: 2006-02-24 23:43:15 $ 20 20 * 21 21 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 569 569 // Allocate temporary vectors for the data. 570 570 unsortedVector = psVectorAlloc(nValues, PS_TYPE_F32); 571 unsortedVector->n = nValues; 571 572 572 573 // Determine if we must only use data points within a min/max range. … … 657 658 psS32 numBins = histogram->nums->n; 658 659 psVector *smooth = psVectorAlloc(numBins, PS_TYPE_F32); 660 smooth->n = smooth->nalloc; 659 661 psS32 jMin = 0; 660 662 psS32 jMax = 0; … … 783 785 // Allocate temporary vectors for the data. 784 786 unsortedVector = psVectorAlloc(nValues, PS_TYPE_F32); 787 unsortedVector->n = unsortedVector->nalloc; 785 788 786 789 if (stats->options & PS_STAT_USE_RANGE) { … … 1037 1040 // However, we do no want to modify the original mask vector. 1038 1041 tmpMask = psVectorAlloc(myVector->n, PS_TYPE_U8); 1042 tmpMask->n = tmpMask->nalloc; 1039 1043 1040 1044 // If we were called with a mask vector, then initialize the temporary … … 1198 1202 psVector *x = psVectorAlloc(3, PS_TYPE_F64); 1199 1203 psVector *y = psVectorAlloc(3, PS_TYPE_F64); 1204 x->n = 3; 1205 y->n = 3; 1200 1206 psF32 tmpFloat = 0.0f; 1201 1207 … … 1313 1319 if (deriv == NULL) { 1314 1320 deriv = psVectorAlloc(2, PS_TYPE_F32); 1321 deriv->n = 2; 1315 1322 } else { 1316 1323 PS_ASSERT_VECTOR_SIZE(deriv, 2, NAN); … … 1365 1372 psS32 rcBool = false; 1366 1373 psVector *tmpMaskVec = psVectorAlloc(myVector->n, PS_TYPE_U8); 1374 tmpMaskVec->n = tmpMaskVec->nalloc; 1367 1375 if (maskVector != NULL) { 1368 1376 for (psS32 i = 0 ; i < myVector->n ; i++) { … … 1850 1858 psArray *x = psArrayAlloc((1 + (binMax - binMin))); 1851 1859 psS32 j = 0; 1860 y->n = y->nalloc; 1852 1861 1853 1862 for (psS32 i = binMin ; i <= binMax ; i++) { … … 1856 1865 x->n++; 1857 1866 ((psVector *) x->data[j])->data.F32[0] = PS_BIN_MIDPOINT(newHistogram, i); 1867 ((psVector *) x->data[j])->n++; 1858 1868 j++; 1859 1869 } … … 1886 1896 psMinimization *min = psMinimizationAlloc(100, 0.01); 1887 1897 psVector *params = psVectorAlloc(2, PS_TYPE_F32); 1898 params->n = params->nalloc; 1888 1899 // Initial guess for the mean ([0]) and standard dev. 1889 1900 params->data.F32[0] = stats->robustMedian; … … 2049 2060 // Allocate the bins, and initialize them to zero. 2050 2061 newHist->nums = psVectorAlloc(n, PS_TYPE_F32); 2051 for (i = 0; i < newHist->nums->n ; i++) {2062 for (i = 0; i < newHist->nums->nalloc; i++) { 2052 2063 newHist->nums->data.F32[i] = 0.0; 2064 newHist->nums->n++; 2053 2065 } 2054 2066 … … 2094 2106 // then there are N-1 bins. 2095 2107 newHist->nums = psVectorAlloc((bounds->n) - 1, PS_TYPE_F32); 2096 for (i = 0; i < newHist->nums->n ; i++) {2108 for (i = 0; i < newHist->nums->nalloc; i++) { 2097 2109 newHist->nums->data.F32[i] = 0.0; 2110 newHist->nums->n++; 2098 2111 } 2099 2112 … … 2366 2379 for (i = 0; i < in->n; i++) { 2367 2380 tmp->data.F32[i] = (psF32)in->data.S8[i]; 2381 tmp->n++; 2368 2382 } 2369 2383 } else if (in->type.type == PS_TYPE_S16) { … … 2371 2385 for (i = 0; i < in->n; i++) { 2372 2386 tmp->data.F32[i] = (psF32) in->data.S16[i]; 2387 tmp->n++; 2373 2388 } 2374 2389 } else if (in->type.type == PS_TYPE_S32) { … … 2376 2391 for (i = 0; i < in->n; i++) { 2377 2392 tmp->data.F32[i] = (psF32)in->data.S32[i]; 2393 tmp->n++; 2378 2394 } 2379 2395 } else if (in->type.type == PS_TYPE_S64) { … … 2381 2397 for (i = 0; i < in->n; i++) { 2382 2398 tmp->data.F32[i] = (psF32)in->data.S64[i]; 2399 tmp->n++; 2383 2400 } 2384 2401 } else if (in->type.type == PS_TYPE_U8) { … … 2386 2403 for (i = 0; i < in->n; i++) { 2387 2404 tmp->data.F32[i] = (psF32)in->data.U8[i]; 2405 tmp->n++; 2388 2406 } 2389 2407 } else if (in->type.type == PS_TYPE_U16) { … … 2391 2409 for (i = 0; i < in->n; i++) { 2392 2410 tmp->data.F32[i] = (psF32)in->data.U16[i]; 2411 tmp->n++; 2393 2412 } 2394 2413 } else if (in->type.type == PS_TYPE_U32) { … … 2396 2415 for (i = 0; i < in->n; i++) { 2397 2416 tmp->data.F32[i] = (psF32)in->data.U32[i]; 2417 tmp->n++; 2398 2418 } 2399 2419 } else if (in->type.type == PS_TYPE_U64) { … … 2401 2421 for (i = 0; i < in->n; i++) { 2402 2422 tmp->data.F32[i] = (psF32)in->data.U64[i]; 2423 tmp->n++; 2403 2424 } 2404 2425 } else if (in->type.type == PS_TYPE_F64) { … … 2406 2427 for (i = 0; i < in->n; i++) { 2407 2428 tmp->data.F32[i] = (psF32)in->data.F64[i]; 2429 tmp->n++; 2408 2430 } 2409 2431 } else if (in->type.type == PS_TYPE_F32) { … … 2463 2485 inF32 = p_psConvertToF32((psVector *) in); 2464 2486 if (inF32 == NULL) { 2465 inF32 = (psVector *) in; 2466 mustFreeVectorIn = 0; 2467 } 2487 // printf("\n\ninF32 is NULL\n\n"); 2488 // inF32 = (psVector *) in; 2489 // mustFreeVectorIn = 0; 2490 inF32 = psVectorCopy(inF32, in, PS_TYPE_F32); 2491 inF32->n = inF32->nalloc; 2492 mustFreeVectorIn = 1; 2493 } 2494 // else printf("\ninF32 has n=%ld, nalloc=%ld\n", inF32->n, inF32->nalloc); 2468 2495 errorsF32 = p_psConvertToF32((psVector *) errors); 2469 2496 if (errorsF32 == NULL) { … … 2471 2498 mustFreeVectorErrors = 0; 2472 2499 } 2473 2500 // inF32->n = inF32->nalloc; 2501 // errorsF32->n = errorsF32->nalloc; 2474 2502 if ((stats->options & PS_STAT_USE_RANGE) && (stats->min >= stats->max)) { 2475 2503 PS_ASSERT_FLOAT_LARGER_THAN_OR_EQUAL(stats->max, stats->min, stats); -
trunk/psLib/src/mathtypes/psVector.c
r6227 r6484 9 9 * @author Robert DeSonia, MHPCC 10 10 * 11 * @version $Revision: 1.6 4$ $Name: not supported by cvs2svn $12 * @date $Date: 2006-0 1-28 01:12:14$11 * @version $Revision: 1.65 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2006-02-24 23:43:15 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 88 88 psVec->type.type = type; 89 89 P_PSVECTOR_SET_NALLOC(psVec,nalloc); 90 psVec->n = nalloc; 90 // psVec->n = nalloc; 91 psVec->n = 0; 91 92 92 93 // Create vector data array … … 205 206 206 207 output = psVectorRecycle(output, nElements, type); 208 output->n = nElements; 207 209 208 210 #define PSVECTOR_COPY(INTYPE,OUTTYPE) { \ … … 754 756 int nBin = (upper - lower) / delta; \ 755 757 psVector *vec = psVectorRecycle(input, nBin, PS_TYPE_##TYPE); \ 758 vec->n = nBin; \ 756 759 for (int i = 0; i < nBin; i++) \ 757 760 { \ -
trunk/psLib/src/types/psArray.c
r6445 r6484 9 9 * @author Ross Harman, MHPCC 10 10 * 11 * @version $Revision: 1.4 1$ $Name: not supported by cvs2svn $12 * @date $Date: 2006-02- 17 03:24:46$11 * @version $Revision: 1.42 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2006-02-24 23:43:15 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 64 64 65 65 P_PSARRAY_SET_NALLOC(psArr,nalloc); 66 psArr->n = 0; 67 // psArr->n = nalloc; 66 psArr->n = 0; //set the initial number of elements in use to 0 68 67 // Create vector data array 69 68 psArr->data = psAlloc(nalloc * sizeof(psPtr)); 69 memset(psArr->data, 0, sizeof(void*) * nalloc); //set the initial values of data to NULL 70 70 71 71 return psArr; … … 86 86 } 87 87 // Realloc after decrementation to avoid accessing freed array elements 88 long n = in->n; 88 89 in->data = psRealloc(in->data, nalloc * sizeof(psPtr)); 89 90 P_PSARRAY_SET_NALLOC(in,nalloc); 91 for (long m = n; m < nalloc; m++) { //if array is grown, set grown data to NULL 92 in->data[m] = NULL; 93 } 90 94 } 91 95 -
trunk/psLib/src/types/psLookupTable.c
r6445 r6484 7 7 * @author Ross Harman, MHPCC 8 8 * 9 * @version $Revision: 1. 29$ $Name: not supported by cvs2svn $10 * @date $Date: 2006-02- 17 03:24:46$9 * @version $Revision: 1.30 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2006-02-24 23:43:15 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii … … 600 600 // Check if array is sorted on the index column 601 601 psVector* sortedIndex = psVectorAlloc(numRows,PS_TYPE_U32); 602 sortedIndex->n = numRows; 602 603 sortedIndex = psVectorSortIndex(sortedIndex,indexColumnVector); 603 604 for(psS32 i = 0; i < numRows; i++ ) { … … 615 616 psS32 type = ((psVector*)(vectors->data[j]))->type.type; 616 617 newValueArray->data[j] = psVectorAlloc(numRows,type); 618 ((psVector*)(newValueArray->data[j]))->n = numRows; 617 619 newValueArray->n++; 618 620 } -
trunk/psLib/src/types/psMetadataConfig.c
r6191 r6484 10 10 * @author Eric Van Alst, MHPCC 11 11 * 12 * @version $Revision: 1.5 2$ $Name: not supported by cvs2svn $13 * @date $Date: 2006-0 1-25 22:33:41$12 * @version $Revision: 1.53 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2006-02-24 23:43:15 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 363 363 elemType); 364 364 } 365 365 vec->n++; 366 366 while(*end==' ' || *end==',') { 367 367 end++; -
trunk/psLib/test/db/verified/tst_psDB.stderr
r4581 r6484 146 146 <DATE><TIME>|<HOST>|E|psVectorAlloc (FILE:LINENO) 147 147 Input psVector is an unsupported type (0x0). 148 <DATE><TIME>|<HOST>|E|psDBSelectColumnNum (FILE:LINENO) 149 Invalid type specified in psDBSelectColumnNum. 148 150 149 151 ---> TESTPOINT PASSED (psDB{dbSelectColumnNum} | tst_psDB.c) -
trunk/psLib/test/fits/tst_psFits.c
r6445 r6484 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.1 7$ $Name: not supported by cvs2svn $9 * @date $Date: 2006-02- 17 03:24:46$8 * @version $Revision: 1.18 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-02-24 23:43:15 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 198 198 for (int x=0; x < 4; x++) { 199 199 vec->data.S32[x] = x*10+row; 200 vec->n++; 200 201 } 201 202 psMetadataAdd(header,PS_LIST_TAIL, "MYVEC", -
trunk/psLib/test/imageops/tst_psImageConvolve.c
r4547 r6484 5 5 * @author Robert DeSonia, MHPCC 6 6 * 7 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $8 * @date $Date: 200 5-07-13 02:47:00$7 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2006-02-24 23:43:15 $ 9 9 * 10 10 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 129 129 for (psS32 i = 0; i < size; i++) { 130 130 xVec->data.U32[i] = x[i]; 131 xVec->n++; 131 132 yVec->data.U32[i] = y[i]; 133 yVec->n++; 132 134 tVec->data.U32[i] = t[i]; 135 tVec->n++; 133 136 } 134 137 … … 186 189 for (psS32 i = 0; i < size; i++) { 187 190 xVec->data.S16[i] = x[i]; 191 xVec->n++; 188 192 yVec->data.S16[i] = y[i]; 193 yVec->n++; 189 194 tVec->data.S16[i] = t[i]; 195 tVec->n++; 190 196 } 191 197 … … 242 248 243 249 for (psS32 i = 0; i < size; i++) { 244 xVec->data.F32[i] = x[i]+0.1; 250 // xVec->data.F32[i] = x[i]+0.1; 251 // xVec->n++; 252 psVectorSet(xVec, i, x[i]+0.1); 245 253 yVec->data.F32[i] = y[i]+0.2; 254 yVec->n++; 246 255 tVec->data.F32[i] = t[i]+0.3; 256 tVec->n++; 247 257 } 248 258 -
trunk/psLib/test/imageops/tst_psImagePixelExtract.c
r6294 r6484 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $9 * @date $Date: 2006-02- 02 04:41:45 $8 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-02-24 23:43:15 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 532 532 for (psS32 i=0; i < 10; i++) { 533 533 radii->data.F32[i] = 10+i*10; 534 radii->n++; 534 535 } 535 536 -
trunk/psLib/test/imageops/verified/tst_psImagePixelExtract.stderr
r5641 r6484 138 138 Following should be an error. 139 139 <DATE><TIME>|<HOST>|E|psImageRadialCut (FILE:LINENO) 140 Input radii vector size, 1, can not be less than 2.140 Input radii vector size, 0, can not be less than 2. 141 141 <DATE><TIME>|<HOST>|I|testImageRadialCut 142 142 Following should be an error. -
trunk/psLib/test/math/tst_psMinimizeLMM.c
r6449 r6484 61 61 myCoords->n = NUM_DATA_POINTS; 62 62 psVector *y = psVectorAlloc(NUM_DATA_POINTS, PS_TYPE_F32); 63 myParams->n = NUM_PARAMS; 64 myDerivs->n = NUM_PARAMS; 65 y->n = NUM_DATA_POINTS; 63 66 64 67 for (psS32 i=0;i<NUM_DATA_POINTS;i++) { … … 66 69 ((psVector *) (myCoords->data[i]))->data.F32[0] = (float) (i+10); 67 70 ((psVector *) (myCoords->data[i]))->data.F32[1] = (float) (i+3); 71 ((psVector *) (myCoords->data[i]))->n = 2; 68 72 psTrace(__func__, 5, "x[%d] is vector (%f, %f)\n", i, ((psVector *) (myCoords->data[i]))->data.F32[0], 69 73 ((psVector *) (myCoords->data[i]))->data.F32[1]); -
trunk/psLib/test/math/tst_psMinimizePowell.c
r6449 r6484 81 81 myParams = psVectorAlloc(NUM_PARAMS, PS_TYPE_F32); 82 82 myParamMask = psVectorAlloc(NUM_PARAMS, PS_TYPE_U8); 83 myParams->n = NUM_PARAMS; 84 myParamMask->n = NUM_PARAMS; 83 85 min = psMinimizationAlloc(100, 0.01); 84 86 … … 164 166 ((psVector *) (myCoords->data[i]))->data.F32[0] = (float) (i+10); 165 167 ((psVector *) (myCoords->data[i]))->data.F32[1] = (float) (i+3); 168 ((psVector *) (myCoords->data[i]))->n = 2; 166 169 } 167 170 for (i=0;i<NUM_PARAMS;i++) { … … 169 172 myParams->data.F32[i] = 0.0; 170 173 myParams->data.F32[i] = (float) i; 174 myParams->n++; 171 175 } 172 176 … … 239 243 ((psVector *) (myCoords->data[i]))->data.F32[0] = (float) (i+10); 240 244 ((psVector *) (myCoords->data[i]))->data.F32[1] = (float) (i+3); 245 ((psVector *) (myCoords->data[i]))->n++; 241 246 } 242 247 for (i=0;i<NUM_PARAMS;i++) { … … 245 250 myParams->data.F32[i] = (float) i; 246 251 myParamMask->data.U8[i] = 0; 252 myParams->n++; 253 myParamMask->n++; 247 254 } 248 255 -
trunk/psLib/test/math/tst_psPolyFit1D.c
r6304 r6484 99 99 printf(" using a psF32 x vector\n"); 100 100 x = psVectorAlloc(numData, PS_TYPE_F32); 101 x->n = numData; 101 102 for (psS32 i=0;i<numData;i++) { 102 103 x->data.F32[i] = (psF32) i; … … 111 112 printf(" using a psS32 x vector\n"); 112 113 x = psVectorAlloc(numData, PS_TYPE_S32); 114 x->n = numData; 113 115 for (psS32 i=0;i<numData;i++) { 114 116 x->data.S32[i] = (psS32) i; … … 123 125 printf(" using a psF64 x vector\n"); 124 126 x = psVectorAlloc(numData, PS_TYPE_F64); 127 x->n = numData; 125 128 for (psS32 i=0;i<numData;i++) { 126 129 x->data.F64[i] = (psF64) i; … … 139 142 printf(" using a psF32 f vector\n"); 140 143 f = psVectorAlloc(numData, PS_TYPE_F32); 144 f->n = numData; 141 145 for (psS32 i=0;i<numData;i++) { 142 146 f->data.F32[i] = setData((psF32) i); … … 159 163 printf(" using a psS32 f vector\n"); 160 164 f = psVectorAlloc(numData, PS_TYPE_S32); 165 f->n = numData; 161 166 for (psS32 i=0;i<numData;i++) { 162 167 f->data.S32[i] = (psS32) setData((psF32) i); … … 179 184 printf(" using a psF64 f vector\n"); 180 185 f = psVectorAlloc(numData, PS_TYPE_F64); 186 f->n = numData; 181 187 for (psS32 i=0;i<numData;i++) { 182 188 f->data.F64[i] = (psF64) setData((psF32) i); … … 203 209 printf(" using a psF32 fErr vector\n"); 204 210 fErr = psVectorAlloc(numData, PS_TYPE_F32); 211 fErr->n = numData; 205 212 for (psS32 i=0;i<numData;i++) { 206 213 fErr->data.F32[i] = YERR; … … 211 218 printf(" using a psS32 fErr vector\n"); 212 219 fErr = psVectorAlloc(numData, PS_TYPE_S32); 220 fErr->n = numData; 213 221 for (psS32 i=0;i<numData;i++) { 214 222 fErr->data.S32[i] = (psS32) YERR; … … 219 227 printf(" using a psF64 fErr vector\n"); 220 228 fErr = psVectorAlloc(numData, PS_TYPE_F64); 229 fErr->n = numData; 221 230 for (psS32 i=0;i<numData;i++) { 222 231 fErr->data.F64[i] = YERR; … … 231 240 printf(" using a psU8 mask vector\n"); 232 241 mask = psVectorAlloc(numData, PS_TYPE_U8); 242 mask->n = numData; 233 243 for (psS32 i=0;i<numData;i++) { 234 244 mask->data.U8[i] = 0; … … 239 249 printf(" using a psS32 mask vector\n"); 240 250 mask = psVectorAlloc(numData, PS_TYPE_S32); 251 mask->n = numData; 241 252 for (psS32 i=0;i<numData;i++) { 242 253 mask->data.S32[i] = 0; -
trunk/psLib/test/math/tst_psPolyFit2D.c
r6226 r6484 100 100 printf(" using a psF32 x vector\n"); 101 101 x = psVectorAlloc(numData, PS_TYPE_F32); 102 x->n = numData; 102 103 for (psS32 i=0;i<numData;i++) { 103 104 x->data.F32[i] = (psF32) i; … … 108 109 printf(" using a psS32 x vector\n"); 109 110 x = psVectorAlloc(numData, PS_TYPE_S32); 111 x->n = numData; 110 112 for (psS32 i=0;i<numData;i++) { 111 113 x->data.S32[i] = (psS32) i; … … 116 118 printf(" using a psF64 x vector\n"); 117 119 x = psVectorAlloc(numData, PS_TYPE_F64); 120 x->n = numData; 118 121 for (psS32 i=0;i<numData;i++) { 119 122 x->data.F64[i] = (psF64) i; … … 129 132 printf(" using a psF32 y vector\n"); 130 133 y = psVectorAlloc(numData, PS_TYPE_F32); 134 y->n = numData; 131 135 for (psS32 i=0;i<numData;i++) { 132 136 y->data.F32[i] = (psF32) i; … … 137 141 printf(" using a psS32 y vector\n"); 138 142 y = psVectorAlloc(numData, PS_TYPE_S32); 143 y->n = numData; 139 144 for (psS32 i=0;i<numData;i++) { 140 145 y->data.S32[i] = (psS32) i; … … 145 150 printf(" using a psF64 y vector\n"); 146 151 y = psVectorAlloc(numData, PS_TYPE_F64); 152 y->n = numData; 147 153 for (psS32 i=0;i<numData;i++) { 148 154 y->data.F64[i] = (psF64) i; … … 157 163 printf(" using a psF32 f vector\n"); 158 164 f = psVectorAlloc(numData, PS_TYPE_F32); 165 f->n = numData; 159 166 for (psS32 i=0;i<numData;i++) { 160 167 f->data.F32[i] = setData((psF32) i, (psF32) i); … … 177 184 printf(" using a psS32 f vector\n"); 178 185 f = psVectorAlloc(numData, PS_TYPE_S32); 186 f->n = numData; 179 187 for (psS32 i=0;i<numData;i++) { 180 188 f->data.S32[i] = (psS32) setData((psF32) i, (psF32) i); … … 197 205 printf(" using a psF64 f vector\n"); 198 206 f = psVectorAlloc(numData, PS_TYPE_F64); 207 f->n = numData; 199 208 for (psS32 i=0;i<numData;i++) { 200 209 f->data.F64[i] = (psF64) setData((psF32) i, (psF32) i); … … 221 230 printf(" using a psF32 fErr vector\n"); 222 231 fErr = psVectorAlloc(numData, PS_TYPE_F32); 232 fErr->n = numData; 223 233 for (psS32 i=0;i<numData;i++) { 224 234 fErr->data.F32[i] = YERR; … … 237 247 printf(" using a psF64 fErr vector\n"); 238 248 fErr = psVectorAlloc(numData, PS_TYPE_F64); 249 fErr->n = numData; 239 250 for (psS32 i=0;i<numData;i++) { 240 251 fErr->data.F64[i] = YERR; … … 249 260 printf(" using a psU8 mask vector\n"); 250 261 mask = psVectorAlloc(numData, PS_TYPE_U8); 262 mask->n = numData; 251 263 for (psS32 i=0;i<numData;i++) { 252 264 mask->data.U8[i] = 0; … … 257 269 printf(" using a psS32 mask vector\n"); 258 270 mask = psVectorAlloc(numData, PS_TYPE_S32); 271 mask->n = numData; 259 272 for (psS32 i=0;i<numData;i++) { 260 273 mask->data.S32[i] = 0; -
trunk/psLib/test/math/tst_psPolyFit3D.c
r6226 r6484 117 117 printf(" using a psF32 x vector\n"); 118 118 x = psVectorAlloc(numData, PS_TYPE_F32); 119 x->n = numData; 119 120 for (psS32 i=0;i<numData;i++) { 120 121 x->data.F32[i] = (psF32) i; … … 125 126 printf(" using a psS32 x vector\n"); 126 127 x = psVectorAlloc(numData, PS_TYPE_S32); 128 x->n = numData; 127 129 for (psS32 i=0;i<numData;i++) { 128 130 x->data.S32[i] = (psS32) i; … … 133 135 printf(" using a psF64 x vector\n"); 134 136 x = psVectorAlloc(numData, PS_TYPE_F64); 137 x->n = numData; 135 138 for (psS32 i=0;i<numData;i++) { 136 139 x->data.F64[i] = (psF64) i; … … 146 149 printf(" using a psF32 y vector\n"); 147 150 y = psVectorAlloc(numData, PS_TYPE_F32); 151 y->n = numData; 148 152 for (psS32 i=0;i<numData;i++) { 149 153 y->data.F32[i] = (psF32) i; … … 154 158 printf(" using a psS32 y vector\n"); 155 159 y = psVectorAlloc(numData, PS_TYPE_S32); 160 y->n = numData; 156 161 for (psS32 i=0;i<numData;i++) { 157 162 y->data.S32[i] = (psS32) i; … … 162 167 printf(" using a psF64 y vector\n"); 163 168 y = psVectorAlloc(numData, PS_TYPE_F64); 169 y->n = numData; 164 170 for (psS32 i=0;i<numData;i++) { 165 171 y->data.F64[i] = (psF64) i; … … 174 180 printf(" using a psF32 z vector\n"); 175 181 z = psVectorAlloc(numData, PS_TYPE_F32); 182 z->n = numData; 176 183 for (psS32 i=0;i<numData;i++) { 177 184 z->data.F32[i] = (psF32) i; … … 182 189 printf(" using a psS32 z vector\n"); 183 190 z = psVectorAlloc(numData, PS_TYPE_S32); 191 z->n = numData; 184 192 for (psS32 i=0;i<numData;i++) { 185 193 z->data.S32[i] = (psS32) i; … … 190 198 printf(" using a psF64 z vector\n"); 191 199 z = psVectorAlloc(numData, PS_TYPE_F64); 200 z->n = numData; 192 201 for (psS32 i=0;i<numData;i++) { 193 202 z->data.F64[i] = (psF64) i; … … 203 212 printf(" using a psF32 f vector\n"); 204 213 f = psVectorAlloc(numData, PS_TYPE_F32); 214 f->n = numData; 205 215 for (psS32 i=0;i<numData;i++) { 206 216 f->data.F32[i] = setData((psF32) i, (psF32) i, (psF32) i); … … 223 233 printf(" using a psS32 f vector\n"); 224 234 f = psVectorAlloc(numData, PS_TYPE_S32); 235 f->n = numData; 225 236 for (psS32 i=0;i<numData;i++) { 226 237 f->data.S32[i] = (psS32) setData((psF32) i, (psF32) i, (psF32) i); … … 243 254 printf(" using a psF64 f vector\n"); 244 255 f = psVectorAlloc(numData, PS_TYPE_F64); 256 f->n = numData; 245 257 for (psS32 i=0;i<numData;i++) { 246 258 f->data.F64[i] = (psF64) setData((psF32) i, (psF32) i, (psF32) i); … … 267 279 printf(" using a psF32 fErr vector\n"); 268 280 fErr = psVectorAlloc(numData, PS_TYPE_F32); 281 fErr->n = numData; 269 282 for (psS32 i=0;i<numData;i++) { 270 283 fErr->data.F32[i] = YERR; … … 275 288 printf(" using a psS32 fErr vector\n"); 276 289 fErr = psVectorAlloc(numData, PS_TYPE_S32); 290 fErr->n = numData; 277 291 for (psS32 i=0;i<numData;i++) { 278 292 fErr->data.S32[i] = (psS32) YERR; … … 283 297 printf(" using a psF64 fErr vector\n"); 284 298 fErr = psVectorAlloc(numData, PS_TYPE_F64); 299 fErr->n = numData; 285 300 for (psS32 i=0;i<numData;i++) { 286 301 fErr->data.F64[i] = YERR; … … 295 310 printf(" using a psU8 mask vector\n"); 296 311 mask = psVectorAlloc(numData, PS_TYPE_U8); 312 mask->n = numData; 297 313 for (psS32 i=0;i<numData;i++) { 298 314 mask->data.U8[i] = 0; … … 303 319 printf(" using a psS32 mask vector\n"); 304 320 mask = psVectorAlloc(numData, PS_TYPE_S32); 321 mask->n = numData; 305 322 for (psS32 i=0;i<numData;i++) { 306 323 mask->data.S32[i] = 0; -
trunk/psLib/test/math/tst_psPolyFit4D.c
r6226 r6484 130 130 printf(" using a psF32 x vector\n"); 131 131 x = psVectorAlloc(numData, PS_TYPE_F32); 132 x->n = numData; 132 133 for (psS32 i=0;i<numData;i++) { 133 134 x->data.F32[i] = (psF32) i; … … 138 139 printf(" using a psS32 x vector\n"); 139 140 x = psVectorAlloc(numData, PS_TYPE_S32); 141 x->n = numData; 140 142 for (psS32 i=0;i<numData;i++) { 141 143 x->data.S32[i] = (psS32) i; … … 146 148 printf(" using a psF64 x vector\n"); 147 149 x = psVectorAlloc(numData, PS_TYPE_F64); 150 x->n = numData; 148 151 for (psS32 i=0;i<numData;i++) { 149 152 x->data.F64[i] = (psF64) i; … … 159 162 printf(" using a psF32 y vector\n"); 160 163 y = psVectorAlloc(numData, PS_TYPE_F32); 164 y->n = numData; 161 165 for (psS32 i=0;i<numData;i++) { 162 166 y->data.F32[i] = (psF32) i; … … 167 171 printf(" using a psS32 y vector\n"); 168 172 y = psVectorAlloc(numData, PS_TYPE_S32); 173 y->n = numData; 169 174 for (psS32 i=0;i<numData;i++) { 170 175 y->data.S32[i] = (psS32) i; … … 175 180 printf(" using a psF64 y vector\n"); 176 181 y = psVectorAlloc(numData, PS_TYPE_F64); 182 y->n = numData; 177 183 for (psS32 i=0;i<numData;i++) { 178 184 y->data.F64[i] = (psF64) i; … … 187 193 printf(" using a psF32 z vector\n"); 188 194 z = psVectorAlloc(numData, PS_TYPE_F32); 195 z->n = numData; 189 196 for (psS32 i=0;i<numData;i++) { 190 197 z->data.F32[i] = (psF32) i; … … 195 202 printf(" using a psS32 z vector\n"); 196 203 z = psVectorAlloc(numData, PS_TYPE_S32); 204 z->n = numData; 197 205 for (psS32 i=0;i<numData;i++) { 198 206 z->data.S32[i] = (psS32) i; … … 203 211 printf(" using a psF64 z vector\n"); 204 212 z = psVectorAlloc(numData, PS_TYPE_F64); 213 z->n = numData; 205 214 for (psS32 i=0;i<numData;i++) { 206 215 z->data.F64[i] = (psF64) i; … … 215 224 printf(" using a psF32 t vector\n"); 216 225 t = psVectorAlloc(numData, PS_TYPE_F32); 226 t->n = numData; 217 227 for (psS32 i=0;i<numData;i++) { 218 228 t->data.F32[i] = (psF32) i; … … 223 233 printf(" using a psS32 t vector\n"); 224 234 t = psVectorAlloc(numData, PS_TYPE_S32); 235 t->n = numData; 225 236 for (psS32 i=0;i<numData;i++) { 226 237 t->data.S32[i] = (psS32) i; … … 231 242 printf(" using a psF64 t vector\n"); 232 243 t = psVectorAlloc(numData, PS_TYPE_F64); 244 t->n = numData; 233 245 for (psS32 i=0;i<numData;i++) { 234 246 t->data.F64[i] = (psF64) i; … … 244 256 printf(" using a psF32 f vector\n"); 245 257 f = psVectorAlloc(numData, PS_TYPE_F32); 258 f->n = numData; 246 259 for (psS32 i=0;i<numData;i++) { 247 260 f->data.F32[i] = setData((psF32) i, (psF32) i, (psF32) i, (psF32) i); … … 264 277 printf(" using a psS32 f vector\n"); 265 278 f = psVectorAlloc(numData, PS_TYPE_S32); 279 f->n = numData; 266 280 for (psS32 i=0;i<numData;i++) { 267 281 f->data.S32[i] = (psS32) setData((psF32) i, (psF32) i, (psF32) i, (psF32) i); … … 284 298 printf(" using a psF64 f vector\n"); 285 299 f = psVectorAlloc(numData, PS_TYPE_F64); 300 f->n = numData; 286 301 for (psS32 i=0;i<numData;i++) { 287 302 f->data.F64[i] = (psF64) setData((psF32) i, (psF32) i, (psF32) i, (psF32) i); … … 308 323 printf(" using a psF32 fErr vector\n"); 309 324 fErr = psVectorAlloc(numData, PS_TYPE_F32); 325 fErr->n = numData; 310 326 for (psS32 i=0;i<numData;i++) { 311 327 fErr->data.F32[i] = YERR; … … 316 332 printf(" using a psS32 fErr vector\n"); 317 333 fErr = psVectorAlloc(numData, PS_TYPE_S32); 334 fErr->n = numData; 318 335 for (psS32 i=0;i<numData;i++) { 319 336 fErr->data.S32[i] = (psS32) YERR; … … 324 341 printf(" using a psF64 fErr vector\n"); 325 342 fErr = psVectorAlloc(numData, PS_TYPE_F64); 343 fErr->n = numData; 326 344 for (psS32 i=0;i<numData;i++) { 327 345 fErr->data.F64[i] = YERR; … … 336 354 printf(" using a psU8 mask vector\n"); 337 355 mask = psVectorAlloc(numData, PS_TYPE_U8); 356 mask->n = numData; 338 357 for (psS32 i=0;i<numData;i++) { 339 358 mask->data.U8[i] = 0; … … 344 363 printf(" using a psS32 mask vector\n"); 345 364 mask = psVectorAlloc(numData, PS_TYPE_S32); 365 mask->n = numData; 346 366 for (psS32 i=0;i<numData;i++) { 347 367 mask->data.S32[i] = 0; -
trunk/psLib/test/math/tst_psPolynomialEval1D.c
r6304 r6484 4 4 * ORD and CHEB type polynomials. 5 5 * 6 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $7 * @date $Date: 2006-02- 02 21:05:51$6 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2006-02-24 23:43:15 $ 8 8 * 9 9 * XXX: Probably should test single- and multi-dimensional polynomials in … … 11 11 * 12 12 * XXX: define ORDERS, not TERMS 13 * 13 * 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii … … 124 124 inputOrd->data.F64[i] = poly1DXValue[i]; 125 125 inputCheb->data.F64[i] = poly1DXChebValue[i]; 126 inputOrd->n++; 127 inputCheb->n++; 126 128 } 127 129 -
trunk/psLib/test/math/tst_psPolynomialEval2D.c
r6304 r6484 4 4 * ORD and CHEB type polynomials. 5 5 * 6 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $7 * @date $Date: 2006-02- 02 21:05:51$6 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2006-02-24 23:43:15 $ 8 8 * 9 9 * Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii … … 157 157 inputChebX->data.F64[i] = poly2DXYChebValue[i][0]; 158 158 inputChebY->data.F64[i] = poly2DXYChebValue[i][1]; 159 inputOrdX->n++; 160 inputOrdY->n++; 161 inputChebX->n++; 162 inputChebY->n++; 159 163 } 160 164 -
trunk/psLib/test/math/tst_psPolynomialEval3D.c
r6304 r6484 4 4 * ORD and CHEB type polynomials. 5 5 * 6 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $7 * @date $Date: 2006-02- 02 21:05:51$6 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2006-02-24 23:43:15 $ 8 8 * 9 9 * Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii … … 220 220 inputChebY->data.F64[i] = Dpoly3DXYZChebValue[i][1]; 221 221 inputChebZ->data.F64[i] = Dpoly3DXYZChebValue[i][2]; 222 inputOrdX->n++; 223 inputOrdY->n++; 224 inputOrdZ->n++; 225 inputChebX->n++; 226 inputChebY->n++; 227 inputChebZ->n++; 222 228 } 223 229 -
trunk/psLib/test/math/tst_psPolynomialEval4D.c
r6304 r6484 4 4 * ORD and CHEB type polynomials. 5 5 * 6 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $7 * @date $Date: 2006-02- 02 21:05:51$6 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2006-02-24 23:43:15 $ 8 8 * 9 9 * Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii … … 470 470 inputChebY->data.F64[i] = Dpoly4DWXYZChebValue[i][2]; 471 471 inputChebZ->data.F64[i] = Dpoly4DWXYZChebValue[i][3]; 472 inputOrdW->n++; 473 inputOrdX->n++; 474 inputOrdY->n++; 475 inputOrdZ->n++; 476 inputChebW->n++; 477 inputChebX->n++; 478 inputChebY->n++; 479 inputChebZ->n++; 472 480 } 473 481 -
trunk/psLib/test/math/tst_psRandom.c
r4951 r6484 122 122 psRandom *myRNG = NULL; 123 123 psVector *rans = psVectorAlloc(NUM_DATA, PS_TYPE_F64); 124 rans->n = rans->nalloc; 124 125 psStats *stats = psStatsAlloc(PS_STAT_SAMPLE_MEAN); 125 126 … … 167 168 psRandom *myRNG = NULL; 168 169 psVector *rans = psVectorAlloc(NUM_DATA, PS_TYPE_F64); 170 rans->n = rans->nalloc; 169 171 psStats *stats = psStatsAlloc(PS_STAT_SAMPLE_MEAN); 170 172 … … 214 216 psRandom *myRNG = NULL; 215 217 psVector *rans = psVectorAlloc(NUM_DATA, PS_TYPE_F64); 218 rans->n = rans->nalloc; 216 219 psStats *stats = psStatsAlloc(PS_STAT_SAMPLE_MEAN); 217 220 … … 259 262 psRandom *myRNG = NULL; 260 263 psVector *rans00 = psVectorAlloc(NUM_DATA, PS_TYPE_F64); 264 rans00->n = rans00->nalloc; 261 265 psVector *rans01 = psVectorAlloc(NUM_DATA, PS_TYPE_F64); 266 rans01->n = rans01->nalloc; 262 267 psVector *rans02 = psVectorAlloc(NUM_DATA, PS_TYPE_F64); 268 rans02->n = rans02->nalloc; 263 269 264 270 myRNG = psRandomAlloc(PS_RANDOM_TAUS, SEED); … … 314 320 psRandom *myRNG = NULL; 315 321 psVector *rans00 = psVectorAlloc(NUM_DATA, PS_TYPE_F64); 322 rans00->n = rans00->nalloc; 316 323 psVector *rans01 = psVectorAlloc(NUM_DATA, PS_TYPE_F64); 324 rans01->n = rans01->nalloc; 317 325 psVector *rans02 = psVectorAlloc(NUM_DATA, PS_TYPE_F64); 326 rans02->n = rans02->nalloc; 318 327 319 328 myRNG = psRandomAlloc(PS_RANDOM_TAUS, SEED); … … 357 366 psRandom *myRNG = NULL; 358 367 psVector *rans00 = psVectorAlloc(NUM_DATA, PS_TYPE_F64); 368 rans00->n = rans00->nalloc; 359 369 psVector *rans01 = psVectorAlloc(NUM_DATA, PS_TYPE_F64); 370 rans01->n = rans01->nalloc; 360 371 psVector *rans02 = psVectorAlloc(NUM_DATA, PS_TYPE_F64); 372 rans02->n = rans02->nalloc; 361 373 362 374 myRNG = psRandomAlloc(PS_RANDOM_TAUS, SEED); -
trunk/psLib/test/math/tst_psSpline1D.c
r6226 r6484 13 13 * @author GLG, MHPCC 14 14 * 15 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $16 * @date $Date: 2006-0 1-27 20:08:58$15 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2006-02-24 23:43:15 $ 17 17 * 18 18 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 28 28 // {testFunction, testpointNumber, description, expected rc, boolean-ignore this test} 29 29 testDescription tests[] = { 30 {psSplineAllocTest, 0000, "(TEST A) psSplineAllocTest",true, false},31 {psSplineEvalTest, 0000, "(TEST B) psSplineEvalTest",true, false},32 {psSplineEvalVectorTest, 0000, "(TEST C) psSplineEvalVectorTest", true,false},30 {psSplineAllocTest, 665, "(TEST A) psSplineAllocTest",true, false}, 31 {psSplineEvalTest, 666, "(TEST B) psSplineEvalTest",true, false}, 32 {psSplineEvalVectorTest,667,"(TEST C) psSplineEvalVectorTest",true,false}, 33 33 {NULL} 34 34 }; … … 199 199 yF32 = psVectorAlloc(NumSplines+1, PS_TYPE_F32); 200 200 yF64 = psVectorAlloc(NumSplines+1, PS_TYPE_F64); 201 xF32->n = NumSplines+1; 202 xF64->n = NumSplines+1; 203 yF32->n = NumSplines+1; 204 yF64->n = NumSplines+1; 201 205 202 206 for (psS32 i=0;i<NumSplines+1;i++) { … … 274 278 yF32 = psVectorAlloc(NumSplines+1, PS_TYPE_F32); 275 279 yF64 = psVectorAlloc(NumSplines+1, PS_TYPE_F64); 280 xF32->n = NumSplines+1; 281 xF64->n = NumSplines+1; 282 yF32->n = NumSplines+1; 283 yF64->n = NumSplines+1; 276 284 277 285 for (psS32 i=0;i<NumSplines+1;i++) { … … 384 392 yF32 = psVectorAlloc(NumSplines+1, PS_TYPE_F32); 385 393 yF64 = psVectorAlloc(NumSplines+1, PS_TYPE_F64); 394 xF32->n = NumSplines+1; 395 xF64->n = NumSplines+1; 396 yF32->n = NumSplines+1; 397 yF64->n = NumSplines+1; 386 398 387 399 for (psS32 i=0;i<NumSplines+1;i++) { … … 459 471 yF32 = psVectorAlloc(NumSplines+1, PS_TYPE_F32); 460 472 yF64 = psVectorAlloc(NumSplines+1, PS_TYPE_F64); 473 xF32->n = NumSplines+1; 474 xF64->n = NumSplines+1; 475 yF32->n = NumSplines+1; 476 yF64->n = NumSplines+1; 461 477 462 478 for (psS32 i=0;i<NumSplines+1;i++) { … … 559 575 yF32 = psVectorAlloc(NumSplines+1, PS_TYPE_F32); 560 576 yF64 = psVectorAlloc(NumSplines+1, PS_TYPE_F64); 577 xF32->n = NumSplines+1; 578 xF64->n = NumSplines+1; 579 yF32->n = NumSplines+1; 580 yF64->n = NumSplines+1; 561 581 562 582 for (psS32 i=0;i<NumSplines+1;i++) { … … 634 654 yF32 = psVectorAlloc(NumSplines+1, PS_TYPE_F32); 635 655 yF64 = psVectorAlloc(NumSplines+1, PS_TYPE_F64); 656 xF32->n = NumSplines+1; 657 xF64->n = NumSplines+1; 658 yF32->n = NumSplines+1; 659 yF64->n = NumSplines+1; 636 660 637 661 for (psS32 i=0;i<NumSplines+1;i++) { … … 757 781 psVector *yF32Test = NULL; 758 782 psVector *xF64Test = psVectorAlloc(NumSplines, PS_TYPE_F64); 783 xF32->n = NumSplines+1; 784 yF32->n = NumSplines+1; 785 xF32Test->n = NumSplines; 786 xF64Test->n = NumSplines; 787 759 788 760 789 for (psS32 i=0;i<NumSplines+1;i++) { -
trunk/psLib/test/math/tst_psStats07.c
r6326 r6484 72 72 for (psS32 i=0;i<numData;i++) { 73 73 in->data.F32[i] = gaussVector->data.F32[i]; 74 in->n++; 74 75 } 75 76 … … 86 87 for (psS32 i=0;i<numData;i++) { 87 88 in->data.F64[i] = (psF64) gaussVector->data.F32[i]; 89 in->n++; 88 90 } 89 91 … … 100 102 for (psS32 i=0;i<numData;i++) { 101 103 in->data.S8[i] = (psS8) gaussVector->data.F32[i]; 104 in->n++; 102 105 } 103 106 … … 114 117 for (psS32 i=0;i<numData;i++) { 115 118 in->data.U16[i] = (psU16) gaussVector->data.F32[i]; 119 in->n++; 116 120 } 117 121 … … 128 132 for (psS32 i=0;i<numData;i++) { 129 133 in->data.S32[i] = (psS32) gaussVector->data.F32[i]; 134 in->n++; 130 135 } 131 136 … … 138 143 psFree(gaussVector); 139 144 145 // in->n = in->nalloc; 140 146 if (flags & TST_ERRORS_NULL) { 141 147 printf(" using a NULL errors vector\n"); … … 147 153 for (psS32 i=0;i<numData;i++) { 148 154 errors->data.F32[i] = ERRORS; 155 errors->n++; 149 156 } 150 157 … … 161 168 for (psS32 i=0;i<numData;i++) { 162 169 errors->data.F64[i] = ERRORS; 170 errors->n++; 163 171 } 164 172 … … 175 183 for (psS32 i=0;i<numData;i++) { 176 184 errors->data.S8[i] = (psS8) ERRORS; 185 errors->n++; 177 186 } 178 187 … … 189 198 for (psS32 i=0;i<numData;i++) { 190 199 errors->data.U16[i] = (psU16) ERRORS; 200 errors->n++; 191 201 } 192 202 … … 203 213 for (psS32 i=0;i<numData;i++) { 204 214 errors->data.S32[i] = (psS32) ERRORS; 215 errors->n++; 205 216 } 206 217 … … 222 233 for (psS32 i=0;i<numData;i++) { 223 234 mask->data.U8[i] = (psU8) 0; 235 mask->n++; 224 236 } 225 237 … … 236 248 for (psS32 i=0;i<numData;i++) { 237 249 mask->data.S32[i] = (psS32) 0; 250 mask->n++; 238 251 } 239 252 -
trunk/psLib/test/math/tst_psStats09.c
r6307 r6484 68 68 for (psS32 i=0;i<numData;i++) { 69 69 in->data.F32[i] = (psF32) i; 70 in->n++; 70 71 } 71 72 … … 82 83 for (psS32 i=0;i<numData;i++) { 83 84 in->data.F64[i] = (psF64) i; 85 in->n++; 84 86 } 85 87 … … 96 98 for (psS32 i=0;i<numData;i++) { 97 99 in->data.S8[i] = (psS8) i; 100 in->n++; 98 101 } 99 102 … … 110 113 for (psS32 i=0;i<numData;i++) { 111 114 in->data.U16[i] = (psU16) i; 115 in->n++; 112 116 } 113 117 … … 124 128 for (psS32 i=0;i<numData;i++) { 125 129 in->data.S32[i] = (psS32) i; 130 in->n++; 126 131 } 127 132 … … 142 147 for (psS32 i=0;i<numData;i++) { 143 148 errors->data.F32[i] = ERRORS; 149 errors->n++; 144 150 } 145 151 … … 156 162 for (psS32 i=0;i<numData;i++) { 157 163 errors->data.F64[i] = ERRORS; 164 errors->n++; 158 165 } 159 166 … … 170 177 for (psS32 i=0;i<numData;i++) { 171 178 errors->data.S8[i] = (psS8) ERRORS; 179 errors->n++; 172 180 } 173 181 … … 184 192 for (psS32 i=0;i<numData;i++) { 185 193 errors->data.U16[i] = (psU16) ERRORS; 194 errors->n++; 186 195 } 187 196 … … 198 207 for (psS32 i=0;i<numData;i++) { 199 208 errors->data.S32[i] = (psS32) ERRORS; 209 errors->n++; 200 210 } 201 211 … … 217 227 for (psS32 i=0;i<numData;i++) { 218 228 mask->data.U8[i] = (psU8) 0; 229 mask->n++; 219 230 } 220 231 … … 231 242 for (psS32 i=0;i<numData;i++) { 232 243 mask->data.S32[i] = (psS32) 0; 244 mask->n++; 233 245 } 234 246 -
trunk/psLib/test/mathtypes/tst_psVector.c
r6349 r6484 14 14 * @author Ross Harman, MHPCC 15 15 * 16 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $17 * @date $Date: 2006-02- 08 00:00:36 $16 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 17 * @date $Date: 2006-02-24 23:43:16 $ 18 18 * 19 19 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 70 70 return 1; 71 71 } 72 if (psVec->n != psVec->nalloc) {72 if (psVec->n != 0) { 73 73 fprintf(stderr,"Vector population = %ld\n", psVec->n); 74 74 return 2; … … 126 126 for(psS32 i = 0; i < 5; i++) { 127 127 psVec->data.S32[i] = i*10; 128 psVec->n++; 128 129 } 129 130 … … 202 203 } 203 204 205 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 204 206 psVector* vecBogus = psVectorRealloc(NULL, 6); 205 207 if (vecBogus != NULL) { … … 319 321 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "VectorInit failed. U8 Case \n"); 320 322 } 321 if ( !psVectorInit(in2, PS_MAX_U64) ) { 323 324 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 325 if ( psVectorInit(in2, PS_MAX_U64) ) { 322 326 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "VectorInit failed. U16 Case \n"); 323 327 } … … 328 332 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "VectorInit failed. U64 Case \n"); 329 333 } 330 if ( !psVectorInit(in5, PS_MAX_S16 ) ) { 334 335 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 336 if ( psVectorInit(in5, PS_MAX_S16 ) ) { 331 337 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "VectorInit failed. S8 Case \n"); 332 338 } … … 463 469 vec->n = 0; 464 470 465 if ( !psVectorSet(vec, 0, 10) ) 471 if ( !psVectorSet(vec, 0, 10) ) { 466 472 fprintf(stderr, "VectorSet failed to set S32 at position 0\n"); 467 if ( psVectorSet(vec, 10, 10) ) 473 } 474 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 475 if ( psVectorSet(vec, 10, 10) ) { 468 476 fprintf(stderr, "VectorSet Improperly set S32 at out of range position\n"); 469 if ( !psVectorSet(vec, 1, 4) ) 477 } 478 if ( !psVectorSet(vec, 1, 4) ) { 470 479 fprintf(stderr, "VectorSet Failed to set S32 at position 1\n"); 471 if ( (psS32)psVectorGet(vec, 0) != 10 ) 480 } 481 if ( (psS32)psVectorGet(vec, 0) != 10 ) { 472 482 fprintf(stderr, 473 483 "VectorGet Failed to return the correct S32 from position 0\n"); 474 if ( (psS32)psVectorGet(vec, -1) != 4 ) 484 } 485 if ( (psS32)psVectorGet(vec, -1) != 4 ) { 475 486 fprintf(stderr, 476 487 "VectorGet Failed to return the correct S32 from tail using -1\n"); 488 } 477 489 478 490 psFree(vec); … … 485 497 long numPix2 = 0; 486 498 psVector *vec = NULL; 499 500 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 487 501 numPix = psVectorCountPixelMask(vec, 1); 488 489 502 if (numPix != -1) { 490 503 psError(PS_ERR_BAD_PARAMETER_VALUE, false, … … 507 520 vec2->data.U8[3] = 1; 508 521 vec2->data.U8[4] = 0; 522 vec->n = 5; 523 vec2->n = 5; 524 525 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 509 526 numPix = psVectorCountPixelMask(vec, 1); 510 527 numPix2 = psVectorCountPixelMask(vec2, 1); -
trunk/psLib/test/mathtypes/tst_psVectorSort_02.c
r4547 r6484 14 14 * @author Ross Harman, MHPCC 15 15 * 16 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $17 * @date $Date: 200 5-07-13 02:47:00$16 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 17 * @date $Date: 2006-02-24 23:43:16 $ 18 18 * 19 19 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 98 98 for(psS32 m=0; m<5; m++) { 99 99 in->data.U8[m]= 20-m; 100 in->n++; 100 101 } 101 102 out = psVectorAlloc(3,PS_TYPE_U32); 103 out->n = 3; 102 104 out = psVectorSortIndex(out,in); 103 105 if(out->n != 5) { … … 151 153 in = psVectorAlloc(5,PS_TYPE_U8); 152 154 out = psVectorAlloc(5,PS_TYPE_U32); 155 in->n = 5; 156 out->n = 5; 153 157 tempVect = out; 154 158 in->type.type = PS_TYPE_BOOL; -
trunk/psLib/test/mathtypes/verified/tst_psVector.stderr
r6350 r6484 18 18 \**********************************************************************************/ 19 19 20 <HOST>|I|testVectorRealloc 21 Following should generate error message 20 22 <HOST>|E|psVectorRealloc (FILE:LINENO) 21 23 psVectorRealloc must a given a non-NULL psVector to resize. Desired datatype unknown. … … 38 40 \**********************************************************************************/ 39 41 42 <HOST>|I|testVectorInit 43 Following should generate error message 40 44 <HOST>|E|psVectorInit (FILE:LINENO) 41 45 Error: U16 Value out of Range. 42 <HOST>| E|testVectorInit (FILE:LINENO)43 VectorInit failed. U16 Case46 <HOST>|I|testVectorInit 47 Following should generate error message 44 48 <HOST>|E|psVectorInit (FILE:LINENO) 45 49 Error: S8 Value out of Range. 46 <HOST>|E|testVectorInit (FILE:LINENO)47 VectorInit failed. S8 Case48 50 49 51 ---> TESTPOINT PASSED (psVector{psVectorInit} | tst_psVector.c) … … 82 84 \**********************************************************************************/ 83 85 86 <HOST>|I|testVectorGetSet 87 Following should generate error message 84 88 <HOST>|E|psVectorSet (FILE:LINENO) 85 89 Invalid position. Number too large … … 93 97 \**********************************************************************************/ 94 98 99 <HOST>|I|testVectorCountPixelMask 100 Following should generate error message 95 101 <HOST>|E|psVectorCountPixelMask (FILE:LINENO) 96 102 The input psVector can not be NULL. 103 <HOST>|I|testVectorCountPixelMask 104 Following should generate error message 97 105 <HOST>|E|psVectorCountPixelMask (FILE:LINENO) 98 106 psVector type does not match the specified psMaskType! -
trunk/psLib/test/types/tst_psLookupTable_01.c
r6204 r6484 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $15 * @date $Date: 2006-0 1-26 21:10:22$14 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2006-02-24 23:43:16 $ 16 16 * 17 17 * Copyright 2004-5 Maui High Performance Computing Center, University of Hawaii … … 191 191 {testLookupTableAlloc,817,"psLookupTableAlloc",0,false}, 192 192 {testVectorsReadFromFile,999,"psVectorsReadFromFile",0,false}, 193 {testLookupTableImport, 999,"psLookupTableImport",0,false},193 {testLookupTableImport,666,"psLookupTableImport",0,false}, 194 194 {testLookupTableRead,998,"psLookupTableRead",0,false}, 195 195 {testLookupTableInterpolate,997,"psLookupTableInterpolate",0,false}, -
trunk/psLib/test/types/tst_psMetadataIO.c
r5136 r6484 13 13 * @author Eric Van Alst, MHPCC 14 14 * 15 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $16 * @date $Date: 200 5-09-26 21:13:33$15 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2006-02-24 23:43:16 $ 17 17 * 18 18 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 32 32 33 33 testDescription tests[] = { 34 {testMetadataParseConfig,0 00,"psMetadataConfigParse",0,false},35 {testMetadataParseConfig1, 000,"psMetadataConfigParse",0,false},36 {testMetadataParseConfig2, 000,"psMetadataConfigParse",0,false},37 {testMetadataParseConfig3, 000,"psMetadataConfigParse",0,false},38 {testMetadataParseConfig4, 000,"psMetadataConfigParse",0,false},39 {testMetadataPrint, 000,"psMetadataPrint",0,false},34 {testMetadataParseConfig,0,"psMetadataConfigParse",0,false}, 35 {testMetadataParseConfig1,1,"psMetadataConfigParse1",0,false}, 36 {testMetadataParseConfig2,2,"psMetadataConfigParse2",0,false}, 37 {testMetadataParseConfig3,3,"psMetadataConfigParse3",0,false}, 38 {testMetadataParseConfig4,4,"psMetadataConfigParse4",0,false}, 39 {testMetadataPrint,666,"psMetadataPrint",0,false}, 40 40 {NULL} 41 41 }; -
trunk/psLib/test/types/verified/tst_psMetadataIO.stderr
r5019 r6484 10 10 /***************************** TESTPOINT ******************************************\ 11 11 * TestFile: tst_psMetadataIO.c * 12 * TestPoint: psMetadataConfigParse{psMetadataConfigParse }*12 * TestPoint: psMetadataConfigParse{psMetadataConfigParse1} * 13 13 * TestType: Positive * 14 14 \**********************************************************************************/ … … 65 65 Unallowable operation: filename is NULL. 66 66 67 ---> TESTPOINT PASSED (psMetadataConfigParse{psMetadataConfigParse } | tst_psMetadataIO.c)67 ---> TESTPOINT PASSED (psMetadataConfigParse{psMetadataConfigParse1} | tst_psMetadataIO.c) 68 68 69 69 /***************************** TESTPOINT ******************************************\ 70 70 * TestFile: tst_psMetadataIO.c * 71 * TestPoint: psMetadataConfigParse{psMetadataConfigParse }*71 * TestPoint: psMetadataConfigParse{psMetadataConfigParse2} * 72 72 * TestType: Positive * 73 73 \**********************************************************************************/ … … 80 80 Failed to add metadata item to metadata collection list. 81 81 82 ---> TESTPOINT PASSED (psMetadataConfigParse{psMetadataConfigParse } | tst_psMetadataIO.c)82 ---> TESTPOINT PASSED (psMetadataConfigParse{psMetadataConfigParse2} | tst_psMetadataIO.c) 83 83 84 84 /***************************** TESTPOINT ******************************************\ 85 85 * TestFile: tst_psMetadataIO.c * 86 * TestPoint: psMetadataConfigParse{psMetadataConfigParse }*86 * TestPoint: psMetadataConfigParse{psMetadataConfigParse3} * 87 87 * TestType: Positive * 88 88 \**********************************************************************************/ 89 89 90 90 91 ---> TESTPOINT PASSED (psMetadataConfigParse{psMetadataConfigParse } | tst_psMetadataIO.c)91 ---> TESTPOINT PASSED (psMetadataConfigParse{psMetadataConfigParse3} | tst_psMetadataIO.c) 92 92 93 93 /***************************** TESTPOINT ******************************************\ 94 94 * TestFile: tst_psMetadataIO.c * 95 * TestPoint: psMetadataConfigParse{psMetadataConfigParse }*95 * TestPoint: psMetadataConfigParse{psMetadataConfigParse4} * 96 96 * TestType: Positive * 97 97 \**********************************************************************************/ … … 112 112 Metadata type 'CELL6', found on line 31 of test5.config, is invalid. 113 113 114 ---> TESTPOINT PASSED (psMetadataConfigParse{psMetadataConfigParse } | tst_psMetadataIO.c)114 ---> TESTPOINT PASSED (psMetadataConfigParse{psMetadataConfigParse4} | tst_psMetadataIO.c) 115 115 116 116 /***************************** TESTPOINT ******************************************\
Note:
See TracChangeset
for help on using the changeset viewer.
