Opt is the Base Optimization Class All other Optimization classes are derived from this one. More...
Public Member Functions | |
virtual void | acceptStep (int, int)=0 |
virtual int | checkConvg ()=0 |
void | cleanup () |
virtual NEWMAT::ColumnVector | computeSearch (NEWMAT::SymmetricMatrix &)=0 |
bool | Debug () |
int | getDim () const |
NEWMAT::ColumnVector | getFcnScale () const |
int | getIter () const |
ostream * | getOutputFile () |
int | getReturnCode () const |
NEWMAT::ColumnVector | getXPrev () const |
NEWMAT::ColumnVector | getXScale () const |
virtual void | optimize ()=0 |
OptimizeClass (int n, TOLS t) | |
OptimizeClass (TOLS t) | |
OptimizeClass (int n) | |
OptimizeClass () | |
Default Constructor. | |
virtual void | printStatus (char *)=0 |
virtual void | readOptInput ()=0 |
virtual void | reset ()=0 |
void | setConTol (real x) |
Set constraint tolerance. | |
void | setDebug () |
Set debug flag to true. | |
void | setFcnScale (NEWMAT::Real x) |
Set function scale. | |
void | setFcnScale (NEWMAT::ColumnVector x) |
Set function scale. | |
void | setFcnTol (real x) |
Set function tolerance. | |
void | setGradTol (real x) |
Set gradient tolerance. | |
void | setLineSearchTol (real x) |
Set linesearch tolerance. | |
void | setMaxBacktrackIter (int k) |
Set maximum backtrack iterations. | |
void | setMaxFeval (int k) |
Set maximum fcn evaluations. | |
void | setMaxIter (int k) |
Set maximum outer iterations. | |
void | setMaxStep (real x) |
Set maximum steplength. | |
void | setMesg (const char *s) |
Set message. | |
void | setMethod (const char *s) |
Set method of choice. | |
void | setMinStep (real x) |
Set minimum steplength. | |
int | setOutputFile (ostream &fout) |
int | setOutputFile (int FileDescriptor) |
int | setOutputFile (const char *filename, int append) |
void | setReturnCode (int val) |
Set return code. | |
void | setStepTol (real x) |
Set step tolerance. | |
void | setUpdateModel (UPDATEFCN u) |
Set update model. | |
void | setXScale (NEWMAT::ColumnVector x) |
Set step scale. | |
virtual void | updateModel (int, int, NEWMAT::ColumnVector)=0 |
Protected Member Functions | |
void | copyright () |
Write copyright information to the screen. | |
virtual void | defaultAcceptStep (int, int) |
Provide default implementation of AcceptStep. | |
virtual void | defaultReset (int n) |
Provide default implementation of reset. | |
virtual void | defaultUpdateModel (int k, int ndim, NEWMAT::ColumnVector x) |
Provide default implementation of UpdateModel. | |
virtual real | stepTolNorm () const |
Protected Attributes | |
int | backtracks |
Number of bactracks in linesearch. | |
bool | debug_ |
Print debug statements. | |
int | dim |
Dimension of the problem. | |
int | fcn_evals |
Number of function evaluations taken. | |
filebuf | file_buffer |
real | fprev |
Objective function value at xprev. | |
int | iter_taken |
Number of iterations taken. | |
double | iter_time |
Compute time per iteration. | |
NEWMAT::ColumnVector | mem_step |
Current step direction. | |
char | mesg [80] |
Optional message. | |
char | method [80] |
What method is being used. | |
ostream * | optout |
Output file. | |
int | optout_fd |
Output file success. | |
int | ret_code |
Return code from Optimization class. | |
NEWMAT::ColumnVector | sfx |
Diagonal Scaling Matrix for f. | |
real | step_length |
Length of step direction. | |
NEWMAT::ColumnVector | sx |
Diagonal Scaling Matrix for x. | |
TOLS | tol |
Various tolerances assoc. with the problem. | |
double | total_time |
Total compute time. | |
int | trace |
UPDATEFCN | update_fcn |
User defined function to call after each nonlinear iteration. | |
NEWMAT::ColumnVector | xprev |
Previous iterate. |
Opt is the Base Optimization Class All other Optimization classes are derived from this one.
Definition at line 108 of file Opt.h.
OPTPP::OptimizeClass::OptimizeClass | ( | ) | [inline] |
Default Constructor.
Definition at line 217 of file Opt.h.
References optout, optout_fd, OPTPP::TOLS::setDefaultTol(), tol, and update_fcn.
OPTPP::OptimizeClass::OptimizeClass | ( | int | n | ) | [inline] |
n | an integer argument |
Definition at line 231 of file Opt.h.
References optout, optout_fd, OPTPP::TOLS::setDefaultTol(), sfx, sx, tol, update_fcn, and xprev.
OPTPP::OptimizeClass::OptimizeClass | ( | TOLS | t | ) | [inline] |
OPTPP::OptimizeClass::OptimizeClass | ( | int | n, | |
TOLS | t | |||
) | [inline] |
virtual void OPTPP::OptimizeClass::acceptStep | ( | int | , | |
int | ||||
) | [pure virtual] |
Implemented in OPTPP::OptBaNewton, OPTPP::OptBaQNewton, OPTPP::OptBCEllipsoid, OPTPP::OptBCNewtonLike, OPTPP::OptCGLike, OPTPP::OptCG, OPTPP::OptConstrNewtonLike, OPTPP::OptLBFGSLike, OPTPP::OptLBFGS, OPTPP::OptNewtonLike, OPTPP::OptNPSOL, OPTPP::OptDirect, and OPTPP::OptPDS.
void OPTPP::OptimizeClass::copyright | ( | ) | [inline, protected] |
bool OPTPP::OptimizeClass::Debug | ( | ) | [inline] |
virtual void OPTPP::OptimizeClass::defaultAcceptStep | ( | int | , | |
int | ||||
) | [inline, protected, virtual] |
Provide default implementation of AcceptStep.
Reimplemented in OPTPP::OptBCNewtonLike, OPTPP::OptConstrNewtonLike, and OPTPP::OptNewtonLike.
Definition at line 179 of file Opt.h.
References debug_, and optout.
Referenced by OPTPP::OptPDS::acceptStep(), OPTPP::OptLBFGS::acceptStep(), and OPTPP::OptCG::acceptStep().
virtual void OPTPP::OptimizeClass::defaultReset | ( | int | n | ) | [inline, protected, virtual] |
virtual void OPTPP::OptimizeClass::defaultUpdateModel | ( | int | k, | |
int | ndim, | |||
NEWMAT::ColumnVector | x | |||
) | [inline, protected, virtual] |
Provide default implementation of UpdateModel.
Definition at line 185 of file Opt.h.
References update_fcn.
int OPTPP::OptimizeClass::getDim | ( | ) | const [inline] |
NEWMAT::ColumnVector OPTPP::OptimizeClass::getFcnScale | ( | ) | const [inline] |
int OPTPP::OptimizeClass::getIter | ( | ) | const [inline] |
ostream* OPTPP::OptimizeClass::getOutputFile | ( | ) | [inline] |
int OPTPP::OptimizeClass::getReturnCode | ( | ) | const [inline] |
NEWMAT::ColumnVector OPTPP::OptimizeClass::getXPrev | ( | ) | const [inline] |
NEWMAT::ColumnVector OPTPP::OptimizeClass::getXScale | ( | ) | const [inline] |
void OPTPP::OptimizeClass::setConTol | ( | real | x | ) | [inline] |
Set constraint tolerance.
Definition at line 292 of file Opt.h.
References OPTPP::TOLS::setCTol(), and tol.
void OPTPP::OptimizeClass::setDebug | ( | ) | [inline] |
void OPTPP::OptimizeClass::setFcnScale | ( | NEWMAT::Real | x | ) | [inline] |
void OPTPP::OptimizeClass::setFcnScale | ( | NEWMAT::ColumnVector | x | ) | [inline] |
void OPTPP::OptimizeClass::setFcnTol | ( | real | x | ) | [inline] |
Set function tolerance.
Definition at line 290 of file Opt.h.
References OPTPP::TOLS::setFTol(), and tol.
void OPTPP::OptimizeClass::setGradTol | ( | real | x | ) | [inline] |
Set gradient tolerance.
Definition at line 294 of file Opt.h.
References OPTPP::TOLS::setGTol(), and tol.
void OPTPP::OptimizeClass::setLineSearchTol | ( | real | x | ) | [inline] |
Set linesearch tolerance.
Definition at line 296 of file Opt.h.
References OPTPP::TOLS::setLSTol(), and tol.
void OPTPP::OptimizeClass::setMaxBacktrackIter | ( | int | k | ) | [inline] |
Set maximum backtrack iterations.
Definition at line 300 of file Opt.h.
References OPTPP::TOLS::setMaxBacktrackIter(), and tol.
void OPTPP::OptimizeClass::setMaxFeval | ( | int | k | ) | [inline] |
Set maximum fcn evaluations.
Definition at line 302 of file Opt.h.
References OPTPP::TOLS::setMaxFeval(), and tol.
void OPTPP::OptimizeClass::setMaxIter | ( | int | k | ) | [inline] |
Set maximum outer iterations.
Definition at line 298 of file Opt.h.
References OPTPP::TOLS::setMaxIter(), and tol.
void OPTPP::OptimizeClass::setMaxStep | ( | real | x | ) | [inline] |
Set maximum steplength.
Definition at line 284 of file Opt.h.
References OPTPP::TOLS::setMaxStep(), and tol.
void OPTPP::OptimizeClass::setMesg | ( | const char * | s | ) | [inline] |
void OPTPP::OptimizeClass::setMethod | ( | const char * | s | ) | [inline] |
void OPTPP::OptimizeClass::setMinStep | ( | real | x | ) | [inline] |
Set minimum steplength.
Definition at line 286 of file Opt.h.
References OPTPP::TOLS::setMinStep(), and tol.
void OPTPP::OptimizeClass::setReturnCode | ( | int | val | ) | [inline] |
void OPTPP::OptimizeClass::setStepTol | ( | real | x | ) | [inline] |
Set step tolerance.
Definition at line 288 of file Opt.h.
References OPTPP::TOLS::setStepTol(), and tol.
void OPTPP::OptimizeClass::setUpdateModel | ( | UPDATEFCN | u | ) | [inline] |
void OPTPP::OptimizeClass::setXScale | ( | NEWMAT::ColumnVector | x | ) | [inline] |
int OPTPP::OptimizeClass::backtracks [protected] |
Number of bactracks in linesearch.
Definition at line 143 of file Opt.h.
Referenced by defaultReset().
bool OPTPP::OptimizeClass::debug_ [protected] |
Print debug statements.
Definition at line 145 of file Opt.h.
Referenced by Debug(), defaultAcceptStep(), and setDebug().
int OPTPP::OptimizeClass::dim [protected] |
int OPTPP::OptimizeClass::fcn_evals [protected] |
Number of function evaluations taken.
Definition at line 141 of file Opt.h.
Referenced by defaultReset(), OPTPP::OptNewtonLike::getFevals(), OPTPP::OptConstrNewtonLike::getFevals(), and OPTPP::OptBCNewtonLike::getFevals().
real OPTPP::OptimizeClass::fprev [protected] |
int OPTPP::OptimizeClass::iter_taken [protected] |
double OPTPP::OptimizeClass::iter_time [protected] |
NEWMAT::ColumnVector OPTPP::OptimizeClass::mem_step [protected] |
char OPTPP::OptimizeClass::mesg[80] [protected] |
char OPTPP::OptimizeClass::method[80] [protected] |
What method is being used.
Definition at line 133 of file Opt.h.
Referenced by OPTPP::OptBaNewton::OptBaNewton(), OPTPP::OptBaQNewton::OptBaQNewton(), OPTPP::OptBCFDNewton::OptBCFDNewton(), OPTPP::OptBCNewton::OptBCNewton(), OPTPP::OptBCQNewton::OptBCQNewton(), OPTPP::OptCG::OptCG(), OPTPP::OptConstrFDNewton::OptConstrFDNewton(), OPTPP::OptConstrNewton::OptConstrNewton(), OPTPP::OptConstrQNewton::OptConstrQNewton(), OPTPP::OptDHNIPS::OptDHNIPS(), OPTPP::OptFDNewton::OptFDNewton(), OPTPP::OptFDNIPS::OptFDNIPS(), OPTPP::OptLBFGS::OptLBFGS(), OPTPP::OptNewton::OptNewton(), OPTPP::OptNIPS::OptNIPS(), OPTPP::OptNIPSLike::OptNIPSLike(), OPTPP::OptQNewton::OptQNewton(), OPTPP::OptQNIPS::OptQNIPS(), and setMethod().
ostream* OPTPP::OptimizeClass::optout [protected] |
Output file.
Definition at line 157 of file Opt.h.
Referenced by copyright(), defaultAcceptStep(), getOutputFile(), and OptimizeClass().
int OPTPP::OptimizeClass::optout_fd [protected] |
int OPTPP::OptimizeClass::ret_code [protected] |
Return code from Optimization class.
Definition at line 137 of file Opt.h.
Referenced by getReturnCode(), and setReturnCode().
NEWMAT::ColumnVector OPTPP::OptimizeClass::sfx [protected] |
Diagonal Scaling Matrix for f.
Definition at line 121 of file Opt.h.
Referenced by defaultReset(), getFcnScale(), OptimizeClass(), and setFcnScale().
real OPTPP::OptimizeClass::step_length [protected] |
NEWMAT::ColumnVector OPTPP::OptimizeClass::sx [protected] |
Diagonal Scaling Matrix for x.
Definition at line 119 of file Opt.h.
Referenced by defaultReset(), getXScale(), OptimizeClass(), and setXScale().
TOLS OPTPP::OptimizeClass::tol [protected] |
Various tolerances assoc. with the problem.
Definition at line 117 of file Opt.h.
Referenced by OptimizeClass(), setConTol(), setFcnTol(), setGradTol(), setLineSearchTol(), setMaxBacktrackIter(), setMaxFeval(), setMaxIter(), setMaxStep(), setMinStep(), and setStepTol().
double OPTPP::OptimizeClass::total_time [protected] |
UPDATEFCN OPTPP::OptimizeClass::update_fcn [protected] |
User defined function to call after each nonlinear iteration.
Definition at line 153 of file Opt.h.
Referenced by defaultUpdateModel(), OPTPP::OptBCEllipsoid::OptBCEllipsoid(), OPTPP::OptBCNewtonLike::OptBCNewtonLike(), OPTPP::OptConstrNewtonLike::OptConstrNewtonLike(), OptimizeClass(), OPTPP::OptNewtonLike::OptNewtonLike(), and setUpdateModel().
NEWMAT::ColumnVector OPTPP::OptimizeClass::xprev [protected] |
Previous iterate.
Definition at line 123 of file Opt.h.
Referenced by defaultReset(), getXPrev(), and OptimizeClass().