Go to the documentation of this file.
23 #ifndef O2SCL_MMIN_FIX_H
24 #define O2SCL_MMIN_FIX_H
32 #include <o2scl/mmin.h>
33 #include <o2scl/mmin_simp2.h>
35 #ifndef DOXYGEN_NO_O2NS
98 virtual int mmin(
size_t nvar, vec_t &x,
double &fmin,
101 if (
fixp.size()<nvar) {
103 for(
size_t i=0;i<nvar;i++)
fixp[i]=
false;
112 for(
size_t i=0;i<nvar;i++) {
120 for(
size_t i=0;i<nvar;i++) {
121 if (
fixp[i]==
false) {
135 O2SCL_ERR(
"Minimizer failed in mmin_fix_params::mmin_fix().",ret);
140 for(
size_t i=0;i<nvar;i++) {
141 if (
fixp[i]==
false) {
152 template<
class bool_vec_t>
void set_fix(
size_t n, bool_vec_t &fix) {
154 for(
size_t i=0;i<n;i++)
fixp[i]=fix[i];
167 template<
class bool_vec_t>
172 for(
size_t i=0;i<nvar;i++)
fixp[i]=fix[i];
174 return mmin(nvar,x,fmin,func);
193 for(
size_t i=0;i<
unv;i++) {
204 #ifndef DOXYGEN_INTERNAL
236 #ifndef DOXYGEN_NO_O2NS
Multidimensional minimization by the Simplex method (v2) (GSL)
virtual double operator()(size_t nv, const vec_t &x)
The new function to send to the minimizer.
virtual int mmin(size_t nvar, vec_t &x, double &fmin, func_t &func)
Calculate the minimum min of func w.r.t. the array x of size nvar.
base_mmin_t * mmp
The minimizer.
The main O<span style='position: relative; top: 0.3em; font-size: 0.8em'>2</span>scl O$_2$scl names...
int ntrial
Maximum number of iterations.
int last_ntrial
The number of iterations for in the most recent minimization.
def_mmin_t def_mmin
The default base minimizer.
size_t unv
The user-specified number of variables.
size_t nv_new
The new number of variables.
mmin_base< mmin_fix_params< func_t, vec_t >, mmin_fix_params< func_t, vec_t >, vec_t > base_mmin_t
The generic minimizer type.
vec_t * xp
The user-specified initial vector.
std::function< double(size_t, const boost::numeric::ublas::vector< double > &)> multi_funct
Multi-dimensional function typedef in src/base/multi_funct.h.
double tol_rel
Function value tolerance.
int verbose
Output control.
int mmin_fix(size_t nvar, ubvector &x, double &fmin, bool_vec_t &fix, multi_funct &func)
Calculate the minimum of func while fixing some parameters as specified in fix.
Multidimensional minimizer fixing some parameters and varying others.
int set_mmin(base_mmin_t &min)
Change the base minimizer.
Multidimensional minimization [abstract base].
#define O2SCL_ERR(d, n)
Set an error with message d and code n.
std::vector< bool > fixp
Specify which parameters to fix.
virtual int mmin(size_t nvar, vec_t &x, double &fmin, func_t &func)=0
Calculate the minimum min of func w.r.t. the array x of size nvar.
mmin_simp2< mmin_fix_params< func_t, vec_t >, vec_t > def_mmin_t
The default minimizer type.
mmin_fix_params()
Specify the member function pointer.
func_t * funcp
The user-specified function.
double tol_abs
The independent variable tolerance.
Documentation generated with Doxygen. Provided under the
GNU Free Documentation License (see License Information).