Changeset 4528 for trunk/psLib/src/dataManip/psMinimize.c
- Timestamp:
- Jul 8, 2005, 4:11:01 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/dataManip/psMinimize.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/dataManip/psMinimize.c
r4321 r4528 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.12 3$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-0 6-20 22:42:30$11 * @version $Revision: 1.124 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-07-09 02:11:01 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 1357 1357 XXX: type F32 is done via vector conversion only. 1358 1358 *****************************************************************************/ 1359 psPolynomial1D* psVectorFitPolynomial1D(psPolynomial1D* myPoly,1359 psPolynomial1D* psVectorFitPolynomial1D(psPolynomial1D* poly, 1360 1360 const psVector* x, 1361 1361 const psVector* y, 1362 1362 const psVector* yErr) 1363 1363 { 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); 1366 1366 PS_ASSERT_VECTOR_NON_NULL(y, NULL); 1367 1367 PS_ASSERT_VECTOR_NON_EMPTY(y, NULL); … … 1389 1389 if (x == NULL) { 1390 1390 PS_VECTOR_GEN_X_INDEX_STATIC_F64(x64Static, y->n); 1391 if ( myPoly->type == PS_POLYNOMIAL_CHEB) {1391 if (poly->type == PS_POLYNOMIAL_CHEB) { 1392 1392 p_psNormalizeVectorRangeF64(x64Static, -1.0, 1.0); 1393 1393 } … … 1396 1396 PS_ASSERT_VECTOR_TYPE_F32_OR_F64(x, NULL); 1397 1397 PS_VECTOR_CONVERT_F32_TO_F64_STATIC(x, x64, x64Static); 1398 if ( myPoly->type == PS_POLYNOMIAL_CHEB) {1398 if (poly->type == PS_POLYNOMIAL_CHEB) { 1399 1399 p_psNormalizeVectorRangeF64(x64, -1.0, 1.0); 1400 1400 } … … 1405 1405 // Call the appropriate vector fitting routine. 1406 1406 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); 1411 1411 } else { 1412 1412 psError(PS_ERR_BAD_PARAMETER_VALUE, true, … … 1419 1419 } 1420 1420 1421 return( myPoly);1421 return(poly); 1422 1422 } 1423 1423 … … 1432 1432 1433 1433 psMinimization *min = psAlloc(sizeof(psMinimization)); 1434 min->maxIter = maxIter;1435 min->tol = tol;1434 *(int*)&min->maxIter = maxIter; 1435 *(float*)&min->tol = tol; 1436 1436 min->value = 0.0; 1437 1437 min->iter = 0; … … 1993 1993 for (i=0;i<numDims;i++) { 1994 1994 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; 1997 1997 mul = p_psLineMin(&dummyMin, 1998 1998 Q,
Note:
See TracChangeset
for help on using the changeset viewer.
