Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

psMinimize.h

Go to the documentation of this file.
00001 /** @file  psMinimize.c
00002  *  \brief basic minimization functions
00003  *  @ingroup Math
00004  *
00005  *  This file will contain function prototypes for various minimization,
00006  *  chi-squared minimization, and 1-D polynomial fitting routines.
00007  *
00008  *  @author GLG, MHPCC
00009  *
00010  *  @version $Revision: 1.39 $ $Name: rel5_0 $
00011  *  @date $Date: 2005/02/17 19:26:23 $
00012  *
00013  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
00014  *
00015  */
00016 
00017 #if !defined(PS_MINIMIZE_H)
00018 #define PS_MINIMIZE_H
00019 
00020 /** \file psMinimize.h
00021  *  \brief minimization operations
00022  *  \ingroup Stats
00023  */
00024 /** \addtogroup Stats
00025  *  \{
00026  */
00027 
00028 #include "psVector.h"
00029 #include "psMemory.h"
00030 #include "psArray.h"
00031 #include "psImage.h"
00032 #include "psMatrix.h"
00033 #include "psFunctions.h"
00034 #include "psStats.h"
00035 #include "psTrace.h"
00036 #include "psError.h"
00037 #include "psConstants.h"
00038 
00039 typedef struct
00040 {
00041     psS32 maxIter;                       ///< Convergence limit
00042     psF32 tol;                         ///< Error Tolerance
00043     psF32 value;                       ///< Value of function at minimum
00044     psS32 iter;                          ///< Number of iterations required
00045     psF32 lastDelta;                   ///< The last difference for the fit
00046 }
00047 psMinimization;
00048 
00049 psMinimization *psMinimizationAlloc(psS32 maxIter,
00050                                     psF32 tol);
00051 
00052 /** Derive a polynomial fit.
00053  *
00054  *  psVectorFitPolynomial1d returns the polynomial that best fits the 
00055  *  observations. The input parameters are a polynomial that specifies the 
00056  *  fit order, myPoly, which will be altered and returned with the best-fit 
00057  *  coefficients; and the observations, x, y and yErr. The independent 
00058  *  variable list, x may be NULL, in which case the vector index is used. 
00059  *  The dependent variable error, yErr may be null, in which case the solution 
00060  *  is determined in the assumption that all data errors are equal. This 
00061  *  function must be valid only for types psF32, psF64.
00062  *
00063  *  @return psPolynomial1D*    polynomial fit
00064  */
00065 psPolynomial1D* psVectorFitPolynomial1D(
00066     psPolynomial1D* myPoly,            ///< Polynomial to fit
00067     const psVector* x,                 ///< Ordinates (or NULL to just use the indices)
00068     const psVector* y,                 ///< Coordinates
00069     const psVector* yErr               ///< Errors in coordinates, or NULL
00070 );
00071 
00072 psSpline1D *psVectorFitSpline1D(psSpline1D *mySpline,     ///< The spline which will be generated.
00073                                 const psVector* x,        ///< Ordinates (or NULL to just use the indices)
00074                                 const psVector* y,        ///< Coordinates
00075                                 const psVector* yErr      ///< Errors in coordinates, or NULL
00076                                );
00077 
00078 typedef
00079 psVector* (*psMinimizeLMChi2Func)(psImage *deriv,
00080                                   const psVector *params,
00081                                   const psArray *x);
00082 
00083 psBool psMinimizeLMChi2(psMinimization *min,
00084                         psImage *covar,
00085                         psVector *params,
00086                         const psVector *paramMask,
00087                         const psArray *x,
00088                         const psVector *y,
00089                         const psVector *yErr,
00090                         psMinimizeLMChi2Func func);
00091 
00092 typedef
00093 psF32 (*psMinimizePowellFunc)(const psVector *params,
00094                               const psArray *coords);
00095 
00096 psBool psMinimizePowell(psMinimization *min,
00097                         psVector *params,
00098                         const psVector *paramMask,
00099                         const psArray *coords,
00100                         psMinimizePowellFunc func);
00101 
00102 psVector *psMinimizeLMChi2Gauss1D(psImage *deriv,
00103                                   const psVector *params,
00104                                   const psArray *coords);
00105 
00106 psVector *psMinimizePowellChi2Gauss1D(const psVector *params,
00107                                       const psArray *coords);
00108 
00109 typedef
00110 psVector *(*psMinimizeChi2PowellFunc)(const psVector *params,
00111                                       const psArray *coords);
00112 
00113 psBool psMinimizeChi2Powell(psMinimization *min,
00114                             psVector *params,
00115                             const psVector *paramMask,
00116                             const psArray *coords,
00117                             const psVector *value,
00118                             const psVector *error,
00119                             psMinimizeChi2PowellFunc func);
00120 
00121 
00122 
00123 /* \} */// End of MathGroup Functions
00124 
00125 #endif
00126 

Generated on Mon Apr 4 18:24:45 2005 for Pan-STARRS Foundation Library by  doxygen 1.3.9.1