IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6484


Ignore:
Timestamp:
Feb 24, 2006, 1:43:16 PM (20 years ago)
Author:
drobbin
Message:

Changed psArray & psVector to zero 'n' upon allocation. Used to set vector->n = nalloc.

Location:
trunk/psLib
Files:
41 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/astro/psCoord.c

    r6445 r6484  
    1010*  @author GLG, MHPCC
    1111*
    12 *  @version $Revision: 1.117 $ $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 $
    1414*
    1515*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    760760    for (psS32 g = 0; g < numCoords; g++) {
    761761        xIn->data.F64[g] = ((psPlane *) source->data[g])->x;
     762        xIn->n++;
    762763        yIn->data.F64[g] = ((psPlane *) source->data[g])->y;
     764        yIn->n++;
    763765        xOut->data.F64[g] = ((psPlane *) dest->data[g])->x;
     766        xOut->n++;
    764767        yOut->data.F64[g] = ((psPlane *) dest->data[g])->y;
     768        yOut->n++;
    765769    }
    766770
  • trunk/psLib/src/db/psDB.c

    r6296 r6484  
    1212 *  @author Joshua Hoblitt
    1313 *
    14  *  @version $Revision: 1.46 $ $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 $
    1616 *
    1717 *  Copyright 2005 Joshua Hoblitt, University of Hawaii
     
    381381
    382382    column = psVectorAlloc(stringColumn->n, type);
     383    //    column->n = column->nalloc;
    383384
    384385    // conversion functions are a portability issue
    385386    switch (type) {
    386387    case PS_TYPE_S8:
     388        column->n = column->nalloc;
    387389        PS_STR_ARRAY_TO_PTYPE(column->data.S8, stringColumn, atoi, psS8, PS_TYPE_S8);
    388390        break;
    389391    case PS_TYPE_S16:
     392        column->n = column->nalloc;
    390393        PS_STR_ARRAY_TO_PTYPE(column->data.S16, stringColumn, atoi, psS16, PS_TYPE_S16);
    391394        break;
    392395    case PS_TYPE_S32:
     396        column->n = column->nalloc;
    393397        PS_STR_ARRAY_TO_PTYPE(column->data.S32, stringColumn, atoi, psS32, PS_TYPE_S32);
    394398        break;
    395399    case PS_TYPE_S64:
     400        column->n = column->nalloc;
    396401        PS_STR_ARRAY_TO_PTYPE(column->data.S64, stringColumn, atoll, psS64, PS_TYPE_S64);
    397402        break;
    398403    case PS_TYPE_U8:
     404        column->n = column->nalloc;
    399405        PS_STR_ARRAY_TO_PTYPE(column->data.U8, stringColumn, atoi, psU8, PS_TYPE_U8);
    400406        break;
    401407    case PS_TYPE_U16:
     408        column->n = column->nalloc;
    402409        PS_STR_ARRAY_TO_PTYPE(column->data.U16, stringColumn, atoi, psU16, PS_TYPE_U16);
    403410        break;
    404411    case PS_TYPE_U32:
     412        column->n = column->nalloc;
    405413        PS_STR_ARRAY_TO_PTYPE(column->data.U32, stringColumn, atoi, psU32, PS_TYPE_U32);
    406414        break;
    407415    case PS_TYPE_U64:
     416        column->n = column->nalloc;
    408417        PS_STR_ARRAY_TO_PTYPE(column->data.U64, stringColumn, atoll, psU64, PS_TYPE_U64);
    409418        break;
    410419    case PS_TYPE_F32:
     420        column->n = column->nalloc;
    411421        PS_STR_ARRAY_TO_PTYPE(column->data.F32, stringColumn, atof, psF32, PS_TYPE_F32);
    412422        break;
    413423    case PS_TYPE_F64:
     424        column->n = column->nalloc;
    414425        PS_STR_ARRAY_TO_PTYPE(column->data.F64, stringColumn, atof, psF64, PS_TYPE_F64);
    415426        break;
    416427    case PS_TYPE_C32:
    417428        // this is a bogus SQL type
     429        column->n = column->nalloc;
    418430        PS_STR_ARRAY_TO_PTYPE(column->data.C32, stringColumn, atof, psC32, PS_TYPE_C32);
    419431        break;
     
    424436    case PS_TYPE_BOOL:
    425437        // valid for psVector?
     438        column->n = column->nalloc;
    426439        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;
    427447        break;
    428448    }
  • trunk/psLib/src/fits/psFitsTable.c

    r6445 r6484  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    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 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    526526
    527527    psVector* result = psVectorAlloc(numRows, convertFitsToPsType(typecode));
     528    result->n = numRows;
    528529
    529530    fits_read_col(fits->fd,
  • trunk/psLib/src/imageops/psImageGeomManip.c

    r6354 r6484  
    1010 *  @author Ross Harman, MHPCC
    1111 *
    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 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    9393        }
    9494        maskVec = psVectorAlloc(scale * scale, PS_TYPE_MASK);
     95        maskVec->n = maskVec->nalloc;
    9596        maskData = maskVec->data.PS_TYPE_MASK_DATA;
    9697    }
  • trunk/psLib/src/imageops/psImagePixelExtract.c

    r6294 r6484  
    88 *  @author Robert DeSonia, MHPCC
    99 *
    10  *  @version $Revision: 1.11 $ $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 $
    1212 *
    1313 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    326326        // psStats.
    327327        out = psVectorRecycle(out, numCols, PS_TYPE_F64);
     328        out->n = numCols;
    328329        if (coords != NULL) {
    329330            coords = psPixelsRealloc(coords, numCols);
     
    342343            maskVec = psVectorAlloc(numRows, mask->type.type);
    343344        }
     345        imgVec->n = imgVec->nalloc;
     346        maskVec->n = maskVec->nalloc;
    344347        #define PSIMAGE_CUT_VERTICAL(TYPE) \
    345348    case PS_TYPE_##TYPE: { \
     
    408411        imgVec = psAlloc(sizeof(psVector));
    409412        imgVec->type = input->type;
    410 
    411413        P_PSVECTOR_SET_NALLOC(imgVec,numCols);
    412         imgVec->n = numCols;
    413414        if (mask != NULL) {
    414415            maskVec = psAlloc(sizeof(psVector));
    415416            maskVec->type = mask->type;
    416417            P_PSVECTOR_SET_NALLOC(maskVec,numCols);
    417             maskVec->n = numCols;
    418418        }
    419419        // recycle output to make a proper sized/type output structure
     
    421421        // psStats.
    422422        out = psVectorRecycle(out, numRows, PS_TYPE_F64);
     423        out->n = numRows;
     424        imgVec->n = imgVec->nalloc;
     425        maskVec->n = maskVec->nalloc;
    423426        if (coords != NULL) {
    424427            coords = psPixelsRealloc(coords, numRows);
  • trunk/psLib/src/math/psConstants.h

    r6437 r6484  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.85 $ $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 $
    1010 *
    1111 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    312312if (VEC->n != SIZE) { \
    313313    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.", \
    315315            #VEC, VEC->n, SIZE); \
    316316    return(RVAL); \
  • trunk/psLib/src/math/psMinimizeLMM.c

    r6346 r6484  
    1010 *  @author EAM, IfA
    1111 *
    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 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    239239    psF64 ymodel;
    240240    psVector *deriv = psVectorAlloc(params->n, PS_TYPE_F32);
     241    deriv->n = deriv->nalloc;
    241242
    242243    // zero alpha and beta for summing below
     
    370371    psVector *Beta   = psVectorAlloc(params->n, PS_TYPE_F64);
    371372    psVector *Params = psVectorAlloc(params->n, PS_TYPE_F32);
     373    beta->n = beta->nalloc;
     374    Beta->n = Beta->nalloc;
     375    Params->n = Params->nalloc;
    372376    psVector *dy     = NULL;
    373377    psF64 Chisq = 0.0;
     
    385389        param_min = psVectorAlloc(params->n, PS_TYPE_F32);
    386390        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;
    387394        for (int i = 0; i < params->n; i++) {
    388395            beta_lim->data.F32[i] = covar->data.F64[0][i];
     
    402409    } else {
    403410        dy = psVectorAlloc(y->n, PS_TYPE_F32);
     411        dy->n = dy->nalloc;
    404412        psVectorInit(dy, 1.0);
    405413    }
  • trunk/psLib/src/math/psMinimizePolyFit.c

    r6305 r6484  
    1010 *  @author EAM, IfA
    1111 *
    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 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    4444    for (psS32 i = 0 ; i < SIZE ; i++) { \
    4545        VEC->data.F64[i] = ((2.0 / ((psF64) (SIZE - 1))) * ((psF64) i)) - 1.0; \
     46        VEC->n++; \
    4647    }\
    4748} else if (TYPE == PS_TYPE_F32){ \
    4849    for (psS32 i = 0 ; i < SIZE ; i++) { \
    4950        VEC->data.F32[i] = ((2.0 / ((psF32) (SIZE - 1))) * ((psF32) i)) - 1.0; \
     51        VEC->n++; \
    5052    }\
    5153}\
     
    8789    if (sums == NULL) {
    8890        sums = psVectorAlloc(nSum, PS_TYPE_F64);
     91        sums->n = sums->nalloc;
    8992    } else if (nSum > sums->n) {
    9093        sums = psVectorRealloc(sums, nSum);
     94        sums->n = sums->nalloc;
    9195    }
    9296
     
    305309    linear equations which can be easily solved.  The resulting vector is the
    306310    coefficients of the Chebyshev polys.
    307     
     311 
    308312    This method is significantly slower than the standard NR algorithm.  It
    309313    was explicitly requested that we not use the NR algorithm.
     
    371375        }
    372376        B->data.F64[i] = ordPoly->coeff[i];
     377        B->n++;
    373378    }
    374379
     
    534539    // Compute the B vector
    535540    psVector *B = psVectorAlloc(NUM_POLY, PS_TYPE_F64);
     541    B->n = B->nalloc;
    536542    for (psS32 i = 0 ; i < NUM_POLY ; i++) {
    537543        B->data.F64[i] = 0.0;
     
    780786    A = psImageAlloc(nTerm, nTerm, PS_TYPE_F64);
    781787    B = psVectorAlloc(nTerm, PS_TYPE_F64);
     788    B->n = B->nalloc;
    782789    // Initialize data structures.
    783790    if (!psImageInit(A, 0.0) || !psVectorInit(B, 0.0)) {
     
    10451052    psVector *fit   = NULL;
    10461053    psVector *resid = psVectorAlloc(f->n, PS_TYPE_F64);
     1054    resid->n = resid->nalloc;
    10471055
    10481056    // eventual expansion: user supplies one of various stats option pairs,
     
    12051213    A = psImageAlloc(nTerm, nTerm, PS_TYPE_F64);
    12061214    B = psVectorAlloc(nTerm, PS_TYPE_F64);
     1215    B->n = B->nalloc;
    12071216    // Initialize data structures.
    12081217    if (!psImageInit(A, 0.0) || !psVectorInit(B, 0.0)) {
     
    14621471    }
    14631472    psVector *resid = psVectorAlloc(f->n, PS_TYPE_F64);
     1473    resid->n = resid->nalloc;
    14641474
    14651475    // eventual expansion: user supplies one of various stats option pairs,
     
    16301640    A = psImageAlloc(nTerm, nTerm, PS_TYPE_F64);
    16311641    B = psVectorAlloc(nTerm, PS_TYPE_F64);
     1642    B->n = B->nalloc;
    16321643    // Initialize data structures.
    16331644    if (!psImageInit(A, 0.0) || !psVectorInit(B, 0.0)) {
     
    20022013    psVector *fit   = NULL;
    20032014    psVector *resid = psVectorAlloc(f->n, PS_TYPE_F64);
     2015    resid->n = resid->nalloc;
    20042016
    20052017    // eventual expansion: user supplies one of various stats option pairs,
     
    21742186    A = psImageAlloc(nTerm, nTerm, PS_TYPE_F64);
    21752187    B = psVectorAlloc(nTerm, PS_TYPE_F64);
     2188    B->n = B->nalloc;
    21762189    // Initialize data structures.
    21772190    if (!psImageInit(A, 0.0) || !psVectorInit(B, 0.0)) {
     
    25962609    psVector *fit   = NULL;
    25972610    psVector *resid = psVectorAlloc(f->n, PS_TYPE_F64);
     2611    resid->n = resid->nalloc;
    25982612
    25992613    // eventual expansion: user supplies one of various stats option pairs,
  • trunk/psLib/src/math/psMinimizePowell.c

    r6449 r6484  
    1111 *  NOTE: XXX: The SDR is silent about data types.  F32 is implemented here.
    1212 *
    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 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    525525        p_psMemSetPersistent(myParamMask, true);
    526526        p_psMemSetPersistent(myParamMask->data.U8, true);
    527         for (i=0;i<myParamMask->n;i++) {
     527        for (i=0;i<myParamMask->nalloc;i++) {
    528528            myParamMask->data.U8[i] = 0;
     529            myParamMask->n++;
    529530        }
    530531    } else {
     
    543544                ((psVector *) (v->data[i]))->data.F32[j] = 0.0;
    544545            }
     546            ((psVector *)(v->data[i]))->n++;
    545547        }
    546548        v->n++;
     
    550552    for (i=0;i<numDims;i++) {
    551553        Q->data.F32[i] = params->data.F32[i];
     554        Q->n++;
    552555    }
    553556
     
    595598            if (myParamMask->data.U8[i] == 0) {
    596599                u->data.F32[i] = Q->data.F32[i] - params->data.F32[i];
     600                u->n++;
    597601
    598602                psTrace(__func__, 6, "u[i]=Q[i]-P[i] (%f = %f - %f)\n", u->data.F32[i],
     
    602606            } else {
    603607                u->data.F32[i] = 0.0;
     608                u->n++;
    604609            }
    605610        }
  • trunk/psLib/src/math/psPolynomial.c

    r6437 r6484  
    77*  polynomials.  It also contains a Gaussian functions.
    88*
    9 *  @version $Revision: 1.143 $ $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 $
    1111*
    1212*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    589589    for (unsigned int i = 0; i < Npts; i++) {
    590590        gauss->data.F32[i] = mean + p_psRandomGaussian(r, sigma);
     591        gauss->n++;
    591592    }
    592593    psFree(r);
     
    802803        for (unsigned int i=0;i<x->n;i++) {
    803804            tmp->data.F64[i] = psPolynomial1DEval(poly, x->data.F64[i]);
     805            tmp->n++;
    804806        }
    805807        break;
     
    808810        for (unsigned int i=0;i<x->n;i++) {
    809811            tmp->data.F32[i] = psPolynomial1DEval(poly, x->data.F32[i]);
     812            tmp->n++;
    810813        }
    811814        break;
     
    869872        for (unsigned int i=0; i<vecLen; i++) {
    870873            tmp->data.F32[i] = psPolynomial2DEval(poly,x->data.F32[i],y->data.F32[i]);
     874            tmp->n++;
    871875        }
    872876        break;
     
    883887        for (unsigned int i=0; i<vecLen; i++) {
    884888            tmp->data.F64[i] = psPolynomial2DEval(poly,x->data.F64[i],y->data.F64[i]);
     889            tmp->n++;
    885890        }
    886891        break;
     
    944949    // Evaluate polynomial
    945950    // 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++;
    9771006        }
    9781007    }
     
    10401069    // Evaluate polynomial
    10411070    // 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],
    11051181                                                  t->data.F64[i]);
     1182            tmp->n++;
    11061183        }
    11071184    }
  • trunk/psLib/src/math/psSpline.c

    r6437 r6484  
    11/** @file psSpline.c
    22*
    3 *  @brief Contains basic spline allocation, deallocation, fitting, 
     3*  @brief Contains basic spline allocation, deallocation, fitting,
    44*         and evaluation routines.
    55*
    66*  This file contains the routines that allocate, free, and evaluate splines.
    77*
    8 *  @version $Revision: 1.136 $ $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 $
    1010*
    1111*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    239239            for (psS32 i = 0 ; i < x->n ; i++) {
    240240                spline->knots->data.F32[i] = x->data.F32[i];
     241                spline->knots->n++;
    241242            }
    242243        } else if (x->type.type == PS_TYPE_F64) {
    243244            for (psS32 i = 0 ; i < x->n ; i++) {
    244245                spline->knots->data.F32[i] = (psF32) x->data.F64[i];
     246                spline->knots->n++;
    245247            }
    246248        }
     
    248250        for (psS32 i = 0 ; i < y->n ; i++) {
    249251            spline->knots->data.F32[i] = (psF32) i;
     252            spline->knots->n++;
    250253        }
    251254    }
     
    412415        for (psS32 i=0;i<x->n;i++) {
    413416            tmpVector->data.F32[i] = psSpline1DEval(spline, x->data.F32[i]);
     417            tmpVector->n++;
    414418        }
    415419    } else if (x->type.type == PS_TYPE_F64) {
    416420        for (psS32 i=0;i<x->n;i++) {
    417421            tmpVector->data.F32[i] = psSpline1DEval(spline, (psF32) x->data.F64[i]);
     422            tmpVector->n++;
    418423        }
    419424    }
  • trunk/psLib/src/math/psStats.c

    r6449 r6484  
    1616 * use ->min and ->max (PS_STAT_USE_RANGE)
    1717 *
    18  *  @version $Revision: 1.169 $ $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 $
    2020 *
    2121 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    569569    // Allocate temporary vectors for the data.
    570570    unsortedVector = psVectorAlloc(nValues, PS_TYPE_F32);
     571    unsortedVector->n = nValues;
    571572
    572573    // Determine if we must only use data points within a min/max range.
     
    657658    psS32 numBins = histogram->nums->n;
    658659    psVector *smooth = psVectorAlloc(numBins, PS_TYPE_F32);
     660    smooth->n = smooth->nalloc;
    659661    psS32 jMin = 0;
    660662    psS32 jMax = 0;
     
    783785    // Allocate temporary vectors for the data.
    784786    unsortedVector = psVectorAlloc(nValues, PS_TYPE_F32);
     787    unsortedVector->n = unsortedVector->nalloc;
    785788
    786789    if (stats->options & PS_STAT_USE_RANGE) {
     
    10371040    // However, we do no want to modify the original mask vector.
    10381041    tmpMask = psVectorAlloc(myVector->n, PS_TYPE_U8);
     1042    tmpMask->n = tmpMask->nalloc;
    10391043
    10401044    // If we were called with a mask vector, then initialize the temporary
     
    11981202    psVector *x = psVectorAlloc(3, PS_TYPE_F64);
    11991203    psVector *y = psVectorAlloc(3, PS_TYPE_F64);
     1204    x->n = 3;
     1205    y->n = 3;
    12001206    psF32 tmpFloat = 0.0f;
    12011207
     
    13131319    if (deriv == NULL) {
    13141320        deriv = psVectorAlloc(2, PS_TYPE_F32);
     1321        deriv->n = 2;
    13151322    } else {
    13161323        PS_ASSERT_VECTOR_SIZE(deriv, 2, NAN);
     
    13651372    psS32 rcBool = false;
    13661373    psVector *tmpMaskVec = psVectorAlloc(myVector->n, PS_TYPE_U8);
     1374    tmpMaskVec->n = tmpMaskVec->nalloc;
    13671375    if (maskVector != NULL) {
    13681376        for (psS32 i = 0 ; i < myVector->n ; i++) {
     
    18501858        psArray *x = psArrayAlloc((1 + (binMax - binMin)));
    18511859        psS32 j = 0;
     1860        y->n = y->nalloc;
    18521861
    18531862        for (psS32 i = binMin ; i <= binMax ; i++) {
     
    18561865            x->n++;
    18571866            ((psVector *) x->data[j])->data.F32[0] = PS_BIN_MIDPOINT(newHistogram, i);
     1867            ((psVector *) x->data[j])->n++;
    18581868            j++;
    18591869        }
     
    18861896        psMinimization *min = psMinimizationAlloc(100, 0.01);
    18871897        psVector *params = psVectorAlloc(2, PS_TYPE_F32);
     1898        params->n = params->nalloc;
    18881899        // Initial guess for the mean ([0]) and standard dev.
    18891900        params->data.F32[0] = stats->robustMedian;
     
    20492060    // Allocate the bins, and initialize them to zero.
    20502061    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++) {
    20522063        newHist->nums->data.F32[i] = 0.0;
     2064        newHist->nums->n++;
    20532065    }
    20542066
     
    20942106    // then there are N-1 bins.
    20952107    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++) {
    20972109        newHist->nums->data.F32[i] = 0.0;
     2110        newHist->nums->n++;
    20982111    }
    20992112
     
    23662379        for (i = 0; i < in->n; i++) {
    23672380            tmp->data.F32[i] = (psF32)in->data.S8[i];
     2381            tmp->n++;
    23682382        }
    23692383    } else if (in->type.type == PS_TYPE_S16) {
     
    23712385        for (i = 0; i < in->n; i++) {
    23722386            tmp->data.F32[i] = (psF32) in->data.S16[i];
     2387            tmp->n++;
    23732388        }
    23742389    } else if (in->type.type == PS_TYPE_S32) {
     
    23762391        for (i = 0; i < in->n; i++) {
    23772392            tmp->data.F32[i] = (psF32)in->data.S32[i];
     2393            tmp->n++;
    23782394        }
    23792395    } else if (in->type.type == PS_TYPE_S64) {
     
    23812397        for (i = 0; i < in->n; i++) {
    23822398            tmp->data.F32[i] = (psF32)in->data.S64[i];
     2399            tmp->n++;
    23832400        }
    23842401    } else if (in->type.type == PS_TYPE_U8) {
     
    23862403        for (i = 0; i < in->n; i++) {
    23872404            tmp->data.F32[i] = (psF32)in->data.U8[i];
     2405            tmp->n++;
    23882406        }
    23892407    } else if (in->type.type == PS_TYPE_U16) {
     
    23912409        for (i = 0; i < in->n; i++) {
    23922410            tmp->data.F32[i] = (psF32)in->data.U16[i];
     2411            tmp->n++;
    23932412        }
    23942413    } else if (in->type.type == PS_TYPE_U32) {
     
    23962415        for (i = 0; i < in->n; i++) {
    23972416            tmp->data.F32[i] = (psF32)in->data.U32[i];
     2417            tmp->n++;
    23982418        }
    23992419    } else if (in->type.type == PS_TYPE_U64) {
     
    24012421        for (i = 0; i < in->n; i++) {
    24022422            tmp->data.F32[i] = (psF32)in->data.U64[i];
     2423            tmp->n++;
    24032424        }
    24042425    } else if (in->type.type == PS_TYPE_F64) {
     
    24062427        for (i = 0; i < in->n; i++) {
    24072428            tmp->data.F32[i] = (psF32)in->data.F64[i];
     2429            tmp->n++;
    24082430        }
    24092431    } else if (in->type.type == PS_TYPE_F32) {
     
    24632485    inF32 = p_psConvertToF32((psVector *) in);
    24642486    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);
    24682495    errorsF32 = p_psConvertToF32((psVector *) errors);
    24692496    if (errorsF32 == NULL) {
     
    24712498        mustFreeVectorErrors = 0;
    24722499    }
    2473 
     2500    //    inF32->n = inF32->nalloc;
     2501    //    errorsF32->n = errorsF32->nalloc;
    24742502    if ((stats->options & PS_STAT_USE_RANGE) && (stats->min >= stats->max)) {
    24752503        PS_ASSERT_FLOAT_LARGER_THAN_OR_EQUAL(stats->max, stats->min, stats);
  • trunk/psLib/src/mathtypes/psVector.c

    r6227 r6484  
    99*  @author Robert DeSonia, MHPCC
    1010*
    11 *  @version $Revision: 1.64 $ $Name: not supported by cvs2svn $
    12 *  @date $Date: 2006-01-28 01:12:14 $
     11*  @version $Revision: 1.65 $ $Name: not supported by cvs2svn $
     12*  @date $Date: 2006-02-24 23:43:15 $
    1313*
    1414*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    8888    psVec->type.type = type;
    8989    P_PSVECTOR_SET_NALLOC(psVec,nalloc);
    90     psVec->n = nalloc;
     90    //    psVec->n = nalloc;
     91    psVec->n = 0;
    9192
    9293    // Create vector data array
     
    205206
    206207    output = psVectorRecycle(output, nElements, type);
     208    output->n = nElements;
    207209
    208210    #define PSVECTOR_COPY(INTYPE,OUTTYPE) { \
     
    754756    int nBin = (upper - lower) / delta; \
    755757    psVector *vec = psVectorRecycle(input, nBin, PS_TYPE_##TYPE); \
     758    vec->n = nBin; \
    756759    for (int i = 0; i < nBin; i++) \
    757760    { \
  • trunk/psLib/src/types/psArray.c

    r6445 r6484  
    99 *  @author Ross Harman, MHPCC
    1010 *
    11  *  @version $Revision: 1.41 $ $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 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    6464
    6565    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
    6867    // Create vector data array
    6968    psArr->data = psAlloc(nalloc * sizeof(psPtr));
     69    memset(psArr->data, 0, sizeof(void*) * nalloc);  //set the initial values of data to NULL
    7070
    7171    return psArr;
     
    8686        }
    8787        // Realloc after decrementation to avoid accessing freed array elements
     88        long n = in->n;
    8889        in->data = psRealloc(in->data, nalloc * sizeof(psPtr));
    8990        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        }
    9094    }
    9195
  • trunk/psLib/src/types/psLookupTable.c

    r6445 r6484  
    77*  @author Ross Harman, MHPCC
    88*
    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 $
    1111*
    1212*  Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii
     
    600600    // Check if array is sorted on the index column
    601601    psVector* sortedIndex = psVectorAlloc(numRows,PS_TYPE_U32);
     602    sortedIndex->n = numRows;
    602603    sortedIndex = psVectorSortIndex(sortedIndex,indexColumnVector);
    603604    for(psS32 i = 0; i < numRows; i++ ) {
     
    615616            psS32 type = ((psVector*)(vectors->data[j]))->type.type;
    616617            newValueArray->data[j] = psVectorAlloc(numRows,type);
     618            ((psVector*)(newValueArray->data[j]))->n = numRows;
    617619            newValueArray->n++;
    618620        }
  • trunk/psLib/src/types/psMetadataConfig.c

    r6191 r6484  
    1010*  @author Eric Van Alst, MHPCC
    1111*
    12 *  @version $Revision: 1.52 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2006-01-25 22:33:41 $
     12*  @version $Revision: 1.53 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2006-02-24 23:43:15 $
    1414*
    1515*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    363363                        elemType);
    364364            }
    365 
     365            vec->n++;
    366366            while(*end==' ' || *end==',') {
    367367                end++;
  • trunk/psLib/test/db/verified/tst_psDB.stderr

    r4581 r6484  
    146146<DATE><TIME>|<HOST>|E|psVectorAlloc (FILE:LINENO)
    147147    Input psVector is an unsupported type (0x0).
     148<DATE><TIME>|<HOST>|E|psDBSelectColumnNum (FILE:LINENO)
     149    Invalid type specified in psDBSelectColumnNum.
    148150
    149151---> TESTPOINT PASSED (psDB{dbSelectColumnNum} | tst_psDB.c)
  • trunk/psLib/test/fits/tst_psFits.c

    r6445 r6484  
    66*  @author Robert DeSonia, MHPCC
    77*
    8 *  @version $Revision: 1.17 $ $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 $
    1010*
    1111*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    198198        for (int x=0; x < 4; x++) {
    199199            vec->data.S32[x] = x*10+row;
     200            vec->n++;
    200201        }
    201202        psMetadataAdd(header,PS_LIST_TAIL, "MYVEC",
  • trunk/psLib/test/imageops/tst_psImageConvolve.c

    r4547 r6484  
    55 *  @author Robert DeSonia, MHPCC
    66 *
    7  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2005-07-13 02:47:00 $
     7 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2006-02-24 23:43:15 $
    99 *
    1010 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    129129    for (psS32 i = 0; i < size; i++) {
    130130        xVec->data.U32[i] = x[i];
     131        xVec->n++;
    131132        yVec->data.U32[i] = y[i];
     133        yVec->n++;
    132134        tVec->data.U32[i] = t[i];
     135        tVec->n++;
    133136    }
    134137
     
    186189    for (psS32 i = 0; i < size; i++) {
    187190        xVec->data.S16[i] = x[i];
     191        xVec->n++;
    188192        yVec->data.S16[i] = y[i];
     193        yVec->n++;
    189194        tVec->data.S16[i] = t[i];
     195        tVec->n++;
    190196    }
    191197
     
    242248
    243249    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);
    245253        yVec->data.F32[i] = y[i]+0.2;
     254        yVec->n++;
    246255        tVec->data.F32[i] = t[i]+0.3;
     256        tVec->n++;
    247257    }
    248258
  • trunk/psLib/test/imageops/tst_psImagePixelExtract.c

    r6294 r6484  
    66*  @author Robert DeSonia, MHPCC
    77*
    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 $
    1010*
    1111*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    532532    for (psS32 i=0; i < 10; i++) {
    533533        radii->data.F32[i] = 10+i*10;
     534        radii->n++;
    534535    }
    535536
  • trunk/psLib/test/imageops/verified/tst_psImagePixelExtract.stderr

    r5641 r6484  
    138138    Following should be an error.
    139139<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.
    141141<DATE><TIME>|<HOST>|I|testImageRadialCut
    142142    Following should be an error.
  • trunk/psLib/test/math/tst_psMinimizeLMM.c

    r6449 r6484  
    6161    myCoords->n = NUM_DATA_POINTS;
    6262    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;
    6366
    6467    for (psS32 i=0;i<NUM_DATA_POINTS;i++) {
     
    6669        ((psVector *) (myCoords->data[i]))->data.F32[0] = (float) (i+10);
    6770        ((psVector *) (myCoords->data[i]))->data.F32[1] = (float) (i+3);
     71        ((psVector *) (myCoords->data[i]))->n = 2;
    6872        psTrace(__func__, 5, "x[%d] is vector (%f, %f)\n", i, ((psVector *) (myCoords->data[i]))->data.F32[0],
    6973                ((psVector *) (myCoords->data[i]))->data.F32[1]);
  • trunk/psLib/test/math/tst_psMinimizePowell.c

    r6449 r6484  
    8181    myParams = psVectorAlloc(NUM_PARAMS, PS_TYPE_F32);
    8282    myParamMask = psVectorAlloc(NUM_PARAMS, PS_TYPE_U8);
     83    myParams->n = NUM_PARAMS;
     84    myParamMask->n = NUM_PARAMS;
    8385    min = psMinimizationAlloc(100, 0.01);
    8486
     
    164166        ((psVector *) (myCoords->data[i]))->data.F32[0] = (float) (i+10);
    165167        ((psVector *) (myCoords->data[i]))->data.F32[1] = (float) (i+3);
     168        ((psVector *) (myCoords->data[i]))->n = 2;
    166169    }
    167170    for (i=0;i<NUM_PARAMS;i++) {
     
    169172        myParams->data.F32[i] = 0.0;
    170173        myParams->data.F32[i] = (float) i;
     174        myParams->n++;
    171175    }
    172176
     
    239243        ((psVector *) (myCoords->data[i]))->data.F32[0] = (float) (i+10);
    240244        ((psVector *) (myCoords->data[i]))->data.F32[1] = (float) (i+3);
     245        ((psVector *) (myCoords->data[i]))->n++;
    241246    }
    242247    for (i=0;i<NUM_PARAMS;i++) {
     
    245250        myParams->data.F32[i] = (float) i;
    246251        myParamMask->data.U8[i] = 0;
     252        myParams->n++;
     253        myParamMask->n++;
    247254    }
    248255
  • trunk/psLib/test/math/tst_psPolyFit1D.c

    r6304 r6484  
    9999        printf(" using a psF32 x vector\n");
    100100        x = psVectorAlloc(numData, PS_TYPE_F32);
     101        x->n = numData;
    101102        for (psS32 i=0;i<numData;i++) {
    102103            x->data.F32[i] = (psF32) i;
     
    111112        printf(" using a psS32 x vector\n");
    112113        x = psVectorAlloc(numData, PS_TYPE_S32);
     114        x->n = numData;
    113115        for (psS32 i=0;i<numData;i++) {
    114116            x->data.S32[i] = (psS32) i;
     
    123125        printf(" using a psF64 x vector\n");
    124126        x = psVectorAlloc(numData, PS_TYPE_F64);
     127        x->n = numData;
    125128        for (psS32 i=0;i<numData;i++) {
    126129            x->data.F64[i] = (psF64) i;
     
    139142        printf(" using a psF32 f vector\n");
    140143        f = psVectorAlloc(numData, PS_TYPE_F32);
     144        f->n = numData;
    141145        for (psS32 i=0;i<numData;i++) {
    142146            f->data.F32[i] = setData((psF32) i);
     
    159163        printf(" using a psS32 f vector\n");
    160164        f = psVectorAlloc(numData, PS_TYPE_S32);
     165        f->n = numData;
    161166        for (psS32 i=0;i<numData;i++) {
    162167            f->data.S32[i] = (psS32) setData((psF32) i);
     
    179184        printf(" using a psF64 f vector\n");
    180185        f = psVectorAlloc(numData, PS_TYPE_F64);
     186        f->n = numData;
    181187        for (psS32 i=0;i<numData;i++) {
    182188            f->data.F64[i] = (psF64) setData((psF32) i);
     
    203209        printf(" using a psF32 fErr vector\n");
    204210        fErr = psVectorAlloc(numData, PS_TYPE_F32);
     211        fErr->n = numData;
    205212        for (psS32 i=0;i<numData;i++) {
    206213            fErr->data.F32[i] = YERR;
     
    211218        printf(" using a psS32 fErr vector\n");
    212219        fErr = psVectorAlloc(numData, PS_TYPE_S32);
     220        fErr->n = numData;
    213221        for (psS32 i=0;i<numData;i++) {
    214222            fErr->data.S32[i] = (psS32) YERR;
     
    219227        printf(" using a psF64 fErr vector\n");
    220228        fErr = psVectorAlloc(numData, PS_TYPE_F64);
     229        fErr->n = numData;
    221230        for (psS32 i=0;i<numData;i++) {
    222231            fErr->data.F64[i] = YERR;
     
    231240        printf(" using a psU8 mask vector\n");
    232241        mask = psVectorAlloc(numData, PS_TYPE_U8);
     242        mask->n = numData;
    233243        for (psS32 i=0;i<numData;i++) {
    234244            mask->data.U8[i] = 0;
     
    239249        printf(" using a psS32 mask vector\n");
    240250        mask = psVectorAlloc(numData, PS_TYPE_S32);
     251        mask->n = numData;
    241252        for (psS32 i=0;i<numData;i++) {
    242253            mask->data.S32[i] = 0;
  • trunk/psLib/test/math/tst_psPolyFit2D.c

    r6226 r6484  
    100100        printf(" using a psF32 x vector\n");
    101101        x = psVectorAlloc(numData, PS_TYPE_F32);
     102        x->n = numData;
    102103        for (psS32 i=0;i<numData;i++) {
    103104            x->data.F32[i] = (psF32) i;
     
    108109        printf(" using a psS32 x vector\n");
    109110        x = psVectorAlloc(numData, PS_TYPE_S32);
     111        x->n = numData;
    110112        for (psS32 i=0;i<numData;i++) {
    111113            x->data.S32[i] = (psS32) i;
     
    116118        printf(" using a psF64 x vector\n");
    117119        x = psVectorAlloc(numData, PS_TYPE_F64);
     120        x->n = numData;
    118121        for (psS32 i=0;i<numData;i++) {
    119122            x->data.F64[i] = (psF64) i;
     
    129132        printf(" using a psF32 y vector\n");
    130133        y = psVectorAlloc(numData, PS_TYPE_F32);
     134        y->n = numData;
    131135        for (psS32 i=0;i<numData;i++) {
    132136            y->data.F32[i] = (psF32) i;
     
    137141        printf(" using a psS32 y vector\n");
    138142        y = psVectorAlloc(numData, PS_TYPE_S32);
     143        y->n = numData;
    139144        for (psS32 i=0;i<numData;i++) {
    140145            y->data.S32[i] = (psS32) i;
     
    145150        printf(" using a psF64 y vector\n");
    146151        y = psVectorAlloc(numData, PS_TYPE_F64);
     152        y->n = numData;
    147153        for (psS32 i=0;i<numData;i++) {
    148154            y->data.F64[i] = (psF64) i;
     
    157163        printf(" using a psF32 f vector\n");
    158164        f = psVectorAlloc(numData, PS_TYPE_F32);
     165        f->n = numData;
    159166        for (psS32 i=0;i<numData;i++) {
    160167            f->data.F32[i] = setData((psF32) i, (psF32) i);
     
    177184        printf(" using a psS32 f vector\n");
    178185        f = psVectorAlloc(numData, PS_TYPE_S32);
     186        f->n = numData;
    179187        for (psS32 i=0;i<numData;i++) {
    180188            f->data.S32[i] = (psS32) setData((psF32) i, (psF32) i);
     
    197205        printf(" using a psF64 f vector\n");
    198206        f = psVectorAlloc(numData, PS_TYPE_F64);
     207        f->n = numData;
    199208        for (psS32 i=0;i<numData;i++) {
    200209            f->data.F64[i] = (psF64) setData((psF32) i, (psF32) i);
     
    221230        printf(" using a psF32 fErr vector\n");
    222231        fErr = psVectorAlloc(numData, PS_TYPE_F32);
     232        fErr->n = numData;
    223233        for (psS32 i=0;i<numData;i++) {
    224234            fErr->data.F32[i] = YERR;
     
    237247        printf(" using a psF64 fErr vector\n");
    238248        fErr = psVectorAlloc(numData, PS_TYPE_F64);
     249        fErr->n = numData;
    239250        for (psS32 i=0;i<numData;i++) {
    240251            fErr->data.F64[i] = YERR;
     
    249260        printf(" using a psU8 mask vector\n");
    250261        mask = psVectorAlloc(numData, PS_TYPE_U8);
     262        mask->n = numData;
    251263        for (psS32 i=0;i<numData;i++) {
    252264            mask->data.U8[i] = 0;
     
    257269        printf(" using a psS32 mask vector\n");
    258270        mask = psVectorAlloc(numData, PS_TYPE_S32);
     271        mask->n = numData;
    259272        for (psS32 i=0;i<numData;i++) {
    260273            mask->data.S32[i] = 0;
  • trunk/psLib/test/math/tst_psPolyFit3D.c

    r6226 r6484  
    117117        printf(" using a psF32 x vector\n");
    118118        x = psVectorAlloc(numData, PS_TYPE_F32);
     119        x->n = numData;
    119120        for (psS32 i=0;i<numData;i++) {
    120121            x->data.F32[i] = (psF32) i;
     
    125126        printf(" using a psS32 x vector\n");
    126127        x = psVectorAlloc(numData, PS_TYPE_S32);
     128        x->n = numData;
    127129        for (psS32 i=0;i<numData;i++) {
    128130            x->data.S32[i] = (psS32) i;
     
    133135        printf(" using a psF64 x vector\n");
    134136        x = psVectorAlloc(numData, PS_TYPE_F64);
     137        x->n = numData;
    135138        for (psS32 i=0;i<numData;i++) {
    136139            x->data.F64[i] = (psF64) i;
     
    146149        printf(" using a psF32 y vector\n");
    147150        y = psVectorAlloc(numData, PS_TYPE_F32);
     151        y->n = numData;
    148152        for (psS32 i=0;i<numData;i++) {
    149153            y->data.F32[i] = (psF32) i;
     
    154158        printf(" using a psS32 y vector\n");
    155159        y = psVectorAlloc(numData, PS_TYPE_S32);
     160        y->n = numData;
    156161        for (psS32 i=0;i<numData;i++) {
    157162            y->data.S32[i] = (psS32) i;
     
    162167        printf(" using a psF64 y vector\n");
    163168        y = psVectorAlloc(numData, PS_TYPE_F64);
     169        y->n = numData;
    164170        for (psS32 i=0;i<numData;i++) {
    165171            y->data.F64[i] = (psF64) i;
     
    174180        printf(" using a psF32 z vector\n");
    175181        z = psVectorAlloc(numData, PS_TYPE_F32);
     182        z->n = numData;
    176183        for (psS32 i=0;i<numData;i++) {
    177184            z->data.F32[i] = (psF32) i;
     
    182189        printf(" using a psS32 z vector\n");
    183190        z = psVectorAlloc(numData, PS_TYPE_S32);
     191        z->n = numData;
    184192        for (psS32 i=0;i<numData;i++) {
    185193            z->data.S32[i] = (psS32) i;
     
    190198        printf(" using a psF64 z vector\n");
    191199        z = psVectorAlloc(numData, PS_TYPE_F64);
     200        z->n = numData;
    192201        for (psS32 i=0;i<numData;i++) {
    193202            z->data.F64[i] = (psF64) i;
     
    203212        printf(" using a psF32 f vector\n");
    204213        f = psVectorAlloc(numData, PS_TYPE_F32);
     214        f->n = numData;
    205215        for (psS32 i=0;i<numData;i++) {
    206216            f->data.F32[i] = setData((psF32) i, (psF32) i, (psF32) i);
     
    223233        printf(" using a psS32 f vector\n");
    224234        f = psVectorAlloc(numData, PS_TYPE_S32);
     235        f->n = numData;
    225236        for (psS32 i=0;i<numData;i++) {
    226237            f->data.S32[i] = (psS32) setData((psF32) i, (psF32) i, (psF32) i);
     
    243254        printf(" using a psF64 f vector\n");
    244255        f = psVectorAlloc(numData, PS_TYPE_F64);
     256        f->n = numData;
    245257        for (psS32 i=0;i<numData;i++) {
    246258            f->data.F64[i] = (psF64) setData((psF32) i, (psF32) i, (psF32) i);
     
    267279        printf(" using a psF32 fErr vector\n");
    268280        fErr = psVectorAlloc(numData, PS_TYPE_F32);
     281        fErr->n = numData;
    269282        for (psS32 i=0;i<numData;i++) {
    270283            fErr->data.F32[i] = YERR;
     
    275288        printf(" using a psS32 fErr vector\n");
    276289        fErr = psVectorAlloc(numData, PS_TYPE_S32);
     290        fErr->n = numData;
    277291        for (psS32 i=0;i<numData;i++) {
    278292            fErr->data.S32[i] = (psS32) YERR;
     
    283297        printf(" using a psF64 fErr vector\n");
    284298        fErr = psVectorAlloc(numData, PS_TYPE_F64);
     299        fErr->n = numData;
    285300        for (psS32 i=0;i<numData;i++) {
    286301            fErr->data.F64[i] = YERR;
     
    295310        printf(" using a psU8 mask vector\n");
    296311        mask = psVectorAlloc(numData, PS_TYPE_U8);
     312        mask->n = numData;
    297313        for (psS32 i=0;i<numData;i++) {
    298314            mask->data.U8[i] = 0;
     
    303319        printf(" using a psS32 mask vector\n");
    304320        mask = psVectorAlloc(numData, PS_TYPE_S32);
     321        mask->n = numData;
    305322        for (psS32 i=0;i<numData;i++) {
    306323            mask->data.S32[i] = 0;
  • trunk/psLib/test/math/tst_psPolyFit4D.c

    r6226 r6484  
    130130        printf(" using a psF32 x vector\n");
    131131        x = psVectorAlloc(numData, PS_TYPE_F32);
     132        x->n = numData;
    132133        for (psS32 i=0;i<numData;i++) {
    133134            x->data.F32[i] = (psF32) i;
     
    138139        printf(" using a psS32 x vector\n");
    139140        x = psVectorAlloc(numData, PS_TYPE_S32);
     141        x->n = numData;
    140142        for (psS32 i=0;i<numData;i++) {
    141143            x->data.S32[i] = (psS32) i;
     
    146148        printf(" using a psF64 x vector\n");
    147149        x = psVectorAlloc(numData, PS_TYPE_F64);
     150        x->n = numData;
    148151        for (psS32 i=0;i<numData;i++) {
    149152            x->data.F64[i] = (psF64) i;
     
    159162        printf(" using a psF32 y vector\n");
    160163        y = psVectorAlloc(numData, PS_TYPE_F32);
     164        y->n = numData;
    161165        for (psS32 i=0;i<numData;i++) {
    162166            y->data.F32[i] = (psF32) i;
     
    167171        printf(" using a psS32 y vector\n");
    168172        y = psVectorAlloc(numData, PS_TYPE_S32);
     173        y->n = numData;
    169174        for (psS32 i=0;i<numData;i++) {
    170175            y->data.S32[i] = (psS32) i;
     
    175180        printf(" using a psF64 y vector\n");
    176181        y = psVectorAlloc(numData, PS_TYPE_F64);
     182        y->n = numData;
    177183        for (psS32 i=0;i<numData;i++) {
    178184            y->data.F64[i] = (psF64) i;
     
    187193        printf(" using a psF32 z vector\n");
    188194        z = psVectorAlloc(numData, PS_TYPE_F32);
     195        z->n = numData;
    189196        for (psS32 i=0;i<numData;i++) {
    190197            z->data.F32[i] = (psF32) i;
     
    195202        printf(" using a psS32 z vector\n");
    196203        z = psVectorAlloc(numData, PS_TYPE_S32);
     204        z->n = numData;
    197205        for (psS32 i=0;i<numData;i++) {
    198206            z->data.S32[i] = (psS32) i;
     
    203211        printf(" using a psF64 z vector\n");
    204212        z = psVectorAlloc(numData, PS_TYPE_F64);
     213        z->n = numData;
    205214        for (psS32 i=0;i<numData;i++) {
    206215            z->data.F64[i] = (psF64) i;
     
    215224        printf(" using a psF32 t vector\n");
    216225        t = psVectorAlloc(numData, PS_TYPE_F32);
     226        t->n = numData;
    217227        for (psS32 i=0;i<numData;i++) {
    218228            t->data.F32[i] = (psF32) i;
     
    223233        printf(" using a psS32 t vector\n");
    224234        t = psVectorAlloc(numData, PS_TYPE_S32);
     235        t->n = numData;
    225236        for (psS32 i=0;i<numData;i++) {
    226237            t->data.S32[i] = (psS32) i;
     
    231242        printf(" using a psF64 t vector\n");
    232243        t = psVectorAlloc(numData, PS_TYPE_F64);
     244        t->n = numData;
    233245        for (psS32 i=0;i<numData;i++) {
    234246            t->data.F64[i] = (psF64) i;
     
    244256        printf(" using a psF32 f vector\n");
    245257        f = psVectorAlloc(numData, PS_TYPE_F32);
     258        f->n = numData;
    246259        for (psS32 i=0;i<numData;i++) {
    247260            f->data.F32[i] = setData((psF32) i, (psF32) i, (psF32) i, (psF32) i);
     
    264277        printf(" using a psS32 f vector\n");
    265278        f = psVectorAlloc(numData, PS_TYPE_S32);
     279        f->n = numData;
    266280        for (psS32 i=0;i<numData;i++) {
    267281            f->data.S32[i] = (psS32) setData((psF32) i, (psF32) i, (psF32) i, (psF32) i);
     
    284298        printf(" using a psF64 f vector\n");
    285299        f = psVectorAlloc(numData, PS_TYPE_F64);
     300        f->n = numData;
    286301        for (psS32 i=0;i<numData;i++) {
    287302            f->data.F64[i] = (psF64) setData((psF32) i, (psF32) i, (psF32) i, (psF32) i);
     
    308323        printf(" using a psF32 fErr vector\n");
    309324        fErr = psVectorAlloc(numData, PS_TYPE_F32);
     325        fErr->n = numData;
    310326        for (psS32 i=0;i<numData;i++) {
    311327            fErr->data.F32[i] = YERR;
     
    316332        printf(" using a psS32 fErr vector\n");
    317333        fErr = psVectorAlloc(numData, PS_TYPE_S32);
     334        fErr->n = numData;
    318335        for (psS32 i=0;i<numData;i++) {
    319336            fErr->data.S32[i] = (psS32) YERR;
     
    324341        printf(" using a psF64 fErr vector\n");
    325342        fErr = psVectorAlloc(numData, PS_TYPE_F64);
     343        fErr->n = numData;
    326344        for (psS32 i=0;i<numData;i++) {
    327345            fErr->data.F64[i] = YERR;
     
    336354        printf(" using a psU8 mask vector\n");
    337355        mask = psVectorAlloc(numData, PS_TYPE_U8);
     356        mask->n = numData;
    338357        for (psS32 i=0;i<numData;i++) {
    339358            mask->data.U8[i] = 0;
     
    344363        printf(" using a psS32 mask vector\n");
    345364        mask = psVectorAlloc(numData, PS_TYPE_S32);
     365        mask->n = numData;
    346366        for (psS32 i=0;i<numData;i++) {
    347367            mask->data.S32[i] = 0;
  • trunk/psLib/test/math/tst_psPolynomialEval1D.c

    r6304 r6484  
    44*  ORD and CHEB type polynomials.
    55*
    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 $
    88*
    99*  XXX: Probably should test single- and multi-dimensional polynomials in
     
    1111*
    1212*  XXX: define ORDERS, not TERMS
    13 * 
     13*
    1414*
    1515* Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii
     
    124124        inputOrd->data.F64[i] = poly1DXValue[i];
    125125        inputCheb->data.F64[i] = poly1DXChebValue[i];
     126        inputOrd->n++;
     127        inputCheb->n++;
    126128    }
    127129
  • trunk/psLib/test/math/tst_psPolynomialEval2D.c

    r6304 r6484  
    44*  ORD and CHEB type polynomials.
    55*
    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 $
    88*
    99* Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii
     
    157157        inputChebX->data.F64[i] = poly2DXYChebValue[i][0];
    158158        inputChebY->data.F64[i] = poly2DXYChebValue[i][1];
     159        inputOrdX->n++;
     160        inputOrdY->n++;
     161        inputChebX->n++;
     162        inputChebY->n++;
    159163    }
    160164
  • trunk/psLib/test/math/tst_psPolynomialEval3D.c

    r6304 r6484  
    44*  ORD and CHEB type polynomials.
    55*
    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 $
    88*
    99* Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii
     
    220220        inputChebY->data.F64[i] = Dpoly3DXYZChebValue[i][1];
    221221        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++;
    222228    }
    223229
  • trunk/psLib/test/math/tst_psPolynomialEval4D.c

    r6304 r6484  
    44*  ORD and CHEB type polynomials.
    55*
    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 $
    88*
    99* Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii
     
    470470        inputChebY->data.F64[i] = Dpoly4DWXYZChebValue[i][2];
    471471        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++;
    472480    }
    473481
  • trunk/psLib/test/math/tst_psRandom.c

    r4951 r6484  
    122122    psRandom *myRNG = NULL;
    123123    psVector *rans = psVectorAlloc(NUM_DATA, PS_TYPE_F64);
     124    rans->n = rans->nalloc;
    124125    psStats *stats = psStatsAlloc(PS_STAT_SAMPLE_MEAN);
    125126
     
    167168    psRandom *myRNG = NULL;
    168169    psVector *rans = psVectorAlloc(NUM_DATA, PS_TYPE_F64);
     170    rans->n = rans->nalloc;
    169171    psStats *stats = psStatsAlloc(PS_STAT_SAMPLE_MEAN);
    170172
     
    214216    psRandom *myRNG = NULL;
    215217    psVector *rans = psVectorAlloc(NUM_DATA, PS_TYPE_F64);
     218    rans->n = rans->nalloc;
    216219    psStats *stats = psStatsAlloc(PS_STAT_SAMPLE_MEAN);
    217220
     
    259262    psRandom *myRNG = NULL;
    260263    psVector *rans00 = psVectorAlloc(NUM_DATA, PS_TYPE_F64);
     264    rans00->n = rans00->nalloc;
    261265    psVector *rans01 = psVectorAlloc(NUM_DATA, PS_TYPE_F64);
     266    rans01->n = rans01->nalloc;
    262267    psVector *rans02 = psVectorAlloc(NUM_DATA, PS_TYPE_F64);
     268    rans02->n = rans02->nalloc;
    263269
    264270    myRNG = psRandomAlloc(PS_RANDOM_TAUS, SEED);
     
    314320    psRandom *myRNG = NULL;
    315321    psVector *rans00 = psVectorAlloc(NUM_DATA, PS_TYPE_F64);
     322    rans00->n = rans00->nalloc;
    316323    psVector *rans01 = psVectorAlloc(NUM_DATA, PS_TYPE_F64);
     324    rans01->n = rans01->nalloc;
    317325    psVector *rans02 = psVectorAlloc(NUM_DATA, PS_TYPE_F64);
     326    rans02->n = rans02->nalloc;
    318327
    319328    myRNG = psRandomAlloc(PS_RANDOM_TAUS, SEED);
     
    357366    psRandom *myRNG = NULL;
    358367    psVector *rans00 = psVectorAlloc(NUM_DATA, PS_TYPE_F64);
     368    rans00->n = rans00->nalloc;
    359369    psVector *rans01 = psVectorAlloc(NUM_DATA, PS_TYPE_F64);
     370    rans01->n = rans01->nalloc;
    360371    psVector *rans02 = psVectorAlloc(NUM_DATA, PS_TYPE_F64);
     372    rans02->n = rans02->nalloc;
    361373
    362374    myRNG = psRandomAlloc(PS_RANDOM_TAUS, SEED);
  • trunk/psLib/test/math/tst_psSpline1D.c

    r6226 r6484  
    1313*  @author GLG, MHPCC
    1414*
    15 *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    16 *  @date $Date: 2006-01-27 20:08:58 $
     15*  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     16*  @date $Date: 2006-02-24 23:43:15 $
    1717*
    1818*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2828// {testFunction, testpointNumber, description, expected rc, boolean-ignore this test}
    2929testDescription 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},
    3333                              {NULL}
    3434                          };
     
    199199    yF32 = psVectorAlloc(NumSplines+1, PS_TYPE_F32);
    200200    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;
    201205
    202206    for (psS32 i=0;i<NumSplines+1;i++) {
     
    274278    yF32 = psVectorAlloc(NumSplines+1, PS_TYPE_F32);
    275279    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;
    276284
    277285    for (psS32 i=0;i<NumSplines+1;i++) {
     
    384392    yF32 = psVectorAlloc(NumSplines+1, PS_TYPE_F32);
    385393    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;
    386398
    387399    for (psS32 i=0;i<NumSplines+1;i++) {
     
    459471    yF32 = psVectorAlloc(NumSplines+1, PS_TYPE_F32);
    460472    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;
    461477
    462478    for (psS32 i=0;i<NumSplines+1;i++) {
     
    559575    yF32 = psVectorAlloc(NumSplines+1, PS_TYPE_F32);
    560576    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;
    561581
    562582    for (psS32 i=0;i<NumSplines+1;i++) {
     
    634654    yF32 = psVectorAlloc(NumSplines+1, PS_TYPE_F32);
    635655    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;
    636660
    637661    for (psS32 i=0;i<NumSplines+1;i++) {
     
    757781    psVector *yF32Test = NULL;
    758782    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
    759788
    760789    for (psS32 i=0;i<NumSplines+1;i++) {
  • trunk/psLib/test/math/tst_psStats07.c

    r6326 r6484  
    7272        for (psS32 i=0;i<numData;i++) {
    7373            in->data.F32[i] = gaussVector->data.F32[i];
     74            in->n++;
    7475        }
    7576
     
    8687        for (psS32 i=0;i<numData;i++) {
    8788            in->data.F64[i] = (psF64) gaussVector->data.F32[i];
     89            in->n++;
    8890        }
    8991
     
    100102        for (psS32 i=0;i<numData;i++) {
    101103            in->data.S8[i] = (psS8) gaussVector->data.F32[i];
     104            in->n++;
    102105        }
    103106
     
    114117        for (psS32 i=0;i<numData;i++) {
    115118            in->data.U16[i] = (psU16) gaussVector->data.F32[i];
     119            in->n++;
    116120        }
    117121
     
    128132        for (psS32 i=0;i<numData;i++) {
    129133            in->data.S32[i] = (psS32) gaussVector->data.F32[i];
     134            in->n++;
    130135        }
    131136
     
    138143    psFree(gaussVector);
    139144
     145    //    in->n = in->nalloc;
    140146    if (flags & TST_ERRORS_NULL) {
    141147        printf("        using a NULL errors vector\n");
     
    147153        for (psS32 i=0;i<numData;i++) {
    148154            errors->data.F32[i] = ERRORS;
     155            errors->n++;
    149156        }
    150157
     
    161168        for (psS32 i=0;i<numData;i++) {
    162169            errors->data.F64[i] = ERRORS;
     170            errors->n++;
    163171        }
    164172
     
    175183        for (psS32 i=0;i<numData;i++) {
    176184            errors->data.S8[i] = (psS8) ERRORS;
     185            errors->n++;
    177186        }
    178187
     
    189198        for (psS32 i=0;i<numData;i++) {
    190199            errors->data.U16[i] = (psU16) ERRORS;
     200            errors->n++;
    191201        }
    192202
     
    203213        for (psS32 i=0;i<numData;i++) {
    204214            errors->data.S32[i] = (psS32) ERRORS;
     215            errors->n++;
    205216        }
    206217
     
    222233        for (psS32 i=0;i<numData;i++) {
    223234            mask->data.U8[i] = (psU8) 0;
     235            mask->n++;
    224236        }
    225237
     
    236248        for (psS32 i=0;i<numData;i++) {
    237249            mask->data.S32[i] = (psS32) 0;
     250            mask->n++;
    238251        }
    239252
  • trunk/psLib/test/math/tst_psStats09.c

    r6307 r6484  
    6868        for (psS32 i=0;i<numData;i++) {
    6969            in->data.F32[i] = (psF32) i;
     70            in->n++;
    7071        }
    7172
     
    8283        for (psS32 i=0;i<numData;i++) {
    8384            in->data.F64[i] = (psF64) i;
     85            in->n++;
    8486        }
    8587
     
    9698        for (psS32 i=0;i<numData;i++) {
    9799            in->data.S8[i] = (psS8) i;
     100            in->n++;
    98101        }
    99102
     
    110113        for (psS32 i=0;i<numData;i++) {
    111114            in->data.U16[i] = (psU16) i;
     115            in->n++;
    112116        }
    113117
     
    124128        for (psS32 i=0;i<numData;i++) {
    125129            in->data.S32[i] = (psS32) i;
     130            in->n++;
    126131        }
    127132
     
    142147        for (psS32 i=0;i<numData;i++) {
    143148            errors->data.F32[i] = ERRORS;
     149            errors->n++;
    144150        }
    145151
     
    156162        for (psS32 i=0;i<numData;i++) {
    157163            errors->data.F64[i] = ERRORS;
     164            errors->n++;
    158165        }
    159166
     
    170177        for (psS32 i=0;i<numData;i++) {
    171178            errors->data.S8[i] = (psS8) ERRORS;
     179            errors->n++;
    172180        }
    173181
     
    184192        for (psS32 i=0;i<numData;i++) {
    185193            errors->data.U16[i] = (psU16) ERRORS;
     194            errors->n++;
    186195        }
    187196
     
    198207        for (psS32 i=0;i<numData;i++) {
    199208            errors->data.S32[i] = (psS32) ERRORS;
     209            errors->n++;
    200210        }
    201211
     
    217227        for (psS32 i=0;i<numData;i++) {
    218228            mask->data.U8[i] = (psU8) 0;
     229            mask->n++;
    219230        }
    220231
     
    231242        for (psS32 i=0;i<numData;i++) {
    232243            mask->data.S32[i] = (psS32) 0;
     244            mask->n++;
    233245        }
    234246
  • trunk/psLib/test/mathtypes/tst_psVector.c

    r6349 r6484  
    1414 *  @author  Ross Harman, MHPCC
    1515 *
    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 $
    1818 *
    1919 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    7070        return 1;
    7171    }
    72     if (psVec->n != psVec->nalloc) {
     72    if (psVec->n != 0) {
    7373        fprintf(stderr,"Vector population = %ld\n", psVec->n);
    7474        return 2;
     
    126126    for(psS32 i = 0; i < 5; i++) {
    127127        psVec->data.S32[i] = i*10;
     128        psVec->n++;
    128129    }
    129130
     
    202203    }
    203204
     205    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
    204206    psVector* vecBogus = psVectorRealloc(NULL, 6);
    205207    if (vecBogus != NULL) {
     
    319321        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "VectorInit failed.  U8 Case \n");
    320322    }
    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) ) {
    322326        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "VectorInit failed.  U16 Case \n");
    323327    }
     
    328332        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "VectorInit failed.  U64 Case \n");
    329333    }
    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 ) ) {
    331337        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "VectorInit failed.  S8 Case \n");
    332338    }
     
    463469    vec->n = 0;
    464470
    465     if ( !psVectorSet(vec, 0, 10) )
     471    if ( !psVectorSet(vec, 0, 10) ) {
    466472        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) ) {
    468476        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) ) {
    470479        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 ) {
    472482        fprintf(stderr,
    473483                "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 ) {
    475486        fprintf(stderr,
    476487                "VectorGet Failed to return the correct S32 from tail using -1\n");
     488    }
    477489
    478490    psFree(vec);
     
    485497    long numPix2 = 0;
    486498    psVector *vec = NULL;
     499
     500    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
    487501    numPix = psVectorCountPixelMask(vec, 1);
    488 
    489502    if (numPix != -1) {
    490503        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     
    507520    vec2->data.U8[3] = 1;
    508521    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");
    509526    numPix = psVectorCountPixelMask(vec, 1);
    510527    numPix2 = psVectorCountPixelMask(vec2, 1);
  • trunk/psLib/test/mathtypes/tst_psVectorSort_02.c

    r4547 r6484  
    1414 *  @author  Ross Harman, MHPCC
    1515 *
    16  *  @version $Revision: 1.1 $  $Name: not supported by cvs2svn $
    17  *  @date  $Date: 2005-07-13 02:47:00 $
     16 *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
     17 *  @date  $Date: 2006-02-24 23:43:16 $
    1818 *
    1919 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    9898    for(psS32 m=0; m<5; m++) {
    9999        in->data.U8[m]= 20-m;
     100        in->n++;
    100101    }
    101102    out = psVectorAlloc(3,PS_TYPE_U32);
     103    out->n = 3;
    102104    out = psVectorSortIndex(out,in);
    103105    if(out->n != 5) {
     
    151153    in = psVectorAlloc(5,PS_TYPE_U8);
    152154    out = psVectorAlloc(5,PS_TYPE_U32);
     155    in->n = 5;
     156    out->n = 5;
    153157    tempVect = out;
    154158    in->type.type = PS_TYPE_BOOL;
  • trunk/psLib/test/mathtypes/verified/tst_psVector.stderr

    r6350 r6484  
    1818\**********************************************************************************/
    1919
     20<HOST>|I|testVectorRealloc
     21    Following should generate error message
    2022<HOST>|E|psVectorRealloc (FILE:LINENO)
    2123    psVectorRealloc must a given a non-NULL psVector to resize.  Desired datatype unknown.
     
    3840\**********************************************************************************/
    3941
     42<HOST>|I|testVectorInit
     43    Following should generate error message
    4044<HOST>|E|psVectorInit (FILE:LINENO)
    4145    Error:  U16 Value out of Range.
    42 <HOST>|E|testVectorInit (FILE:LINENO)
    43     VectorInit failed.  U16 Case
     46<HOST>|I|testVectorInit
     47    Following should generate error message
    4448<HOST>|E|psVectorInit (FILE:LINENO)
    4549    Error:  S8 Value out of Range.
    46 <HOST>|E|testVectorInit (FILE:LINENO)
    47     VectorInit failed.  S8 Case
    4850
    4951---> TESTPOINT PASSED (psVector{psVectorInit} | tst_psVector.c)
     
    8284\**********************************************************************************/
    8385
     86<HOST>|I|testVectorGetSet
     87    Following should generate error message
    8488<HOST>|E|psVectorSet (FILE:LINENO)
    8589    Invalid position.  Number too large
     
    9397\**********************************************************************************/
    9498
     99<HOST>|I|testVectorCountPixelMask
     100    Following should generate error message
    95101<HOST>|E|psVectorCountPixelMask (FILE:LINENO)
    96102    The input psVector can not be NULL.
     103<HOST>|I|testVectorCountPixelMask
     104    Following should generate error message
    97105<HOST>|E|psVectorCountPixelMask (FILE:LINENO)
    98106    psVector type does not match the specified psMaskType!
  • trunk/psLib/test/types/tst_psLookupTable_01.c

    r6204 r6484  
    1212*  @author  Ross Harman, MHPCC
    1313*
    14 *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
    15 *  @date  $Date: 2006-01-26 21:10:22 $
     14*  @version $Revision: 1.4 $  $Name: not supported by cvs2svn $
     15*  @date  $Date: 2006-02-24 23:43:16 $
    1616*
    1717*  Copyright 2004-5 Maui High Performance Computing Center, University of Hawaii
     
    191191                              {testLookupTableAlloc,817,"psLookupTableAlloc",0,false},
    192192                              {testVectorsReadFromFile,999,"psVectorsReadFromFile",0,false},
    193                               {testLookupTableImport,999,"psLookupTableImport",0,false},
     193                              {testLookupTableImport,666,"psLookupTableImport",0,false},
    194194                              {testLookupTableRead,998,"psLookupTableRead",0,false},
    195195                              {testLookupTableInterpolate,997,"psLookupTableInterpolate",0,false},
  • trunk/psLib/test/types/tst_psMetadataIO.c

    r5136 r6484  
    1313 *  @author  Eric Van Alst, MHPCC
    1414 *
    15  *  @version $Revision: 1.4 $  $Name: not supported by cvs2svn $
    16  *  @date  $Date: 2005-09-26 21:13:33 $
     15 *  @version $Revision: 1.5 $  $Name: not supported by cvs2svn $
     16 *  @date  $Date: 2006-02-24 23:43:16 $
    1717 *
    1818 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3232
    3333testDescription tests[] = {
    34                               {testMetadataParseConfig,000,"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},
    4040                              {NULL}
    4141                          };
  • trunk/psLib/test/types/verified/tst_psMetadataIO.stderr

    r5019 r6484  
    1010/***************************** TESTPOINT ******************************************\
    1111*             TestFile: tst_psMetadataIO.c                                         *
    12 *            TestPoint: psMetadataConfigParse{psMetadataConfigParse}               *
     12*            TestPoint: psMetadataConfigParse{psMetadataConfigParse1}              *
    1313*             TestType: Positive                                                   *
    1414\**********************************************************************************/
     
    6565    Unallowable operation: filename is NULL.
    6666
    67 ---> TESTPOINT PASSED (psMetadataConfigParse{psMetadataConfigParse} | tst_psMetadataIO.c)
     67---> TESTPOINT PASSED (psMetadataConfigParse{psMetadataConfigParse1} | tst_psMetadataIO.c)
    6868
    6969/***************************** TESTPOINT ******************************************\
    7070*             TestFile: tst_psMetadataIO.c                                         *
    71 *            TestPoint: psMetadataConfigParse{psMetadataConfigParse}               *
     71*            TestPoint: psMetadataConfigParse{psMetadataConfigParse2}              *
    7272*             TestType: Positive                                                   *
    7373\**********************************************************************************/
     
    8080    Failed to add metadata item to metadata collection list.
    8181
    82 ---> TESTPOINT PASSED (psMetadataConfigParse{psMetadataConfigParse} | tst_psMetadataIO.c)
     82---> TESTPOINT PASSED (psMetadataConfigParse{psMetadataConfigParse2} | tst_psMetadataIO.c)
    8383
    8484/***************************** TESTPOINT ******************************************\
    8585*             TestFile: tst_psMetadataIO.c                                         *
    86 *            TestPoint: psMetadataConfigParse{psMetadataConfigParse}               *
     86*            TestPoint: psMetadataConfigParse{psMetadataConfigParse3}              *
    8787*             TestType: Positive                                                   *
    8888\**********************************************************************************/
    8989
    9090
    91 ---> TESTPOINT PASSED (psMetadataConfigParse{psMetadataConfigParse} | tst_psMetadataIO.c)
     91---> TESTPOINT PASSED (psMetadataConfigParse{psMetadataConfigParse3} | tst_psMetadataIO.c)
    9292
    9393/***************************** TESTPOINT ******************************************\
    9494*             TestFile: tst_psMetadataIO.c                                         *
    95 *            TestPoint: psMetadataConfigParse{psMetadataConfigParse}               *
     95*            TestPoint: psMetadataConfigParse{psMetadataConfigParse4}              *
    9696*             TestType: Positive                                                   *
    9797\**********************************************************************************/
     
    112112    Metadata type 'CELL6', found on line 31 of test5.config, is invalid.
    113113
    114 ---> TESTPOINT PASSED (psMetadataConfigParse{psMetadataConfigParse} | tst_psMetadataIO.c)
     114---> TESTPOINT PASSED (psMetadataConfigParse{psMetadataConfigParse4} | tst_psMetadataIO.c)
    115115
    116116/***************************** TESTPOINT ******************************************\
Note: See TracChangeset for help on using the changeset viewer.