IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 3, 2006, 3:01:34 PM (20 years ago)
Author:
drobbin
Message:

Updated files to reflect psArray, psVector, & psPixels changes in psLib that set n=0 upon allocation.

Location:
trunk/psModules/src/imsubtract
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/imsubtract/pmImageSubtract.c

    r5170 r6511  
    77 *  @author GLG, MHPCC
    88 *
    9  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-09-28 20:43:52 $
     9 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2006-03-04 01:01:33 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    119119    tmp->u = psVectorAlloc(nBF, PS_TYPE_F32);
    120120    tmp->v = psVectorAlloc(nBF, PS_TYPE_F32);
     121    tmp->u->n = tmp->u->nalloc;
     122    tmp->v->n = tmp->v->nalloc;
    121123    tmp->sigma = NULL;
    122124    tmp->xOrder = psVectorAlloc(nBF, PS_TYPE_F32);
     125    tmp->xOrder->n = tmp->xOrder->nalloc;
    123126    tmp->yOrder = psVectorAlloc(nBF, PS_TYPE_F32);
     127    tmp->yOrder->n = tmp->yOrder->nalloc;
    124128    tmp->subIndex = 0;
    125129    tmp->preCalc = NULL;
     
    216220    tmp->u = psVectorAlloc(nBF, PS_TYPE_F32);
    217221    tmp->v = psVectorAlloc(nBF, PS_TYPE_F32);
     222    tmp->u->n = tmp->u->nalloc;
     223    tmp->v->n = tmp->v->nalloc;
    218224    tmp->sigma = psVectorAlloc(nBF, PS_TYPE_F32);
    219225    tmp->xOrder = psVectorAlloc(nBF, PS_TYPE_F32);
     
    223229    tmp->spatialOrder = spatialOrder;
    224230    tmp->preCalc = psArrayAlloc(nBF);
     231    tmp->u->n = tmp->u->nalloc;
     232    tmp->v->n = tmp->v->nalloc;
     233    tmp->sigma->n = tmp->sigma->nalloc;
     234    tmp->xOrder->n = tmp->xOrder->nalloc;
     235    tmp->yOrder->n = tmp->yOrder->nalloc;
     236    tmp->preCalc->n = tmp->preCalc->nalloc;
    225237
    226238    //
     
    352364    } else {
    353365        stamps = (psArray *) psArrayAlloc(xNum * yNum);
     366        stamps->n = stamps->nalloc;
    354367        for (psS32 s = 0 ; s < (xNum * yNum) ; s++) {
    355368            stamps->data[s] = (psPtr *) p_pmStampAlloc(PM_STAMP_REJECTED);
     
    810823            if (stampVector == NULL) {
    811824                stampVector = psVectorAlloc(numSolveParams, PS_TYPE_F64);
     825                stampVector->n = stampVector->nalloc;
    812826                stamp->vector = stampVector;
    813827            } else {
     
    10281042    } else {
    10291043        solution = psVectorAlloc(size, PS_TYPE_F64);
     1044        solution->n = solution->nalloc;
    10301045    }
    10311046
     
    10391054    psImage *sumMatrix = psImageAlloc(size, size, PS_TYPE_F64);
    10401055    psVector *sumVector = psVectorAlloc(size, PS_TYPE_F64);
     1056    sumVector->n = sumVector->nalloc;
    10411057    PS_VECTOR_SET_F64(sumVector, 0.0);
    10421058    PS_IMAGE_SET_F64(sumMatrix, 0.0);
     
    11311147    } else {
    11321148        deviations = psVectorAlloc(stamps->n, PS_TYPE_F32);
     1149        deviations->n = deviations->nalloc;
    11331150        // XXX: Probably not necessary.
    11341151        PS_VECTOR_SET_F32(deviations, 0.0);
  • trunk/psModules/src/imsubtract/pmSubtractBias.c

    r6506 r6511  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2006-03-02 23:16:05 $
     8 *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2006-03-04 01:01:33 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    307307    // XXX: use psVectorCopy if they get it working.
    308308    out->knots = psVectorAlloc(in->knots->n, in->knots->type.type);
     309    out->knots->n = out->knots->nalloc;
    309310    for (psS32 i = 0 ; i < in->knots->n ; i++) {
    310311        out->knots->data.F32[i] = in->knots->data.F32[i];
     
    346347    // Allocate the new vector.
    347348    psVector *newVec = psVectorAlloc(n, PS_TYPE_F32);
    348 
     349    newVec->n = newVec->nalloc;
    349350    //
    350351    // If the new vector is the same size as the old, simply copy the data.
     
    491492    psS32 numOverscanImages = my_psListLength(bias);
    492493    psVector *statsAll = psVectorAlloc(numOverscanImages, PS_TYPE_F32);
     494    statsAll->n = statsAll->nalloc;
    493495    psListElem *tmpOverscan = (psListElem *) bias->head;
    494496    psS32 i = 0;
     
    554556    psVector *tmpRow = psVectorAlloc(overscanImage->numCols, PS_TYPE_F32);
    555557    psVector *tmpCol = psVectorAlloc(overscanImage->numRows, PS_TYPE_F32);
     558    tmpRow->n = tmpRow->nalloc;
     559    tmpCol->n = tmpCol->nalloc;
    556560
    557561    //
     
    594598    psVector *tmpRow = psVectorAlloc(overscanImage->numCols, PS_TYPE_F32);
    595599    psVector *tmpCol = psVectorAlloc(overscanImage->numRows, PS_TYPE_F32);
     600    tmpRow->n = tmpRow->nalloc;
     601    tmpCol->n = tmpCol->nalloc;
    596602
    597603    //
     
    649655    psS32 vecSize = GetOverscanSize(inImg, overScanAxis);
    650656    psVector *overscanVector = psVectorAlloc(vecSize, PS_TYPE_F32);
     657    overscanVector->n = overscanVector->nalloc;
    651658
    652659    //
     
    658665    psS32 numOverscanImages = my_psListLength(bias);
    659666    psVector **overscanVectors = (psVector **) psAlloc(numOverscanImages * sizeof(psVector *));
     667    //    (*overscanVectors)->n = (*overscanVectors)->nalloc;
    660668    for (psS32 i = 0 ; i < numOverscanImages ; i++) {
    661669        overscanVectors[i] = NULL;
     
    711719    //
    712720    psVector *tmpVec = psVectorAlloc(numOverscanImages, PS_TYPE_F32);
     721    tmpVec->n = tmpVec->nalloc;
    713722    psF64 statValue;
    714723    for (psS32 i = 0 ; i < vecSize ; i++) {
     
    772781        psVector *myBin = psVectorAlloc(numBins, PS_TYPE_F32);
    773782        psVector *binVec = psVectorAlloc(nBinOrig, PS_TYPE_F32);
     783        myBin->n = myBin->nalloc;
     784        binVec->n = binVec->nalloc;
    774785
    775786        for (psS32 i=0;i<numBins;i++) {
     
    859870    psS32 vecSize = GetOverscanSize(inImg, overScanAxis);
    860871    psVector *newVec = psVectorAlloc(vecSize, PS_TYPE_F32);
     872    newVec->n = newVec->nalloc;
    861873    if ((nBin > 1) && (nBin < overscanVector->n)) {
    862874        for (psS32 i = 0 ; i < vecSize ; i++) {
     
    905917
    906918    psVector *newVec = psVectorAlloc(vecSize, PS_TYPE_F32);
     919    newVec->n = newVec->nalloc;
    907920    for (psS32 i = 0 ; i < vecSize ; i++) {
    908921        newVec->data.F32[i] = overscanVector->data.F32[i/nBin];
  • trunk/psModules/src/imsubtract/pmSubtractSky.c

    r6325 r6511  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2006-02-06 21:03:25 $
     8 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2006-03-04 01:01:33 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    1212 *
    13  *     
     13 *
    1414 *
    1515 */
     
    341341    psImage *Aout = psImageAlloc(localPolyTerms, localPolyTerms, PS_TYPE_F64);
    342342    psVector *B = psVectorAlloc(localPolyTerms, PS_TYPE_F64);
     343    B->n = B->nalloc;
    343344    psVector *outPerm = NULL;
    344345
     
    407408    PS_ASSERT_IMAGE_NON_EMPTY(Aout, NULL);
    408409    psVector *C = psVectorAlloc(localPolyTerms, PS_TYPE_F64);
     410    C->n = C->nalloc;
    409411    psMatrixLUSolve(C, Aout, B, outPerm);
    410412
Note: See TracChangeset for help on using the changeset viewer.