Changeset 10178 for trunk/psLib/src/math/psMinimizeLMM.c
- Timestamp:
- Nov 24, 2006, 10:52:59 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psMinimizeLMM.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psMinimizeLMM.c
r9730 r10178 10 10 * @author EAM, IfA 11 11 * 12 * @version $Revision: 1.2 4$ $Name: not supported by cvs2svn $13 * @date $Date: 2006-1 0-24 22:52:56$12 * @version $Revision: 1.25 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2006-11-24 20:52:59 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 63 63 psF64 lambda) 64 64 { 65 PS_ASSERT_VECTOR_TYPE(Alpha, PS_TYPE_F64, false); 66 PS_ASSERT_VECTOR_TYPE(Beta, PS_TYPE_F64, false); 67 PS_ASSERT_VECTOR_TYPE(Params, PS_TYPE_F32, false); 68 PS_ASSERT_VECTOR_TYPE(alpha, PS_TYPE_F64, false); 69 PS_ASSERT_VECTOR_TYPE(beta, PS_TYPE_F64, false); 70 PS_ASSERT_VECTOR_TYPE(params, PS_TYPE_F32, false); 71 if (paramMask) { 72 PS_ASSERT_VECTOR_TYPE(paramMask, PS_TYPE_MASK, false); 73 } 74 65 75 # define USE_LU_DECOMP 0 66 76 # if (USE_LU_DECOMP) … … 125 135 for (int j = 0; j < params->n; j++) { 126 136 if ((paramMask != NULL) && (paramMask->data.U8[j])) { 137 Params->data.F32[j] = 0; 127 138 continue; 128 139 } … … 163 174 psImage *Alpha = psImageAlloc (params->n, params->n, PS_TYPE_F64); 164 175 psVector *beta = psVectorAlloc(params->n, PS_TYPE_F64); 165 psVector *Params = psVectorAlloc(params->n, PS_TYPE_F 64);176 psVector *Params = psVectorAlloc(params->n, PS_TYPE_F32); 166 177 psVector *dy = NULL; 167 178 psBool rc = true; … … 182 193 } 183 194 psTrace("psLib.math", 5, "p_psMinLM_SetABX() was succesful\n"); 195 // dump some useful info if trace is defined 196 if (psTraceGetLevel("psLib.math") >= 6) { 197 p_psImagePrint(psTraceGetDestination(), alpha, "alpha guess (0)"); 198 p_psVectorPrint(psTraceGetDestination(), beta, "beta guess (0)"); 199 p_psVectorPrint(psTraceGetDestination(), params, "params guess (0)"); 200 } 184 201 185 202 psBool rcBool = p_psMinLM_GuessABP(Alpha, delta, Params, alpha, beta, params, paramMask, NULL, NULL, NULL, 0.0); … … 189 206 } 190 207 psTrace("psLib.math", 5, "p_psMinLM_GuessABP() was succesful\n"); 208 if (psTraceGetLevel("psLib.math") >= 6) { 209 p_psImagePrint(psTraceGetDestination(), Alpha, "alpha guess (1)"); 210 p_psVectorPrint(psTraceGetDestination(), delta, "delta guess (1)"); 211 p_psVectorPrint(psTraceGetDestination(), Params, "params guess (1)"); 212 } 191 213 192 214 psFree(alpha); … … 237 259 PS_ASSERT_VECTOR_NON_NULL(y, NAN); 238 260 PS_ASSERT_VECTOR_NON_NULL(dy, NAN); 261 262 PS_ASSERT_VECTOR_TYPE(params, PS_TYPE_F32, false); 263 if (paramMask) { 264 PS_ASSERT_VECTOR_TYPE(paramMask, PS_TYPE_MASK, false); 265 } 239 266 240 267 psF64 chisq; … … 404 431 p_psImagePrint(psTraceGetDestination(), alpha, "alpha guess (0)"); 405 432 p_psVectorPrint(psTraceGetDestination(), beta, "beta guess (0)"); 433 } 434 if (psTraceGetLevel("psLib.math") >= 5) { 406 435 p_psVectorPrint(psTraceGetDestination(), params, "params guess (0)"); 407 }408 if (psTraceGetLevel ("psLib.math.psMinimizeLMChi2") >= 6) {409 psTrace("psLib.math", 6, "The current Param vector: \n");410 for (psS32 i = 0 ; i < Params->n ; i++) {411 psTrace("psLib.math", 6, "Params[%d] is %f\n", i, Params->data.F32[i]);412 }413 436 } 414 437 … … 433 456 p_psImagePrint(psTraceGetDestination(), Alpha, "alpha guess (1)"); 434 457 p_psVectorPrint(psTraceGetDestination(), Beta, "beta guess (1)"); 458 } 459 if (psTraceGetLevel("psLib.math") >= 5) { 435 460 p_psVectorPrint(psTraceGetDestination(), Params, "params guess (1)"); 436 }437 if (psTraceGetLevel("psLib.math") >= 6) {438 if (psTraceGetLevel ("psLib.math") >= 6) {439 psTrace("psLib.math", 6, "The current Param vector: \n");440 for (psS32 i = 0 ; i < Params->n ; i++) {441 psTrace("psLib.math", 6, "Params[%d] is %f\n", i, Params->data.F32[i]);442 }443 }444 461 } 445 462 … … 452 469 } 453 470 454 // XXX EAM alternateconvergence criterion:471 // convergence criterion: 455 472 // compare the delta (min->value - Chisq) with the 456 473 // expected delta from the linear model (dLinear)
Note:
See TracChangeset
for help on using the changeset viewer.
