Cloudy
Spectral Synthesis Code for Astrophysics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
optimize_subplx.cpp File Reference
#include "cddefines.h"
#include "optimize.h"
Include dependency graph for optimize_subplx.cpp:

Classes

struct  t_usubc
 
struct  t_isubc
 

Macros

#define S(I_, J_)   (*(s+(I_)*(ns)+(J_)))
 
#define S(I_, J_)   (*(s+(I_)*(ns)+(J_)))
 
#define S(I_, J_)   (*(s+(I_)*(ns)+(J_)))
 

Functions

STATIC void calcc (long, realnum *, long, long, int, realnum[])
 
STATIC double cdasum (long, realnum[], long)
 
STATIC void cdaxpy (long, double, realnum[], long, realnum[], long)
 
STATIC void cdcopy (long, realnum[], long, realnum[], long)
 
STATIC void csscal (long, double, realnum[], long)
 
STATIC double dist (long, realnum[], realnum[])
 
STATIC void evalf (long, long[], realnum[], long, realnum[], realnum *, long *)
 
STATIC void fstats (double, long, int)
 
STATIC void newpt (long, double, realnum[], realnum[], int, realnum[], int *)
 
STATIC void order (long, realnum[], long *, long *, long *)
 
STATIC void partx (long, long[], realnum[], long *, long[])
 
STATIC void setstp (long, long, realnum[], realnum[])
 
STATIC void simplx (long, realnum[], long, long[], long, int, realnum[], realnum *, long *, realnum *, realnum[], long *)
 
STATIC void sortd (long, realnum[], long[])
 
STATIC void start (long, realnum[], realnum[], long, long[], realnum *, int *)
 
STATIC void subopt (long)
 
void optimize_subplex (long int n, double tol, long int maxnfe, long int mode, realnum scale[], realnum x[], realnum *fx, long int *nfe, realnum work[], long int iwork[], long int *iflag)
 
STATIC void subopt (long int n)
 
STATIC void cdcopy (long int n, realnum dx[], long int incx, realnum dy[], long int incy)
 
STATIC void evalf (long int ns, long int ips[], realnum xs[], long int n, realnum x[], realnum *sfx, long int *nfe)
 
STATIC void setstp (long int nsubs, long int n, realnum deltax[], realnum step[])
 
STATIC void sortd (long int n, realnum xkey[], long int ix[])
 
STATIC void partx (long int n, long int ip[], realnum absdx[], long int *nsubs, long int nsvals[])
 
STATIC void simplx (long int n, realnum step[], long int ns, long int ips[], long int maxnfe, int cmode, realnum x[], realnum *fx, long int *nfe, realnum *s, realnum fs[], long int *iflag)
 
STATIC void fstats (double fx, long int ifxwt, int reset)
 
STATIC double cdasum (long int n, realnum dx[], long int incx)
 
STATIC void csscal (long int n, double da, realnum dx[], long int incx)
 
STATIC void start (long int, realnum x[], realnum step[], long int ns, long int ips[], realnum *s, int *small)
 
STATIC void order (long int npts, realnum fs[], long int *il, long int *is, long int *ih)
 
STATIC double dist (long int n, realnum x[], realnum y[])
 
STATIC void calcc (long int ns, realnum *s, long int ih, long int inew, int updatc, realnum c[])
 
STATIC void newpt (long int ns, double coef, realnum xbase[], realnum xold[], int IntNew, realnum xnew[], int *small)
 
STATIC void cdaxpy (long int n, double da, realnum dx[], long int incx, realnum dy[], long int incy)
 

Variables

struct t_usubc usubc
 
struct t_isubc isubc
 

Macro Definition Documentation

#define S (   I_,
  J_ 
)    (*(s+(I_)*(ns)+(J_)))
#define S (   I_,
  J_ 
)    (*(s+(I_)*(ns)+(J_)))

Function Documentation

STATIC void calcc ( long  ,
realnum ,
long  ,
long  ,
int  ,
realnum  [] 
)

Referenced by simplx().

STATIC void calcc ( long int  ns,
realnum s,
long int  ih,
long int  inew,
int  updatc,
realnum  c[] 
)

References cdaxpy(), cdcopy(), csscal(), DEBUG_ENTRY, and S.

Here is the call graph for this function:

STATIC double cdasum ( long  ,
realnum  [],
long   
)

Referenced by setstp().

STATIC double cdasum ( long int  n,
realnum  dx[],
long int  incx 
)

References DEBUG_ENTRY.

STATIC void cdaxpy ( long  ,
double  ,
realnum  [],
long  ,
realnum  [],
long   
)

Referenced by calcc().

STATIC void cdaxpy ( long int  n,
double  da,
realnum  dx[],
long int  incx,
realnum  dy[],
long int  incy 
)

References DEBUG_ENTRY.

STATIC void cdcopy ( long  ,
realnum  [],
long  ,
realnum  [],
long   
)

Referenced by calcc(), optimize_subplex(), simplx(), and start().

STATIC void cdcopy ( long int  n,
realnum  dx[],
long int  incx,
realnum  dy[],
long int  incy 
)

References DEBUG_ENTRY.

STATIC void csscal ( long  ,
double  ,
realnum  [],
long   
)

Referenced by calcc(), and setstp().

STATIC void csscal ( long int  n,
double  da,
realnum  dx[],
long int  incx 
)

References DEBUG_ENTRY.

STATIC double dist ( long int  n,
realnum  x[],
realnum  y[] 
)

References DEBUG_ENTRY, and POW2.

STATIC void evalf ( long  ,
long  [],
realnum  [],
long  ,
realnum  [],
realnum ,
long *   
)

Referenced by optimize_subplex(), and simplx().

STATIC void evalf ( long int  ns,
long int  ips[],
realnum  xs[],
long int  n,
realnum  x[],
realnum sfx,
long int *  nfe 
)
STATIC void fstats ( double  ,
long  ,
int   
)

Referenced by evalf().

STATIC void fstats ( double  fx,
long int  ifxwt,
int  reset 
)
STATIC void newpt ( long  ,
double  ,
realnum  [],
realnum  [],
int  ,
realnum  [],
int *   
)

Referenced by simplx().

STATIC void newpt ( long int  ns,
double  coef,
realnum  xbase[],
realnum  xold[],
int  IntNew,
realnum  xnew[],
int *  small 
)

References DEBUG_ENTRY.

void optimize_subplex ( long int  n,
double  tol,
long int  maxnfe,
long int  mode,
realnum  scale[],
realnum  x[],
realnum fx,
long int *  nfe,
realnum  work[],
long int  iwork[],
long int *  iflag 
)

optimize_subplex is the main driver, and only exposed, routine for the cowan downhill simplex routine

Parameters
n
tol
maxnfe
mode
scale[]
x[]
*fx
*nfe
work[]
iwork[]
*iflag

References t_usubc::alpha, t_usubc::beta, t_usubc::bonus, cdcopy(), DEBUG_ENTRY, t_usubc::delta, evalf(), t_isubc::fbonus, fp_equal(), t_usubc::fstop, t_usubc::ftest, t_usubc::gamma, t_usubc::ifxsw, t_usubc::initx, t_isubc::IntNew, t_usubc::irepl, isubc, MAX2, t_usubc::minf, t_usubc::nfstop, t_usubc::nfxe, t_usubc::nsmax, t_usubc::nsmin, t_usubc::omega, partx(), POW2, t_usubc::psi, setstp(), t_isubc::sfstop, simplx(), sortd(), subopt(), and usubc.

Referenced by optimize_do().

Here is the call graph for this function:

STATIC void order ( long  ,
realnum  [],
long *  ,
long *  ,
long *   
)

Referenced by dawson10(), FastVoigtH(), and simplx().

STATIC void order ( long int  npts,
realnum  fs[],
long int *  il,
long int *  is,
long int *  ih 
)

References DEBUG_ENTRY.

STATIC void partx ( long  ,
long  [],
realnum  [],
long *  ,
long  [] 
)

Referenced by optimize_subplex().

STATIC void partx ( long int  n,
long int  ip[],
realnum  absdx[],
long int *  nsubs,
long int  nsvals[] 
)
STATIC void setstp ( long  ,
long  ,
realnum  [],
realnum  [] 
)

Referenced by optimize_subplex().

STATIC void setstp ( long int  nsubs,
long int  n,
realnum  deltax[],
realnum  step[] 
)

References cdasum(), csscal(), DEBUG_ENTRY, MAX2, MIN2, t_usubc::omega, t_usubc::psi, sign(), and usubc.

Here is the call graph for this function:

STATIC void simplx ( long  ,
realnum  [],
long  ,
long  [],
long  ,
int  ,
realnum  [],
realnum ,
long *  ,
realnum ,
realnum  [],
long *   
)

Referenced by optimize_subplex().

STATIC void simplx ( long int  n,
realnum  step[],
long int  ns,
long int  ips[],
long int  maxnfe,
int  cmode,
realnum  x[],
realnum fx,
long int *  nfe,
realnum s,
realnum  fs[],
long int *  iflag 
)
STATIC void sortd ( long  ,
realnum  [],
long  [] 
)

Referenced by optimize_subplex().

STATIC void sortd ( long int  n,
realnum  xkey[],
long int  ix[] 
)

References DEBUG_ENTRY.

STATIC void start ( long  ,
realnum  [],
realnum  [],
long  ,
long  [],
realnum ,
int *   
)

Referenced by simplx().

STATIC void start ( long  int,
realnum  x[],
realnum  step[],
long int  ns,
long int  ips[],
realnum s,
int *  small 
)

References cdcopy(), DEBUG_ENTRY, and S.

Here is the call graph for this function:

STATIC void subopt ( long  )

Referenced by optimize_subplex().

Variable Documentation

struct t_isubc isubc

Referenced by evalf(), optimize_subplex(), and simplx().