Changeset 1964 for trunk/psLib/src/math/psMinimize.c
- Timestamp:
- Oct 5, 2004, 1:14:15 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psMinimize.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psMinimize.c
r1963 r1964 9 9 * @author George Gusciora, MHPCC 10 10 * 11 * @version $Revision: 1.5 3$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-10-05 2 2:47:21$11 * @version $Revision: 1.54 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-10-05 23:14:15 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 80 80 } 81 81 82 /******************************************************************************83 VectorNormalizeGen(): this routine returns a psVector with "x" elements. The84 values of the vector will be scaled uniformly between -1.0 and 1.0.85 86 XXX: use a static vector.87 *****************************************************************************/88 psVector* VectorNormalizeGen(int x)89 {90 int i = 0;91 psVector *tmp = NULL;92 93 tmp = psVectorAlloc(x, PS_TYPE_F32);94 for (i = 0; i < x; i++) {95 tmp->data.F32[i] = (((float)2 * i) / ((float)x)) - 1.0;96 }97 98 return (tmp);99 }100 101 82 /***************************************************************************** 102 83 CalculateSecondDerivs(): Given a set of x/y vectors corresponding to a … … 107 88 here defined to be 0.0. They can be modified via ypo and yp1. 108 89 90 This routine assumes that vectors x and y are of the appropriate types/sizes 91 (F32). 92 109 93 XXX: This algorithm is derived from the Numerical Recipes. 110 XXX: use recyvled vectors for internal data. 94 XXX: use recycled vectors for internal data. 95 XXX: do an F64 version? 111 96 *****************************************************************************/ 112 97 float *CalculateSecondDerivs(const psVector* restrict x, ///< Ordinates (or NULL to just use the indices) … … 179 164 evalSpline() which computes the interpolated value based on the cubic spline 180 165 polynomials which are stored in psSpline1D. 166 167 XXX: check types/sizes 168 XXX: This is F32 only 181 169 *****************************************************************************/ 182 170 float p_psNRSpline1DEval(psSpline1D *spline, … … 236 224 237 225 XXX: usage of yErr is not specified in IfA documentation. 238 XXX: Must do: if yErr==NULL, set all errors equal.239 240 226 XXX: Is the x argument redundant? What do we do if the x argument is 241 supplied, but does not equal the domains specified in mySpline? 242 227 supplied, but does not equal the domains specified in mySpline? 243 228 XXX: can psSpline be NULL? 244 245 XXX: Implemented in F32 only, must add F64.246 229 *****************************************************************************/ 247 230 psSpline1D *psVectorFitSpline1D(psSpline1D *mySpline, ///< The spline which will be generated. … … 655 638 coefficients of that polynomial. 656 639 657 XXX: 658 yErr is currently ignored. 659 660 XXX: 661 Use private name? 640 XXX: yErr is currently ignored. 641 642 XXX: Use private name? 662 643 *****************************************************************************/ 663 644 psPolynomial1D *p_psVectorFitPolynomial1DCheby(psPolynomial1D* myPoly, … … 737 718 738 719 XXX: Use private name? 720 XXX: Use recycled vectors. 739 721 *****************************************************************************/ 740 722 psPolynomial1D* p_psVectorFitPolynomial1DOrd(psPolynomial1D* myPoly, … … 761 743 // printf("(x, y, yErr) is (%f, %f, %f)\n", x->data.F64[i], y->data.F64[i], yErr->data.F64[i]); 762 744 // } 763 764 // XXX: Some of these are redundant.765 PS_CHECK_NULL_1DPOLY(myPoly);766 PS_CHECK_NULL_VECTOR(y);767 PS_CHECK_EMPTY_VECTOR(y);768 PS_CHECK_EMPTY_VECTOR(x);769 PS_CHECK_NULL_VECTOR(yErr);770 PS_CHECK_EMPTY_VECTOR(yErr);771 PS_CHECK_VECTOR_SIZE_EQUAL(x, y);772 PS_CHECK_VECTOR_SIZE_EQUAL(y, yErr);773 745 774 746 A = psImageAlloc(polyOrder, polyOrder, PS_TYPE_F64); … … 949 921 increases, or x is too large. If thst does not work, expand in the other 950 922 direction. 923 924 XXX: This is F32 only 951 925 *****************************************************************************/ 952 926 psVector *p_psDetermineBracket(psVector *params, … … 1128 1102 XXX: This routine is not very efficient in terms of total evaluations of the 1129 1103 function. 1104 XXX: This is F32 only 1130 1105 *****************************************************************************/ 1131 1106 float p_psLineMin(psMinimization *min, … … 1501 1476 This functions uses global variables to receive the function pointer, the 1502 1477 data values, and the data errors. 1478 XXX: This is F32 only 1503 1479 *****************************************************************************/ 1504 1480 float myPowellChi2Func(const psVector *params,
Note:
See TracChangeset
for help on using the changeset viewer.
