IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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        }
Note: See TracChangeset for help on using the changeset viewer.