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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/astrom/pmAstrometryDistortion.c

    r8815 r9730  
    77*  @author EAM, IfA
    88*
    9 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
    10 *  @date $Date: 2006-09-15 09:49:01 $
     9*  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
     10*  @date $Date: 2006-10-24 22:55:04 $
    1111*
    1212*  Copyright 2006 Institute for Astronomy, University of Hawaii
     
    5454
    5555    if (grads == NULL) {
    56         grads = psArrayAlloc (100);
     56        grads = psArrayAllocEmpty (100);
    5757    }
    5858
     
    7676            int Ymax = Ymin + DY;
    7777
    78             psVector *L  = psVectorAlloc (100, PS_TYPE_F32);
    79             psVector *M  = psVectorAlloc (100, PS_TYPE_F32);
    80             psVector *dP = psVectorAlloc (100, PS_TYPE_F32);
    81             psVector *dQ = psVectorAlloc (100, PS_TYPE_F32);
     78            psVector *L  = psVectorAllocEmpty (100, PS_TYPE_F32);
     79            psVector *M  = psVectorAllocEmpty (100, PS_TYPE_F32);
     80            psVector *dP = psVectorAllocEmpty (100, PS_TYPE_F32);
     81            psVector *dQ = psVectorAllocEmpty (100, PS_TYPE_F32);
    8282            int Npts = 0;
    8383
     
    121121            psStats *stats = psStatsAlloc (PS_STAT_SAMPLE_MEDIAN | PS_STAT_SAMPLE_STDEV);
    122122            psVector *mask = psVectorAlloc (Npts, PS_TYPE_MASK);
    123             mask->n = Npts;
    124123            psVectorInit (mask, 0);
    125124
     
    175174        M->data.F32[i] = grad->FP.y;
    176175    }
    177     dPdL->n = dQdL->n = dPdM->n = dQdM->n = grads->n;
    178     L->n = M->n = grads->n;
    179176
    180177    psStats *stats = psStatsAlloc (PS_STAT_SAMPLE_MEDIAN | PS_STAT_SAMPLE_STDEV);
    181178    psVector *mask = psVectorAlloc (grads->n, PS_TYPE_MASK);
    182     mask->n = grads->n;
    183179    psVectorInit (mask, 0);
    184180
Note: See TracChangeset for help on using the changeset viewer.