libtpcmodel
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines
Functions | Variables
powell.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "include/powell.h"
Include dependency graph for powell.c:

Go to the source code of this file.

Functions

void _powell_linmin (double *p, double *xi, int n, double *fret, int *itnr)
double _powell_brent (double ax, double bx, double cx, double tol, double *xmin, int *itnr, int dim)
double _powell_f1dim (double x, int dim)
void _powell_mnbrak (double *ax, double *bx, double *cx, double *fa, double *fb, double *fc, int dim)
double _powell_sqr (double x)
void _powell_shft (double *a, double *b, double *c, double *d)
double _powell_fmax (double a, double b)
int powell (double *p, double *delta, int parNr, double ftol, int *iterNr, double *fret, double(*_fun)(int, double *, void *), void *fundata, int verbose)

Variables

int POWELL_LINMIN_MAXIT = 100
int _powell_ncom
double _powell_pcom [MAX_PARAMETERS]
double _powell_xicom [MAX_PARAMETERS]
double(* _powellFunc )(int, double *, void *)
void * _powellFuncData
int _powell_func_calls

Function Documentation

double _powell_brent ( double  ax,
double  bx,
double  cx,
double  tol,
double *  xmin,
int *  itnr,
int  dim 
)

Definition at line 219 of file powell.c.

References _powell_f1dim(), and _powell_shft().

Referenced by _powell_linmin().

Here is the call graph for this function:

double _powell_f1dim ( double  x,
int  dim 
)
double _powell_fmax ( double  a,
double  b 
)

Definition at line 83 of file powell.c.

Referenced by _powell_mnbrak().

void _powell_linmin ( double *  p,
double *  xi,
int  n,
double *  fret,
int *  itnr 
)

Definition at line 206 of file powell.c.

References _powell_brent(), _powell_mnbrak(), _powell_ncom, _powell_pcom, and _powell_xicom.

Referenced by powell().

Here is the call graph for this function:

void _powell_mnbrak ( double *  ax,
double *  bx,
double *  cx,
double *  fa,
double *  fb,
double *  fc,
int  dim 
)

Definition at line 271 of file powell.c.

References _powell_f1dim(), _powell_fmax(), and _powell_shft().

Referenced by _powell_linmin().

Here is the call graph for this function:

void _powell_shft ( double *  a,
double *  b,
double *  c,
double *  d 
)

Definition at line 82 of file powell.c.

Referenced by _powell_brent(), and _powell_mnbrak().

double _powell_sqr ( double  x)

Definition at line 81 of file powell.c.

Referenced by powell().

int powell ( double *  p,
double *  delta,
int  parNr,
double  ftol,
int *  iterNr,
double *  fret,
double(*)(int, double *, void *)  _fun,
void *  fundata,
int  verbose 
)

Powell function minimization routine.

Returns:
Returns 0, if succesful, 1 if required tolerance was not reached, 2 if initial guess does not give finite function value, and >2 in case of another error.
Parameters:
pInitial guess and final set of parameters
deltaInitial changes for parameters, ==0 if fixed
parNrNr of parameters
ftolFractional tolerance (for WSS); 0<ftol<1
iterNrMax nr of iterations, and nr of required iters
fretFunction return value (WSS) at minimum
_funFunction to minimize (must return the WSS)
fundataPointer to data which is passed on to the function; NULL if not needed
verboseVerbose level; if zero, then nothing is printed into stdout or stderr

Definition at line 92 of file powell.c.

References _powell_func_calls, _powell_linmin(), _powell_ncom, _powell_sqr(), _powellFunc, _powellFuncData, MAX_PARAMETERS, and POWELL_LINMIN_MAXIT.

Referenced by bootstrap(), test_powell(), and tgo().

Here is the call graph for this function:


Variable Documentation

Definition at line 71 of file powell.c.

Referenced by _powell_f1dim(), and powell().

Definition at line 67 of file powell.c.

Referenced by _powell_f1dim(), _powell_linmin(), and powell().

Definition at line 68 of file powell.c.

Referenced by _powell_f1dim(), and _powell_linmin().

Definition at line 68 of file powell.c.

Referenced by _powell_f1dim(), and _powell_linmin().

double(* _powellFunc)(int, double *, void *)

Definition at line 69 of file powell.c.

Referenced by powell().

Definition at line 70 of file powell.c.

Referenced by _powell_f1dim(), and powell().

Global variables

Definition at line 65 of file powell.c.

Referenced by powell(), and tgo().