Cloudy
Spectral Synthesis Code for Astrophysics
Loading...
Searching...
No Matches
phymir_state< X, Y, NP, NSTR > Class Template Reference

#include <optimize.h>

Public Member Functions

 phymir_state ()
void clear ()
void init_minmax (const X[], const X[], int)
void init_state_file_name (const char *)
void init_strings (const string &, const string &, const char *)
void initial_run (Y(*)(const X[], int), int, const X[], const X[], X, int, phymir_mode, int)
void continue_from_state (Y(*)(const X[], int), int, const char *, X, int, phymir_mode, int)
void optimize ()
void optimize_with_restart ()
bool lgMaxIterExceeded () const
bool lgInitialized () const
bool lgConverged () const
bool lgConvergedRestart () const
xval (int i) const
xmin (int i) const
xmax (int i) const
yval () const
int32 noptim () const

Private Member Functions

void p_clear1 ()
void p_wr_state (const char *) const
void p_rd_state (const char *)
p_execute_job (const X[], int, int)
void p_execute_job_parallel (const X[], int, int) const
void p_barrier (int, int)
void p_process_output (int, int)
void p_evaluate_hyperblock ()
void p_setup_next_hyperblock ()
void p_reset_hyperblock ()
void p_phygrm (X[][NP], int)
bool p_lgLimitExceeded (const X[]) const
p_delta (int i, int j) const
void p_reset_transformation_matrix ()

Private Attributes

p_xmax
p_ymax
p_xp [2 *NP+1][NP]
p_yp [2 *NP+1]
p_absmin [NP]
p_absmax [NP]
p_varmin [NP]
p_varmax [NP]
p_a2 [NP][NP]
p_c1 [NP]
p_c2 [NP]
p_xc [NP]
p_xcold [NP]
p_vers
p_toler
p_dmax
p_dold
p_ymin
int32 p_dim
int32 p_sdim
int32 p_nvar
int32 p_noptim
int32 p_maxiter
int32 p_jmin
int32 p_maxcpu
int32 p_curcpu
phymir_mode p_mode
char p_chState [NSTR]
char p_chStr1 [NSTR]
char p_chStr2 [NSTR]
char p_chStr3 [NSTR]
Y(* p_func )(const X[], int)

Constructor & Destructor Documentation

◆ phymir_state()

template<class X, class Y = X, int NP = 32, int NSTR = 32>
phymir_state< X, Y, NP, NSTR >::phymir_state ( )
inline

References p_clear1().

Here is the call graph for this function:

Member Function Documentation

◆ clear()

template<class X, class Y = X, int NP = 32, int NSTR = 32>
void phymir_state< X, Y, NP, NSTR >::clear ( )
inline

References p_clear1().

Here is the call graph for this function:

◆ continue_from_state()

template<class X, class Y, int NP, int NSTR>
void phymir_state< X, Y, NP, NSTR >::continue_from_state ( Y(* func )(const X[], int),
int nvar,
const char * fnam,
X toler,
int maxiter,
phymir_mode mode,
int maxcpu )

References cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, fp_equal(), p_dim, p_func, p_maxcpu, p_maxiter, p_mode, p_nvar, p_rd_state(), p_sdim, p_toler, p_vers, and VRSNEW.

Referenced by optimize_phymir().

Here is the call graph for this function:

◆ init_minmax()

template<class X, class Y, int NP, int NSTR>
void phymir_state< X, Y, NP, NSTR >::init_minmax ( const X pmin[],
const X pmax[],
int nvar )

References ASSERT, DEBUG_ENTRY, lgInitialized(), p_absmax, and p_absmin.

Here is the call graph for this function:

◆ init_state_file_name()

template<class X, class Y, int NP, int NSTR>
void phymir_state< X, Y, NP, NSTR >::init_state_file_name ( const char * fnam)

References DEBUG_ENTRY, and p_chState.

Referenced by optimize_phymir().

◆ init_strings()

template<class X, class Y, int NP, int NSTR>
void phymir_state< X, Y, NP, NSTR >::init_strings ( const string & date,
const string & version,
const char * host_name )

References DEBUG_ENTRY, NULL, p_chStr1, p_chStr2, and p_chStr3.

Referenced by optimize_phymir().

◆ initial_run()

template<class X, class Y, int NP, int NSTR>
void phymir_state< X, Y, NP, NSTR >::initial_run ( Y(* func )(const X[], int),
int nvar,
const X start[],
const X del[],
X toler,
int maxiter,
phymir_mode mode,
int maxcpu )

◆ lgConverged()

template<class X, class Y = X, int NP = 32, int NSTR = 32>
bool phymir_state< X, Y, NP, NSTR >::lgConverged ( ) const
inline

References p_dmax, and p_toler.

Referenced by lgConvergedRestart(), and optimize().

◆ lgConvergedRestart()

template<class X, class Y, int NP, int NSTR>
bool phymir_state< X, Y, NP, NSTR >::lgConvergedRestart ( ) const

References DEBUG_ENTRY, dist(), lgConverged(), p_nvar, p_toler, p_xc, p_xcold, and pow2.

Referenced by optimize_with_restart(), and p_reset_hyperblock().

Here is the call graph for this function:

◆ lgInitialized()

template<class X, class Y = X, int NP = 32, int NSTR = 32>
bool phymir_state< X, Y, NP, NSTR >::lgInitialized ( ) const
inline

References p_nvar.

Referenced by init_minmax(), optimize(), and optimize_with_restart().

◆ lgMaxIterExceeded()

template<class X, class Y = X, int NP = 32, int NSTR = 32>
bool phymir_state< X, Y, NP, NSTR >::lgMaxIterExceeded ( ) const
inline

◆ noptim()

template<class X, class Y = X, int NP = 32, int NSTR = 32>
int32 phymir_state< X, Y, NP, NSTR >::noptim ( ) const
inline

References p_noptim.

Referenced by optimize_phymir().

◆ optimize()

template<class X, class Y, int NP, int NSTR>
void phymir_state< X, Y, NP, NSTR >::optimize ( )

◆ optimize_with_restart()

template<class X, class Y, int NP, int NSTR>
void phymir_state< X, Y, NP, NSTR >::optimize_with_restart ( )

References ASSERT, DEBUG_ENTRY, lgConvergedRestart(), lgInitialized(), lgMaxIterExceeded(), optimize, and p_reset_hyperblock().

Referenced by optimize_phymir().

Here is the call graph for this function:

◆ p_barrier()

template<class X, class Y, int NP, int NSTR>
void phymir_state< X, Y, NP, NSTR >::p_barrier ( int jlo,
int jhi )
private

References DEBUG_ENTRY, MPI_Barrier, MPI_Bcast, NULL, p_curcpu, p_mode, p_process_output(), p_yp, PHYMIR_FORK, PHYMIR_MPI, PHYMIR_SEQ, TotalInsanity(), and wait.

Referenced by initial_run(), and p_evaluate_hyperblock().

Here is the call graph for this function:

◆ p_clear1()

template<class X, class Y, int NP, int NSTR>
void phymir_state< X, Y, NP, NSTR >::p_clear1 ( )
private

◆ p_delta()

template<class X, class Y = X, int NP = 32, int NSTR = 32>
X phymir_state< X, Y, NP, NSTR >::p_delta ( int i,
int j ) const
inlineprivate

◆ p_evaluate_hyperblock()

template<class X, class Y, int NP, int NSTR>
void phymir_state< X, Y, NP, NSTR >::p_evaluate_hyperblock ( )
private

References DEBUG_ENTRY, lgMaxIterExceeded(), max(), min(), p_a2, p_barrier(), p_c2, p_dmax, p_execute_job(), p_noptim, p_nvar, p_varmax, p_varmin, p_xc, p_xp, and p_yp.

Referenced by optimize().

Here is the call graph for this function:

◆ p_execute_job()

template<class X, class Y, int NP, int NSTR>
Y phymir_state< X, Y, NP, NSTR >::p_execute_job ( const X x[],
int jj,
int runNr )
private

◆ p_execute_job_parallel()

template<class X, class Y, int NP, int NSTR>
void phymir_state< X, Y, NP, NSTR >::p_execute_job_parallel ( const X x[],
int jj,
int runNr ) const
private

References DEBUG_ENTRY, ioQQQ, NULL, open_data(), p_func, p_lgLimitExceeded(), p_ymax, wr_block(), and yval().

Referenced by p_execute_job().

Here is the call graph for this function:

◆ p_lgLimitExceeded()

template<class X, class Y, int NP, int NSTR>
bool phymir_state< X, Y, NP, NSTR >::p_lgLimitExceeded ( const X x[]) const
private

◆ p_phygrm()

template<class X, class Y, int NP, int NSTR>
void phymir_state< X, Y, NP, NSTR >::p_phygrm ( X a[][NP],
int n )
private

References DEBUG_ENTRY, and pow2.

Referenced by p_setup_next_hyperblock().

◆ p_process_output()

template<class X, class Y, int NP, int NSTR>
void phymir_state< X, Y, NP, NSTR >::p_process_output ( int jlo,
int jhi )
private

References append_file(), cpu, DEBUG_ENTRY, ioQQQ, p_yp, and rd_block().

Referenced by p_barrier().

Here is the call graph for this function:

◆ p_rd_state()

template<class X, class Y, int NP, int NSTR>
void phymir_state< X, Y, NP, NSTR >::p_rd_state ( const char * fnam)
private

◆ p_reset_hyperblock()

template<class X, class Y, int NP, int NSTR>
void phymir_state< X, Y, NP, NSTR >::p_reset_hyperblock ( )
private

References DEBUG_ENTRY, lgConvergedRestart(), p_c1, p_c2, p_dmax, p_dold, p_nvar, p_reset_transformation_matrix(), p_xc, and p_xcold.

Referenced by optimize_with_restart().

Here is the call graph for this function:

◆ p_reset_transformation_matrix()

template<class X, class Y, int NP, int NSTR>
void phymir_state< X, Y, NP, NSTR >::p_reset_transformation_matrix ( )
private

References DEBUG_ENTRY, p_a2, p_delta(), and p_nvar.

Referenced by initial_run(), and p_reset_hyperblock().

Here is the call graph for this function:

◆ p_setup_next_hyperblock()

template<class X, class Y, int NP, int NSTR>
void phymir_state< X, Y, NP, NSTR >::p_setup_next_hyperblock ( )
private

References DEBUG_ENTRY, F1, F2, max(), min(), MIN2, p_a2, p_c1, p_c2, p_delta(), p_dmax, p_dold, p_jmin, p_nvar, p_phygrm(), p_xc, p_xp, p_ymin, p_yp, and pow2.

Referenced by optimize().

Here is the call graph for this function:

◆ p_wr_state()

template<class X, class Y, int NP, int NSTR>
void phymir_state< X, Y, NP, NSTR >::p_wr_state ( const char * fnam) const
private

◆ xmax()

template<class X, class Y = X, int NP = 32, int NSTR = 32>
X phymir_state< X, Y, NP, NSTR >::xmax ( int i) const
inline

References min(), p_absmax, and p_varmax.

Referenced by optimize_phymir().

Here is the call graph for this function:

◆ xmin()

template<class X, class Y = X, int NP = 32, int NSTR = 32>
X phymir_state< X, Y, NP, NSTR >::xmin ( int i) const
inline

References max(), p_absmin, and p_varmin.

Referenced by optimize_phymir().

Here is the call graph for this function:

◆ xval()

template<class X, class Y = X, int NP = 32, int NSTR = 32>
X phymir_state< X, Y, NP, NSTR >::xval ( int i) const
inline

References p_xc.

Referenced by optimize_phymir().

◆ yval()

template<class X, class Y = X, int NP = 32, int NSTR = 32>
Y phymir_state< X, Y, NP, NSTR >::yval ( ) const
inline

References p_ymin.

Referenced by optimize_phymir(), and p_execute_job_parallel().

Member Data Documentation

◆ p_a2

template<class X, class Y = X, int NP = 32, int NSTR = 32>
X phymir_state< X, Y, NP, NSTR >::p_a2[NP][NP]
private

◆ p_absmax

template<class X, class Y = X, int NP = 32, int NSTR = 32>
X phymir_state< X, Y, NP, NSTR >::p_absmax[NP]
private

◆ p_absmin

template<class X, class Y = X, int NP = 32, int NSTR = 32>
X phymir_state< X, Y, NP, NSTR >::p_absmin[NP]
private

◆ p_c1

template<class X, class Y = X, int NP = 32, int NSTR = 32>
X phymir_state< X, Y, NP, NSTR >::p_c1[NP]
private

◆ p_c2

template<class X, class Y = X, int NP = 32, int NSTR = 32>
X phymir_state< X, Y, NP, NSTR >::p_c2[NP]
private

◆ p_chState

template<class X, class Y = X, int NP = 32, int NSTR = 32>
char phymir_state< X, Y, NP, NSTR >::p_chState[NSTR]
private

◆ p_chStr1

template<class X, class Y = X, int NP = 32, int NSTR = 32>
char phymir_state< X, Y, NP, NSTR >::p_chStr1[NSTR]
private

◆ p_chStr2

template<class X, class Y = X, int NP = 32, int NSTR = 32>
char phymir_state< X, Y, NP, NSTR >::p_chStr2[NSTR]
private

◆ p_chStr3

template<class X, class Y = X, int NP = 32, int NSTR = 32>
char phymir_state< X, Y, NP, NSTR >::p_chStr3[NSTR]
private

◆ p_curcpu

template<class X, class Y = X, int NP = 32, int NSTR = 32>
int32 phymir_state< X, Y, NP, NSTR >::p_curcpu
private

◆ p_dim

template<class X, class Y = X, int NP = 32, int NSTR = 32>
int32 phymir_state< X, Y, NP, NSTR >::p_dim
private

◆ p_dmax

template<class X, class Y = X, int NP = 32, int NSTR = 32>
X phymir_state< X, Y, NP, NSTR >::p_dmax
private

◆ p_dold

template<class X, class Y = X, int NP = 32, int NSTR = 32>
X phymir_state< X, Y, NP, NSTR >::p_dold
private

◆ p_func

template<class X, class Y = X, int NP = 32, int NSTR = 32>
Y(* phymir_state< X, Y, NP, NSTR >::p_func) (const X[], int)
private

◆ p_jmin

template<class X, class Y = X, int NP = 32, int NSTR = 32>
int32 phymir_state< X, Y, NP, NSTR >::p_jmin
private

◆ p_maxcpu

template<class X, class Y = X, int NP = 32, int NSTR = 32>
int32 phymir_state< X, Y, NP, NSTR >::p_maxcpu
private

◆ p_maxiter

template<class X, class Y = X, int NP = 32, int NSTR = 32>
int32 phymir_state< X, Y, NP, NSTR >::p_maxiter
private

◆ p_mode

template<class X, class Y = X, int NP = 32, int NSTR = 32>
phymir_mode phymir_state< X, Y, NP, NSTR >::p_mode
private

◆ p_noptim

template<class X, class Y = X, int NP = 32, int NSTR = 32>
int32 phymir_state< X, Y, NP, NSTR >::p_noptim
private

◆ p_nvar

◆ p_sdim

template<class X, class Y = X, int NP = 32, int NSTR = 32>
int32 phymir_state< X, Y, NP, NSTR >::p_sdim
private

◆ p_toler

template<class X, class Y = X, int NP = 32, int NSTR = 32>
X phymir_state< X, Y, NP, NSTR >::p_toler
private

◆ p_varmax

template<class X, class Y = X, int NP = 32, int NSTR = 32>
X phymir_state< X, Y, NP, NSTR >::p_varmax[NP]
private

◆ p_varmin

template<class X, class Y = X, int NP = 32, int NSTR = 32>
X phymir_state< X, Y, NP, NSTR >::p_varmin[NP]
private

◆ p_vers

template<class X, class Y = X, int NP = 32, int NSTR = 32>
X phymir_state< X, Y, NP, NSTR >::p_vers
private

◆ p_xc

template<class X, class Y = X, int NP = 32, int NSTR = 32>
X phymir_state< X, Y, NP, NSTR >::p_xc[NP]
private

◆ p_xcold

template<class X, class Y = X, int NP = 32, int NSTR = 32>
X phymir_state< X, Y, NP, NSTR >::p_xcold[NP]
private

◆ p_xmax

template<class X, class Y = X, int NP = 32, int NSTR = 32>
X phymir_state< X, Y, NP, NSTR >::p_xmax
private

Referenced by p_clear1(), p_rd_state(), and p_wr_state().

◆ p_xp

template<class X, class Y = X, int NP = 32, int NSTR = 32>
X phymir_state< X, Y, NP, NSTR >::p_xp[2 *NP+1][NP]
private

◆ p_ymax

template<class X, class Y = X, int NP = 32, int NSTR = 32>
Y phymir_state< X, Y, NP, NSTR >::p_ymax
private

◆ p_ymin

template<class X, class Y = X, int NP = 32, int NSTR = 32>
Y phymir_state< X, Y, NP, NSTR >::p_ymin
private

◆ p_yp

template<class X, class Y = X, int NP = 32, int NSTR = 32>
Y phymir_state< X, Y, NP, NSTR >::p_yp[2 *NP+1]
private

The documentation for this class was generated from the following files: