Changeset 21183 for trunk/psLib/src/math/psMinimizePowell.c
- Timestamp:
- Jan 26, 2009, 8:40:07 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psMinimizePowell.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psMinimizePowell.c
r11668 r21183 11 11 * NOTE: XXX: The SDR is silent about data types. F32 is implemented here. 12 12 * 13 * @version $Revision: 1.1 6$ $Name: not supported by cvs2svn $14 * @date $Date: 200 7-02-06 21:36:09$13 * @version $Revision: 1.17 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2009-01-27 06:39:38 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 43 43 #define PS_VECTOR_ADD_MULTIPLE(BASE, BASEMASK, LINE, OUT, MUL) \ 44 44 for (psS32 i=0;i<BASE->n;i++) { \ 45 if (BASEMASK->data. U8[i] == 0) { \45 if (BASEMASK->data.PS_TYPE_VECTOR_MASK_DATA[i] == 0) { \ 46 46 OUT->data.F32[i] = BASE->data.F32[i] + (MUL * LINE->data.F32[i]); \ 47 47 } else { \ … … 62 62 BOOL_VAR = true; \ 63 63 for (psS32 i=0;i<IN->n;i++) { \ 64 if ((INMASK->data. U8[i] == 0) && (fabs(IN->data.F32[i]) >= FLT_EPSILON)) { \64 if ((INMASK->data.PS_TYPE_VECTOR_MASK_DATA[i] == 0) && (fabs(IN->data.F32[i]) >= FLT_EPSILON)) { \ 65 65 BOOL_VAR = false; \ 66 66 break; \ … … 359 359 PS_ASSERT_VECTOR_NON_NULL(paramMask, NAN); 360 360 PS_ASSERT_VECTOR_NON_EMPTY(paramMask, NAN); 361 PS_ASSERT_VECTOR_TYPE(paramMask, PS_TYPE_ U8, NAN);361 PS_ASSERT_VECTOR_TYPE(paramMask, PS_TYPE_VECTOR_MASK, NAN); 362 362 PS_ASSERT_PTR_NON_NULL(coords, NAN); 363 363 PS_ASSERT_PTR_NON_NULL(func, NAN); … … 388 388 for (i=0;i<params->n;i++) { 389 389 psTrace("psLib.math", 6, "(params, paramMask, line)[%d] is (%f %d %f)\n", i, 390 params->data.F32[i], paramMask->data. U8[i], line->data.F32[i]);390 params->data.F32[i], paramMask->data.PS_TYPE_VECTOR_MASK_DATA[i], line->data.F32[i]); 391 391 } 392 392 } … … 527 527 528 528 if (paramMask == NULL) { 529 myParamMask = psVectorAlloc(params->n, PS_TYPE_ U8);529 myParamMask = psVectorAlloc(params->n, PS_TYPE_VECTOR_MASK); 530 530 psVectorInit(myParamMask, 0); 531 531 } else { … … 572 572 biggestIter = 0; 573 573 for (i=0;i<numDims;i++) { 574 if (myParamMask->data. U8[i] == 0) {574 if (myParamMask->data.PS_TYPE_VECTOR_MASK_DATA[i] == 0) { 575 575 P_PSMINIMIZATION_SET_MAXITER((&dummyMin),PS_MINIMIZE_POWELL_LINEMIN_MAX_ITERATIONS); 576 576 *(float*)&dummyMin.tol = PS_MINIMIZE_POWELL_LINEMIN_ERROR_TOLERANCE; … … 603 603 // 4: Set the vector u = Q - P 604 604 for (i=0;i<numDims;i++) { 605 if (myParamMask->data. U8[i] == 0) {605 if (myParamMask->data.PS_TYPE_VECTOR_MASK_DATA[i] == 0) { 606 606 u->data.F32[i] = Q->data.F32[i] - params->data.F32[i]; 607 607 u->n++; … … 649 649 650 650 for (i=0;i<numDims;i++) { 651 if (myParamMask->data. U8[i] == 0) {651 if (myParamMask->data.PS_TYPE_VECTOR_MASK_DATA[i] == 0) { 652 652 pQP->data.F32[i] = (2 * Q->data.F32[i]) - params->data.F32[i]; 653 653 } else { … … 663 663 if (term1 < term2) { 664 664 for (i=0;i<numDims;i++) { 665 if (myParamMask->data. U8[i] == 0) {665 if (myParamMask->data.PS_TYPE_VECTOR_MASK_DATA[i] == 0) { 666 666 ((psVector *) v->data[biggestIter])->data.F32[i] = u->data.F32[i]; 667 667 } … … 671 671 // 7: Set P to Q 672 672 for (i=0;i<numDims;i++) { 673 if (myParamMask->data. U8[i] == 0) {673 if (myParamMask->data.PS_TYPE_VECTOR_MASK_DATA[i] == 0) { 674 674 params->data.F32[i] = Q->data.F32[i]; 675 675 }
Note:
See TracChangeset
for help on using the changeset viewer.
