IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 8, 2005, 4:11:01 PM (21 years ago)
Author:
drobbin
Message:

updated fxns to match psLib SDRS rev. 15

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/dataManip/psMinimize.c

    r4321 r4528  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.123 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-06-20 22:42:30 $
     11 *  @version $Revision: 1.124 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2005-07-09 02:11:01 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    13571357XXX: type F32 is done via vector conversion only.
    13581358 *****************************************************************************/
    1359 psPolynomial1D* psVectorFitPolynomial1D(psPolynomial1D* myPoly,
     1359psPolynomial1D* psVectorFitPolynomial1D(psPolynomial1D* poly,
    13601360                                        const psVector* x,
    13611361                                        const psVector* y,
    13621362                                        const psVector* yErr)
    13631363{
    1364     PS_ASSERT_POLY_NON_NULL(myPoly, NULL);
    1365     PS_ASSERT_INT_NONNEGATIVE(myPoly->n, NULL);
     1364    PS_ASSERT_POLY_NON_NULL(poly, NULL);
     1365    PS_ASSERT_INT_NONNEGATIVE(poly->n, NULL);
    13661366    PS_ASSERT_VECTOR_NON_NULL(y, NULL);
    13671367    PS_ASSERT_VECTOR_NON_EMPTY(y, NULL);
     
    13891389    if (x == NULL) {
    13901390        PS_VECTOR_GEN_X_INDEX_STATIC_F64(x64Static, y->n);
    1391         if (myPoly->type == PS_POLYNOMIAL_CHEB) {
     1391        if (poly->type == PS_POLYNOMIAL_CHEB) {
    13921392            p_psNormalizeVectorRangeF64(x64Static, -1.0, 1.0);
    13931393        }
     
    13961396        PS_ASSERT_VECTOR_TYPE_F32_OR_F64(x, NULL);
    13971397        PS_VECTOR_CONVERT_F32_TO_F64_STATIC(x, x64, x64Static);
    1398         if (myPoly->type == PS_POLYNOMIAL_CHEB) {
     1398        if (poly->type == PS_POLYNOMIAL_CHEB) {
    13991399            p_psNormalizeVectorRangeF64(x64, -1.0, 1.0);
    14001400        }
     
    14051405    // Call the appropriate vector fitting routine.
    14061406    psPolynomial1D *rc = NULL;
    1407     if (myPoly->type == PS_POLYNOMIAL_CHEB) {
    1408         rc = vectorFitPolynomial1DCheby(myPoly, x64, y64, yErr64);
    1409     } else if (myPoly->type == PS_POLYNOMIAL_ORD) {
    1410         rc = vectorFitPolynomial1DOrd(myPoly, x64, y64, yErr64);
     1407    if (poly->type == PS_POLYNOMIAL_CHEB) {
     1408        rc = vectorFitPolynomial1DCheby(poly, x64, y64, yErr64);
     1409    } else if (poly->type == PS_POLYNOMIAL_ORD) {
     1410        rc = vectorFitPolynomial1DOrd(poly, x64, y64, yErr64);
    14111411    } else {
    14121412        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
     
    14191419    }
    14201420
    1421     return(myPoly);
     1421    return(poly);
    14221422}
    14231423
     
    14321432
    14331433    psMinimization *min = psAlloc(sizeof(psMinimization));
    1434     min->maxIter = maxIter;
    1435     min->tol = tol;
     1434    *(int*)&min->maxIter = maxIter;
     1435    *(float*)&min->tol = tol;
    14361436    min->value = 0.0;
    14371437    min->iter = 0;
     
    19931993        for (i=0;i<numDims;i++) {
    19941994            if (myParamMask->data.U8[i] == 0) {
    1995                 dummyMin.maxIter = PS_MINIMIZE_POWELL_LINEMIN_MAX_ITERATIONS;
    1996                 dummyMin.tol = PS_MINIMIZE_POWELL_LINEMIN_ERROR_TOLERANCE;
     1995                *(int*)&dummyMin.maxIter = PS_MINIMIZE_POWELL_LINEMIN_MAX_ITERATIONS;
     1996                *(float*)&dummyMin.tol = PS_MINIMIZE_POWELL_LINEMIN_ERROR_TOLERANCE;
    19971997                mul = p_psLineMin(&dummyMin,
    19981998                                  Q,
Note: See TracChangeset for help on using the changeset viewer.