Changeset 25027 for branches/pap/psLib/src/math/psMinimizeLMM.c
- Timestamp:
- Aug 7, 2009, 4:08:25 PM (17 years ago)
- Location:
- branches/pap
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
psLib/src/math/psMinimizeLMM.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/pap
- Property svn:mergeinfo changed
-
branches/pap/psLib/src/math/psMinimizeLMM.c
r23486 r25027 80 80 assert (alpha->numCols == alpha->numRows); 81 81 82 # define TESTGJ 0 83 # if (TESTGJ) 84 lambda = 0.0; 85 #endif 86 82 87 // set new guess values, applying (1+lambda) scaling to pivots 83 88 Beta = psVectorCopy(Beta, beta, PS_TYPE_F32); … … 88 93 89 94 // error and clear above if kept? 90 if ( false == psMatrixGJSolveF32(Alpha, Beta)) {95 if (!psMatrixGJSolve(Alpha, Beta)) { 91 96 psTrace ("psLib.math", 4, "singular matrix in Guess ABP\n"); 92 97 return(false); 93 98 } 99 100 // XXX check that the GJ solver works: 101 # if (TESTGJ) 102 psImage *out = psImageAlloc (alpha->numRows, alpha->numCols, PS_TYPE_F32); 103 for (int oy = 0; oy < out->numRows; oy++) { 104 for (int ox = 0; ox < out->numCols; ox++) { 105 float value = 0; 106 for (int i = 0; i < alpha->numCols; i++) { 107 value += alpha->data.F32[i][ox]*Alpha->data.F32[oy][i]; 108 } 109 out->data.F32[oy][ox] = value; 110 } 111 } 112 113 psVector *vect = psVectorAlloc (beta->n, PS_TYPE_F32); 114 for (int oy = 0; oy < vect->n; oy++) { 115 float value = 0; 116 for (int i = 0; i < alpha->numCols; i++) { 117 value += alpha->data.F32[oy][i]*Beta->data.F32[i]; 118 } 119 vect->data.F32[oy] = value; 120 } 121 122 psFree (out); 123 psFree (vect); 124 125 # endif 94 126 95 127 // check for non-finite entries in result … … 191 223 if (isnan(chisq)) { 192 224 psTrace ("psLib.math", 5, "psMinLM_SetABX() returned a NAN chisq.\n"); 225 psVectorInit (delta, NAN); 193 226 retValue = false; 194 227 } … … 205 238 if (!status) { 206 239 psTrace ("psLib.math", 5, "psMinLM_GuessABP() returned FALSE.\n"); 240 psVectorInit (delta, NAN); 207 241 retValue = false; 208 242 }
Note:
See TracChangeset
for help on using the changeset viewer.
