IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 24, 2006, 12:55:05 PM (20 years ago)
Author:
Paul Price
Message:

Following today's meeting, we agreed that psVectorAlloc (and therefore
psArrayAlloc also) shall set the number of elements in use to equal the
number of elements allocated. We introduce new functions,
psVectorAllocEmpty and psArrayAllocEmpty, that allocate a vector and set
the length to zero.

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

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/imcombine/pmImageCombine.c

    r8815 r9730  
    88 *  @author GLG, MHPCC
    99 *
    10  *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2006-09-15 09:49:01 $
     10 *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2006-10-24 22:55:05 $
    1212 *
    1313 *  XXX: pmRejectPixels() has a known bug with the pmImageTransform() call.
     
    122122    if (*questionablePixels == NULL) {
    123123        *questionablePixels = psArrayAlloc(numImages);
    124         (*questionablePixels)->n = numImages;
    125124    } else if ((*questionablePixels)->n != numImages) {
    126125        *questionablePixels = psArrayRealloc(*questionablePixels, numImages);
     
    137136    psVector *qpPtr = psVectorAlloc(numImages, PS_TYPE_S32);
    138137    psVectorInit(qpPtr, 0);
    139     qpPtr->n = numImages;
    140138    //
    141139    // Allocate the necessary psVectors for the call to psVectorStats().
     
    144142    //
    145143    psVector *pixelData = psVectorAlloc(numImages, PS_TYPE_F32);
    146     pixelData->n = pixelData->nalloc;
    147144    psVector *pixelMask = NULL;
    148145    if (masks != NULL) {
    149146        pixelMask = psVectorAlloc(numImages, PS_TYPE_U8);
    150147        psVectorInit(pixelMask, 0);
    151         pixelMask->n = numImages;
    152148    }
    153149
     
    156152        pixelErrors = psVectorAlloc(numImages, PS_TYPE_F32);
    157153        psVectorInit(pixelErrors, 1.0);
    158         pixelErrors->n = numImages;
    159154    }
    160155
     
    320315    psVector *pixels = psVectorAlloc(8, PS_TYPE_F32); // Array of pixels
    321316    psVector *mask = psVectorAlloc(8, PS_TYPE_U8); // Corresponding mask
    322     pixels->n = 8;
    323     mask->n = 8;
    324317
    325318    // Get limits
     
    538531    //
    539532    psArray *rejects = psArrayAlloc(numImages);
    540     rejects->n = numImages;
    541533    for (psS32 im = 0 ; im < numImages ; im++) {
    542534        rejects->data[im] = (psPtr *) psPixelsAlloc(PS_REJECT_PIXEL_INITIAL_PIXEL_LIST_LENGTH);
     
    550542    psVector *rPtr = psVectorAlloc(numImages, PS_TYPE_S32);
    551543    psVectorInit(rPtr, 0);
    552     rPtr->n = numImages;
    553544
    554545    psS32 numCols = ((psImage *) images->data[0])->numCols;
  • trunk/psModules/src/imcombine/pmImageSubtract.c

    r8815 r9730  
    77 *  @author GLG, MHPCC
    88 *
    9  *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2006-09-15 09:49:01 $
     9 *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2006-10-24 22:55:05 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    122122    tmp->u = psVectorAlloc(nBF, PS_TYPE_F32);
    123123    tmp->v = psVectorAlloc(nBF, PS_TYPE_F32);
    124     tmp->u->n = tmp->u->nalloc;
    125     tmp->v->n = tmp->v->nalloc;
    126124    tmp->sigma = NULL;
    127125    tmp->xOrder = psVectorAlloc(nBF, PS_TYPE_F32);
    128     tmp->xOrder->n = tmp->xOrder->nalloc;
    129126    tmp->yOrder = psVectorAlloc(nBF, PS_TYPE_F32);
    130     tmp->yOrder->n = tmp->yOrder->nalloc;
    131127    tmp->subIndex = 0;
    132128    tmp->preCalc = NULL;
     
    223219    tmp->u = psVectorAlloc(nBF, PS_TYPE_F32);
    224220    tmp->v = psVectorAlloc(nBF, PS_TYPE_F32);
    225     tmp->u->n = tmp->u->nalloc;
    226     tmp->v->n = tmp->v->nalloc;
    227221    tmp->sigma = psVectorAlloc(nBF, PS_TYPE_F32);
    228222    tmp->xOrder = psVectorAlloc(nBF, PS_TYPE_F32);
     
    232226    tmp->spatialOrder = spatialOrder;
    233227    tmp->preCalc = psArrayAlloc(nBF);
    234     tmp->u->n = tmp->u->nalloc;
    235     tmp->v->n = tmp->v->nalloc;
    236     tmp->sigma->n = tmp->sigma->nalloc;
    237     tmp->xOrder->n = tmp->xOrder->nalloc;
    238     tmp->yOrder->n = tmp->yOrder->nalloc;
    239     tmp->preCalc->n = tmp->preCalc->nalloc;
    240228
    241229    //
     
    367355    } else {
    368356        stamps = (psArray *) psArrayAlloc(xNum * yNum);
    369         stamps->n = stamps->nalloc;
    370357        for (psS32 s = 0 ; s < (xNum * yNum) ; s++) {
    371358            stamps->data[s] = (psPtr *) p_pmStampAlloc(PM_STAMP_REJECTED);
     
    826813            if (stampVector == NULL) {
    827814                stampVector = psVectorAlloc(numSolveParams, PS_TYPE_F64);
    828                 stampVector->n = stampVector->nalloc;
    829815                stamp->vector = stampVector;
    830816            } else {
     
    10451031    } else {
    10461032        solution = psVectorAlloc(size, PS_TYPE_F64);
    1047         solution->n = solution->nalloc;
    10481033    }
    10491034
     
    10571042    psImage *sumMatrix = psImageAlloc(size, size, PS_TYPE_F64);
    10581043    psVector *sumVector = psVectorAlloc(size, PS_TYPE_F64);
    1059     sumVector->n = sumVector->nalloc;
    10601044    psVectorInit(sumVector, 0.0);
    10611045    psImageInit(sumMatrix, 0.0);
     
    11501134    } else {
    11511135        deviations = psVectorAlloc(stamps->n, PS_TYPE_F32);
    1152         deviations->n = deviations->nalloc;
    11531136        // XXX: Probably not necessary.
    11541137        psVectorInit(deviations, 0.0);
  • trunk/psModules/src/imcombine/pmReadoutCombine.c

    r9611 r9730  
    201201
    202202    psVector *pixels = psVectorAlloc(inputs->n, PS_TYPE_F32); // Stack of pixels
    203     pixels->n = inputs->n;
    204203    psF32 *pixelsData = pixels->data.F32; // Dereference pixels
    205204
    206205    psVector *mask   = psVectorAlloc(inputs->n, PS_TYPE_U8); // Mask for stack
    207     mask->n = inputs->n;
    208206    psU8 *maskData = mask->data.U8;     // Dereference mask
    209207
     
    212210    if (haveWeights) {
    213211        weights = psVectorAlloc(inputs->n, PS_TYPE_F32); // Stack of weights
    214         weights->n = inputs->n;
    215212        weightsData = weights->data.F32;
    216213    }
Note: See TracChangeset for help on using the changeset viewer.