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/psLib/src/math/psMinimizePolyFit.c

    r9640 r9730  
    1010 *  @author EAM, IfA
    1111 *
    12  *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2006-10-19 02:57:18 $
     12 *  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2006-10-24 22:52:56 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    4646#define PS_VECTOR_GEN_CHEBY_INDEX(VEC, SIZE, TYPE) \
    4747VEC = psVectorAlloc(SIZE, TYPE); \
    48 VEC->n = VEC->nalloc; \
    4948if (TYPE == PS_TYPE_F64) { \
    5049    for (psS32 i = 0 ; i < SIZE ; i++) { \
     
    9392    if (sums == NULL) {
    9493        sums = psVectorAlloc(nSum, PS_TYPE_F64);
    95         sums->n = sums->nalloc;
    9694    } else if (nSum > sums->n) {
    9795        sums = psVectorRealloc(sums, nSum);
    98         sums->n = sums->nalloc;
     96        sums->n = nSum;
    9997    }
    10098
     
    333331    psImage *A = psImageAlloc(numTerms, numTerms, PS_TYPE_F64); // Least-squares matrix
    334332    psVector *B = psVectorAlloc(numTerms, PS_TYPE_F64); // Least-squares vector
    335     B->n = numTerms;
    336333    psImageInit(A, 0.0);
    337334    psVectorInit(B, 0.0);
     
    509506    psImage *A = psImageAlloc(nTerm, nTerm, PS_TYPE_F64); // Least-squares matrix
    510507    psVector *B = psVectorAlloc(nTerm, PS_TYPE_F64); // Least-squares vector
    511     B->n = B->nalloc;
    512508
    513509    // Initialize data structures.
     
    805801    psVector *fit   = NULL;
    806802    psVector *resid = psVectorAlloc(f->n, PS_TYPE_F64);
    807     resid->n = resid->nalloc;
    808803
    809804    // eventual expansion: user supplies one of various stats option pairs,
     
    976971    psImage *A = psImageAlloc(nTerm, nTerm, PS_TYPE_F64); // Least-squares matrix
    977972    psVector *B = psVectorAlloc(nTerm, PS_TYPE_F64); // Least-squares vector
    978     B->n = B->nalloc;
    979973
    980974    // Initialize data structures.
     
    12561250    }
    12571251    psVector *resid = psVectorAlloc(f->n, PS_TYPE_F64);
    1258     resid->n = resid->nalloc;
    12591252
    12601253    // eventual expansion: user supplies one of various stats option pairs,
     
    14341427    psImage    *A = psImageAlloc(nTerm, nTerm, PS_TYPE_F64); // Least-squares matrix
    14351428    psVector   *B = psVectorAlloc(nTerm, PS_TYPE_F64); // Least-squares vector
    1436     B->n = B->nalloc;
    14371429
    14381430    // Initialize data structures.
     
    17901782    psVector *fit   = NULL;
    17911783    psVector *resid = psVectorAlloc(f->n, PS_TYPE_F64);
    1792     resid->n = resid->nalloc;
    17931784
    17941785    // eventual expansion: user supplies one of various stats option pairs,
     
    19671958    psImage    *A = psImageAlloc(nTerm, nTerm, PS_TYPE_F64); // Least-squares matrix
    19681959    psVector   *B = psVectorAlloc(nTerm, PS_TYPE_F64); // Least-squares vector
    1969     B->n = B->nalloc;
    19701960
    19711961    // Initialize data structures.
     
    23682358    psVector *fit   = NULL;
    23692359    psVector *resid = psVectorAlloc(f->n, PS_TYPE_F64);
    2370     resid->n = resid->nalloc;
    23712360
    23722361    // eventual expansion: user supplies one of various stats option pairs,
Note: See TracChangeset for help on using the changeset viewer.