IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 3987


Ignore:
Timestamp:
May 19, 2005, 12:50:05 PM (21 years ago)
Author:
gusciora
Message:

Added comment.

Location:
trunk/psLib/test/dataManip
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/dataManip/tst_psFunc08.c

    r3682 r3987  
    44*  ORD and CHEB type polynomials.
    55*
    6 *  @version  $Revision: 1.2 $  $Name: not supported by cvs2svn $
    7 *  @date  $Date: 2005-04-07 20:27:42 $
     6*  @version  $Revision: 1.3 $  $Name: not supported by cvs2svn $
     7*  @date  $Date: 2005-05-19 22:50:05 $
     8*
     9*  XXX: Probably should test single- and multi-dimensional polynomials in
     10*  which one diminsion is constant (n == 1).
    811*
    912* Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii
  • trunk/psLib/test/dataManip/tst_psMinimize06.c

    r3682 r3987  
    5151    return(sum);
    5252}
     53
     54/*****************************************************************************
     55myFuncEAM(): This routine subtracts the associate value in expectedParm[] from
     56each parameter and then squares it, then sums that for all parameters, then
     57adds MIN_VALUE to it.  The minimum for this function will be MIN_VALUE, and
     58will occur when each parameter equals the associated value in expectedParm[].
     59 
     60This procedure ignores the coordinates, other than to ensure that they were
     61passed correctly from psMinimizePowell().
     62 
     63 *****************************************************************************/
     64psVector *myFuncEAM(psImage *myDeriv,
     65                    psVector *myParams,
     66                    psArray *myCoords)
     67{
     68    psVector *sum = psVectorAlloc(myCoords->n, PS_TYPE_F32);
     69    psS32 i;
     70    psS32 j;
     71
     72
     73    if (myDeriv == NULL) {
     74        myDeriv = psImageAlloc(myParams->n, myCoords->n, PS_TYPE_F32);
     75        psError(PS_ERR_UNKNOWN, true, "myDeriv is NULL.\n");
     76    }
     77
     78    for (i=0;i<N;i++) {
     79        sum->data.F32[i] = MIN_VALUE;
     80        for (j=0;j<NUM_PARAMS;j++) {
     81            sum->data.F32[i]+= (myParams->data.F32[j] - expectedParm[j]) *
     82                               (myParams->data.F32[j] - expectedParm[j]);
     83
     84            myDeriv->data.F32[i][j] = (2.0 * myParams->data.F32[j]) -
     85                                      (2.0 * expectedParm[j]);
     86        }
     87    }
     88
     89    return(sum);
     90}
     91
    5392
    5493psS32 t01()
Note: See TracChangeset for help on using the changeset viewer.