Rhino C++ API  8.12
Public Member Functions | Friends | List of all members
ON_SimpleMinimizer Class Reference

#include <opennurbs_plus.h>

Public Member Functions

 ON_SimpleMinimizer (int dim, const ON_Interval *domain, int max_it, double val_tol, const double *convergence_tol)
 
virtual ~ON_SimpleMinimizer ()
 
int Dimension () const
 
virtual bool Ev (const double *params, double *f, double *df, double **ddf) const
 pure virtual More...
 
int LineEval (double t, double *f, double *df)
 
bool Minimize (const double *seed, double *val, double *params, bool *bError)
 

Friends

class CSimpleMinBrent
 

Detailed Description

ON_SimpleMinimizer should be used as a local minimizer of positive valued G2 functions. It requires first and second derivatives This is a local minimizer. If it hits the edge of the domain and the only way down is out of the domain, it will stop and consider itself successful. Failure means that the iteration count limit was hit and there was no convergence. In that case, the result will be no larger that that of the seed, and may be of use.

Constructor & Destructor Documentation

◆ ON_SimpleMinimizer()

ON_SimpleMinimizer::ON_SimpleMinimizer ( int  dim,
const ON_Interval domain,
int  max_it,
double  val_tol,
const double *  convergence_tol 
)
Parameters
domaindim of them
max_itstop after this many iterations
val_tolStop if the function value is below this. If <= 0, only convergence_tol will be used.
convergence_toldim of them. Stop if the change from an iteration is within these. Any that is less than ON_EPSILON^2 will be replaced by N_EPSILON^2.

◆ ~ON_SimpleMinimizer()

virtual ON_SimpleMinimizer::~ON_SimpleMinimizer ( )
virtual

Member Function Documentation

◆ Dimension()

int ON_SimpleMinimizer::Dimension ( ) const

◆ Ev()

virtual bool ON_SimpleMinimizer::Ev ( const double *  params,
double *  f,
double *  df,
double **  ddf 
) const
virtual

pure virtual

Parameters
paramsdim
fFunction value.
dfFirst partials. dim of them ort NULL
ddfSecond partials. dim x dim or NULL. If df is NULL, ddf will not be computed.

◆ LineEval()

int ON_SimpleMinimizer::LineEval ( double  t,
double *  f,
double *  df 
)

◆ Minimize()

bool ON_SimpleMinimizer::Minimize ( const double *  seed,
double *  val,
double *  params,
bool *  bError 
)

If bError is true, val and params will not be filled in. If bError is false, val and params will be filled in with the best result found. In this case, a return of false means that the tolerances were not met.

Parameters
seedInput. Dim of them
valOutput. Minimum function value found.
paramsOutput. Dim of them. Parameters of minimum.
bErrorOutput. If true, then there was a serious problem and the results in val and params are garbage.

Friends And Related Function Documentation

◆ CSimpleMinBrent

friend class CSimpleMinBrent
friend