Changeset 23984 for trunk/psLib/src/math/psMinimizeLMM.c
- Timestamp:
- Apr 28, 2009, 10:59:54 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psMinimizeLMM.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psMinimizeLMM.c
r23486 r23984 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); … … 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
Note:
See TracChangeset
for help on using the changeset viewer.
