Changeset 6431
- Timestamp:
- Feb 15, 2006, 10:01:04 PM (20 years ago)
- File:
-
- 1 edited
-
branches/rel10_ifa/psLib/src/math/psMinimizeLMM.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/rel10_ifa/psLib/src/math/psMinimizeLMM.c
r6346 r6431 10 10 * @author EAM, IfA 11 11 * 12 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $13 * @date $Date: 2006-02- 07 23:14:21$12 * @version $Revision: 1.5.6.1 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2006-02-16 08:01:04 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 301 301 NOTES: EAM: this is my re-implementation of MinLM 302 302 303 XXX: Must implement code to handle the constrain->min, ->max, ->delta members.303 XXX: EAM : constraints added 2006.02.15 304 304 305 305 XXX: Put the ASSERTS in. … … 328 328 PS_ASSERT_VECTOR_TYPE(params, PS_TYPE_F32, false); 329 329 psVector *paramMask = NULL; 330 psVector *paramDelta = NULL; 331 psVector *paramMin = NULL; 332 psVector *paramMax = NULL; 330 333 if (constrain != NULL) { 334 // XXX EAM : fill out the asserts 335 paramDelta = constrain->paramDelta; 336 paramMin = constrain->paramMin; 337 paramMax = constrain->paramMax; 331 338 paramMask = constrain->paramMask; 332 339 if (paramMask != NULL) { 333 340 PS_ASSERT_VECTOR_TYPE(paramMask, PS_TYPE_U8, false); 334 341 PS_ASSERT_VECTORS_SIZE_EQUAL(params, paramMask, false); 335 }336 if (constrain->paramMin != NULL) {337 psLogMsg(__func__, PS_LOG_WARN, "WARNING: the constrain->paramMin vector is currently ignored.\n");338 }339 if (constrain->paramMax != NULL) {340 psLogMsg(__func__, PS_LOG_WARN, "WARNING: the constrain->paramMax vector is currently ignored.\n");341 }342 if (constrain->paramDelta != NULL) {343 psLogMsg(__func__, PS_LOG_WARN, "WARNING: the constrain->paramDelta vector is currently ignored.\n");344 342 } 345 343 } … … 373 371 psF64 Chisq = 0.0; 374 372 psF64 lambda = 0.001; 375 // XXX: Code this properly. Don't use mustFree00.376 psBool mustFree00 = false;377 psVector *beta_lim = NULL;378 psVector *param_min = NULL;379 psVector *param_max = NULL;380 381 // if we are provided a covar image, we expect to find these three vectors in first three rows382 if (covar != NULL) {383 mustFree00 = true;384 beta_lim = psVectorAlloc(params->n, PS_TYPE_F32);385 param_min = psVectorAlloc(params->n, PS_TYPE_F32);386 param_max = psVectorAlloc(params->n, PS_TYPE_F32);387 for (int i = 0; i < params->n; i++) {388 beta_lim->data.F32[i] = covar->data.F64[0][i];389 param_min->data.F32[i] = covar->data.F64[1][i];390 param_max->data.F32[i] = covar->data.F64[2][i];391 }392 psImageRecycle(covar, params->n, params->n, PS_TYPE_F64);393 }394 373 395 374 // why is this needed here??? the initial guess on params is provided by the user … … 431 410 // set a new guess for Alpha, Beta, Params 432 411 p_psMinLM_GuessABP(Alpha, Beta, Params, alpha, beta, params, paramMask, 433 beta_lim, param_min, param_max, lambda);412 paramDelta, paramMin, paramMax, lambda); 434 413 435 414 // measure linear model prediction … … 488 467 if (covar != NULL) { 489 468 p_psMinLM_GuessABP(covar, Beta, Params, alpha, beta, params, paramMask, 490 beta_lim, param_min, param_max, 0.0);469 paramDelta, paramMin, paramMax, 0.0); 491 470 } 492 471 … … 499 478 if (yWt == NULL) { 500 479 psFree(dy); 501 }502 if (mustFree00 == true) {503 psFree(beta_lim);504 psFree(param_min);505 psFree(param_max);506 480 } 507 481 if (min->iter == min->maxIter) {
Note:
See TracChangeset
for help on using the changeset viewer.
