IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 10904


Ignore:
Timestamp:
Jan 4, 2007, 1:50:08 PM (19 years ago)
Author:
jhoblitt
Message:

remove static caching of a masks from psMinimizePowell()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/math/psMinimizePowell.c

    r10255 r10904  
    1111 *  NOTE: XXX: The SDR is silent about data types.  F32 is implemented here.
    1212 *
    13  *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2006-11-29 02:33:54 $
     13 *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2007-01-04 23:50:08 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    522522
    523523    if (paramMask == NULL) {
    524         myParamMask = psVectorRecycle(myParamMask, params->n, PS_TYPE_U8);
    525         p_psMemSetPersistent(myParamMask, true);
    526         p_psMemSetPersistent(myParamMask->data.U8, true);
    527         for (i=0;i<myParamMask->nalloc;i++) {
    528             myParamMask->data.U8[i] = 0;
    529             myParamMask->n++;
    530         }
     524        myParamMask = psVectorAlloc(params->n, PS_TYPE_U8);
     525        psVectorInit(myParamMask, 0);
    531526    } else {
    532527        myParamMask = (psVector *) paramMask;
     
    584579                    psFree(u);
    585580                    psFree(Q);
     581                    psFree(myParamMask);
    586582                    return(false);
    587583                }
     
    629625            psFree(u);
    630626            psFree(Q);
     627            psFree(myParamMask);
    631628            return(false);
    632629        }
     
    642639            min->lastDelta = 0.0;
    643640            psTrace("psLib.math", 4, "---- psMinimizePowell() end (1)(true) ----\n");
     641            psFree(myParamMask);
    644642            return(true);
    645643        }
     
    684682            min->lastDelta = currFuncVal - baseFuncVal;
    685683            psTrace("psLib.math", 4, "---- psMinimizePowell() end (2) (true) ----\n");
     684            psFree(myParamMask);
    686685            return(true);
    687686        }
     
    694693    min->iter = iterationNumber;
    695694    psTrace("psLib.math", 4, "---- psMinimizePowell() end (0) (false) ----\n");
     695
     696    psFree(myParamMask);
    696697    return(false);
    697698}
Note: See TracChangeset for help on using the changeset viewer.