cloudy trunk
Loading...
Searching...
No Matches
optimize.h File Reference
#include "energy.h"
#include "flux.h"
Include dependency graph for optimize.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  phymir_state< X, Y, NP, NSTR >
struct  t_optimize

Typedefs

typedef double chi2_type

Enumerations

enum  phymir_mode { PHYMIR_ILL , PHYMIR_SEQ , PHYMIR_FORK , PHYMIR_MPI }

Functions

bool lgOptimize_do (void)
void vary_input (bool *lgLimOK, int grid_index)
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)
void optimize_phymir (realnum[], const realnum[], long, chi2_type *, realnum)
chi2_type optimize_func (const realnum param[], int grid_index=-1)

Variables

const realnum VRSNEW = realnum(4.00)
const chi2_type BIG_CHI2 = chi2_type(FLT_MAX)
const long LIMEXT = 5L
const long LIMPAR = 20L
char chOptimFileName [INPUT_LINE_LENGTH]
t_optimize optimize

Typedef Documentation

◆ chi2_type

typedef double chi2_type

Definition at line 49 of file optimize.h.

Enumeration Type Documentation

◆ phymir_mode

Enumerator
PHYMIR_ILL 
PHYMIR_SEQ 
PHYMIR_FORK 
PHYMIR_MPI 

Definition at line 65 of file optimize.h.

Function Documentation

◆ lgOptimize_do()

bool lgOptimize_do ( void )

called instead of cloudy to do optimize routine,

Returns
return value is 0 if calculation is ok, 1 if disaster

Definition at line 13 of file optimize_do.cpp.

References AS_LOCAL_ONLY, called, cdEXIT, chOptimFileName, cpu, DEBUG_ENTRY, EXIT_FAILURE, input, ioQQQ, lgAbort, LIMPAR, NPLXMX, open_data(), optimize, optimize_func(), optimize_phymir(), optimize_subplex(), prt, and TotalInsanity().

Referenced by grid_do().

Here is the call graph for this function:

◆ optimize_func()

chi2_type optimize_func ( const realnum param[],
int grid_index = -1 )

optimize_func actual function called during evaluation of optimization run

Definition at line 20 of file optimize_func.cpp.

References AS1RAD, ASSERT, BIG_CHI2, called, cap4(), cdColm(), cdEXIT, cdLine(), cdTemp(), cdWarnings(), chi2_func(), cloudy(), DEBUG_ENTRY, EXIT_FAILURE, Flux::get(), grid, input, Singleton< t_PredCont >::Inst(), ioQQQ, LineSave, LineSv, max(), min(), t_PredCont::offset(), optimize, prt_wl(), radius, rfield, SMALLFLOAT, vary_input(), wavelength, and zero().

Referenced by evalf(), gridXspec(), lgOptimize_do(), and optimize_phymir().

Here is the call graph for this function:

◆ optimize_phymir()

void optimize_phymir ( realnum [],
const realnum [],
long ,
chi2_type * ,
realnum  )

Referenced by lgOptimize_do().

◆ optimize_subplex()

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

Definition at line 64 of file optimize_subplx.cpp.

References cdcopy(), DEBUG_ENTRY, evalf(), fp_equal(), isubc, MAX2, partx(), POW2, setstp(), simplx(), sortd(), subopt(), and usubc.

Referenced by lgOptimize_do().

Here is the call graph for this function:

◆ vary_input()

void vary_input ( bool * lgLimOK,
int grid_index )

vary_input sets input lines to feed into cloudy in optimization runs

Parameters
*lgLimOK

Definition at line 11 of file vary_input.cpp.

References AS_LOCAL_ONLY, cdEXIT, cpu, DEBUG_ENTRY, EXIT_FAILURE, grid, GridPointPrefix(), input, ioQQQ, mode_w, nMatch(), open_data(), optimize, save, and TotalInsanity().

Referenced by optimize_func().

Here is the call graph for this function:

Variable Documentation

◆ BIG_CHI2

const chi2_type BIG_CHI2 = chi2_type(FLT_MAX)

Definition at line 51 of file optimize.h.

Referenced by chi2_func(), and optimize_func().

◆ chOptimFileName

char chOptimFileName[INPUT_LINE_LENGTH]
extern

file name for output, set in cddefines.c

Definition at line 6 of file optimize.cpp.

Referenced by grid_do(), InitCoreload(), lgOptimize_do(), and ParseOptimize().

◆ LIMEXT

const long LIMEXT = 5L

the limit to the number of numbers on the command line

Definition at line 60 of file optimize.h.

Referenced by ParseTable(), and ParseTLaw().

◆ LIMPAR

◆ optimize

◆ VRSNEW

const realnum VRSNEW = realnum(4.00)

<I4> default to INTEGER*4

Definition at line 47 of file optimize.h.

Referenced by phymir_state< X, Y, NP, NSTR >::continue_from_state(), and phymir_state< X, Y, NP, NSTR >::p_clear1().