IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 27, 2006, 10:08:58 AM (20 years ago)
Author:
gusciora
Message:

I added tests for psImageSmooth, modified the psStats stuff and the Min
routines.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/math/psMinimizeLMM.c

    r6204 r6226  
    1010 *  @author EAM, IfA
    1111 *
    12  *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2006-01-26 21:10:22 $
     12 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2006-01-27 20:08:58 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    277277NOTES: EAM: this is my re-implementation of MinLM
    278278 
     279XXX: Must implement code to handle the constrain->min, ->max, ->delta members.
     280 
    279281XXX: Put the ASSERTS in.
    280282 
     
    283285     will have to convert all F32 input vectors to F64 regardless.  So,
    284286     the F64 port might be.
     287 
    285288  *****************************************************************************/
    286289psBool psMinimizeLMChi2(
     
    288291    psImage *covar,
    289292    psVector *params,
    290     const psVector *paramMask,
     293    psMinConstrain *constrain,
    291294    const psArray *x,
    292295    const psVector *y,
     
    300303    PS_ASSERT_VECTOR_NON_EMPTY(params, false);
    301304    PS_ASSERT_VECTOR_TYPE(params, PS_TYPE_F32, false);
    302     if (paramMask != NULL) {
    303         PS_ASSERT_VECTOR_TYPE(paramMask, PS_TYPE_U8, false);
    304         PS_ASSERT_VECTORS_SIZE_EQUAL(params, paramMask, false);
     305    psVector *paramMask = NULL;
     306    if (constrain != NULL) {
     307        paramMask = constrain->paramMask;
     308        if (paramMask != NULL) {
     309            PS_ASSERT_VECTOR_TYPE(paramMask, PS_TYPE_U8, false);
     310            PS_ASSERT_VECTORS_SIZE_EQUAL(params, paramMask, false);
     311        }
     312        if (constrain->paramMin != NULL) {
     313            psLogMsg(__func__, PS_LOG_WARN, "WARNING: the constrain->paramMin vector is currently ignored.\n");
     314        }
     315        if (constrain->paramMax != NULL) {
     316            psLogMsg(__func__, PS_LOG_WARN, "WARNING: the constrain->paramMax vector is currently ignored.\n");
     317        }
     318        if (constrain->paramDelta != NULL) {
     319            psLogMsg(__func__, PS_LOG_WARN, "WARNING: the constrain->paramDelta vector is currently ignored.\n");
     320        }
    305321    }
    306322    PS_ASSERT_PTR_NON_NULL(x, false);
     
    592608    return( psMemGetDeallocator(ptr) == (psFreeFunc)minimizationFree );
    593609}
     610
     611
     612static void constrainFree(psMinConstrain *tmp)
     613{
     614    // There are no dynamically allocated items
     615}
     616
     617psMinConstrain* psMinConstrainAlloc()
     618{
     619    psMinConstrain *tmp = psAlloc(sizeof(psMinConstrain));
     620    tmp->paramMask = NULL;
     621    tmp->paramMax = NULL;
     622    tmp->paramMin = NULL;
     623    tmp->paramDelta = NULL;
     624
     625    return(tmp);
     626}
     627
     628bool psMemCheckConstrain(psPtr tmp)
     629{
     630    return( psMemGetDeallocator(tmp) == (psFreeFunc)constrainFree );
     631}
Note: See TracChangeset for help on using the changeset viewer.