Changeset 10192 for trunk/psLib/src/math/psMinimizeLMM.c
- Timestamp:
- Nov 26, 2006, 11:53:57 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psMinimizeLMM.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psMinimizeLMM.c
r10178 r10192 10 10 * @author EAM, IfA 11 11 * 12 * @version $Revision: 1.2 5$ $Name: not supported by cvs2svn $13 * @date $Date: 2006-11-2 4 20:52:59$12 * @version $Revision: 1.26 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2006-11-26 21:53:57 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 79 79 psImage *A = NULL; 80 80 psF32 det; 81 82 81 // LU decomposition version 83 82 psTrace("psLib.math", 5, "using LUD version\n"); … … 135 134 for (int j = 0; j < params->n; j++) { 136 135 if ((paramMask != NULL) && (paramMask->data.U8[j])) { 137 Params->data.F32[j] = 0;136 Params->data.F32[j] = params->data.F32[j]; 138 137 continue; 139 138 } … … 336 335 coords. 337 336 338 NOTES: EAM: this is my re-implementation of MinLM339 340 XXX: EAM : constraints added 2006.02.15341 342 XXX: Put the ASSERTS in.343 344 337 XXX: This must work for both F32 and F64. F32 is currently implemented. 345 338 Note: since the LUD routines are only implemented in F64, then we 346 339 will have to convert all F32 input vectors to F64 regardless. So, 347 the F64 port might be .340 the F64 port might be an optimization. 348 341 349 342 *****************************************************************************/ … … 360 353 psTrace("psLib.math", 3, "---- begin ----\n"); 361 354 PS_ASSERT_PTR_NON_NULL(min, false); 362 // XXX: If covar not NULL, do asserts...363 355 PS_ASSERT_VECTOR_NON_NULL(params, false); 364 356 PS_ASSERT_VECTOR_NON_EMPTY(params, false); … … 369 361 psVector *paramMax = NULL; 370 362 if (constrain != NULL) { 371 // XXX EAM : fill out the asserts372 363 paramDelta = constrain->paramDelta; 373 364 paramMin = constrain->paramMin; 374 365 paramMax = constrain->paramMax; 375 366 paramMask = constrain->paramMask; 367 PS_ASSERT_VECTOR_TYPE(paramDelta, PS_TYPE_F32, false); 368 PS_ASSERT_VECTOR_TYPE(paramMin, PS_TYPE_F32, false); 369 PS_ASSERT_VECTOR_TYPE(paramMax, PS_TYPE_F32, false); 370 PS_ASSERT_VECTORS_SIZE_EQUAL(params, paramDelta, false); 371 PS_ASSERT_VECTORS_SIZE_EQUAL(params, paramMin, false); 372 PS_ASSERT_VECTORS_SIZE_EQUAL(params, paramMax, false); 376 373 if (paramMask != NULL) { 377 374 PS_ASSERT_VECTOR_TYPE(paramMask, PS_TYPE_U8, false); … … 409 406 psF64 lambda = 0.001; 410 407 411 // why is this needed here??? the initial guess on params is provided by the user412 Params = psVectorCopy(Params, params, PS_TYPE_F32);413 414 408 // the user provides the error or NULL. we need to convert 415 409 // to appropriate weights … … 472 466 // compare the delta (min->value - Chisq) with the 473 467 // expected delta from the linear model (dLinear) 474 // accept new guess (if improvement), orincrease lambda468 // accept new guess if it is an improvement (rho > 0), or else increase lambda 475 469 psF64 rho = (min->value - Chisq) / dLinear; 476 470 … … 482 476 p_psImagePrint(psTraceGetDestination(), Alpha, "alpha guess (2)"); 483 477 p_psVectorPrint(psTraceGetDestination(), Beta, "beta guess (2)"); 484 p_psVectorPrint(psTraceGetDestination(), Params, "params guess (2)");485 478 } 486 479
Note:
See TracChangeset
for help on using the changeset viewer.
