MOOCHO (Single Doxygen Collection) Version of the Day
Classes | Private Attributes
MoochoPack::NLPSolverClientInterface Class Reference

This is the most basic interface that clients use to solve an NLP. More...

#include <MoochoPack_NLPSolverClientInterface.hpp>

Inheritance diagram for MoochoPack::NLPSolverClientInterface:
Inheritance graph
[legend]

List of all members.

Classes

class  InvalidSetup
 Thrown if the setup is not valid. More...

Private Attributes

NLPInterfacePack::NLPnlp
 
IterationPack::AlgorithmTrackertrack
 

Public Types

enum  EFindMinReturn { SOLUTION_FOUND, MAX_ITER_EXCEEDED, MAX_RUN_TIME_EXCEEDED, ALGORITHMIC_ERROR }
  More...

Solver Parameters

 STANDARD_MEMBER_COMPOSITION_MEMBERS (int, max_iter)
 Set the maximum number of iterations the rSQP algorithm can perform.
 STANDARD_MEMBER_COMPOSITION_MEMBERS (double, max_run_time)
 Set the maximum run_time.
 STANDARD_MEMBER_COMPOSITION_MEMBERS (value_type, opt_tol)
 Set the termination tolerance for the relative (scaled) linear dependence of the gradients part of the first order necessary optimality conditions.
 STANDARD_MEMBER_COMPOSITION_MEMBERS (value_type, feas_tol)
 Set the termination tolerance for the (scaled) equality constraints ||c(x*)||inf which is part of the first order necessary optimality conditions.
 STANDARD_MEMBER_COMPOSITION_MEMBERS (value_type, comp_tol)
 Set the termination tolerance for the complementarity condition for the (scaled) bound constraints which is part of the first order necessary optimality conditions.
 STANDARD_MEMBER_COMPOSITION_MEMBERS (value_type, step_tol)
 Set the termination tolerance for the change in the estimate of the solution.
 STANDARD_MEMBER_COMPOSITION_MEMBERS (EJournalOutputLevel, journal_output_level)
 Determine the amount of output to a journal file.
 STANDARD_MEMBER_COMPOSITION_MEMBERS (EJournalOutputLevel, null_space_journal_output_level)
 Determine the amount of output of the null space to a journal file.
 STANDARD_MEMBER_COMPOSITION_MEMBERS (int, journal_print_digits)
 Set the precesion of the journal output.
 STANDARD_MEMBER_COMPOSITION_MEMBERS (bool, check_results)
 Set whether computations will be double checked or not.
 STANDARD_MEMBER_COMPOSITION_MEMBERS (bool, calc_conditioning)
 Set whether the condition numbers of important matrics is computed and printed or not.
 STANDARD_MEMBER_COMPOSITION_MEMBERS (bool, calc_matrix_norms)
 Set whether or not matrix norms are computed and printed.
 STANDARD_MEMBER_COMPOSITION_MEMBERS (bool, calc_matrix_info_null_space_only)
 Set whether calc_conditioning and calc_matrix_norms apply to only null space matrices.

Constructors/initalizers

 STANDARD_COMPOSITION_MEMBERS (NLP, nlp)
 <<std comp>="">> members for the nlp
 STANDARD_COMPOSITION_MEMBERS (AlgorithmTracker, track)
 <<std comp>="">> members for the track
 NLPSolverClientInterface (int max_iter=10000, double max_run_time=1e+10, value_type opt_tol=1e-6, value_type feas_tol=1e-6, value_type comp_tol=1e-6, value_type step_tol=1e-2, EJournalOutputLevel journal_output_level=PRINT_ALGORITHM_STEPS, EJournalOutputLevel null_space_journal_output_level=PRINT_ALGORITHM_STEPS, int journal_print_digits=6, bool check_results=false, bool calc_conditioning=false, bool calc_matrix_norms=false, bool calc_matrix_info_null_space_only=false)
 Construct with no references set to nlp or track objects.
virtual ~NLPSolverClientInterface ()
 

Solve the NLP

virtual EFindMinReturn find_min ()=0
 Find the minimun of the set NLP.

Algorithm description

virtual void print_algorithm (std::ostream &out) const =0
 Prints a description of the algorithm.

Algorithm timing

virtual void set_algo_timing (bool algo_timing)=0
 Causes algorithm to be timed.
virtual bool algo_timing () const =0
 
virtual void print_algorithm_times (std::ostream &out) const =0
 Outputs table of times for each step and the cummulative times.

Detailed Description

This is the most basic interface that clients use to solve an NLP.

ToDo: Finish documentaiton.

Definition at line 59 of file MoochoPack_NLPSolverClientInterface.hpp.


Member Enumeration Documentation

Enumerator:
SOLUTION_FOUND 
MAX_ITER_EXCEEDED 
MAX_RUN_TIME_EXCEEDED 
ALGORITHMIC_ERROR 

Definition at line 66 of file MoochoPack_NLPSolverClientInterface.hpp.


Constructor & Destructor Documentation

MoochoPack::NLPSolverClientInterface::NLPSolverClientInterface ( int  max_iter = 10000,
double  max_run_time = 1e+10,
value_type  opt_tol = 1e-6,
value_type  feas_tol = 1e-6,
value_type  comp_tol = 1e-6,
value_type  step_tol = 1e-2,
EJournalOutputLevel  journal_output_level = PRINT_ALGORITHM_STEPS,
EJournalOutputLevel  null_space_journal_output_level = PRINT_ALGORITHM_STEPS,
int  journal_print_digits = 6,
bool  check_results = false,
bool  calc_conditioning = false,
bool  calc_matrix_norms = false,
bool  calc_matrix_info_null_space_only = false 
)

Construct with no references set to nlp or track objects.

Definition at line 45 of file MoochoPack_NLPSolverClientInterface.cpp.

virtual MoochoPack::NLPSolverClientInterface::~NLPSolverClientInterface ( ) [inline, virtual]

Definition at line 174 of file MoochoPack_NLPSolverClientInterface.hpp.


Member Function Documentation

MoochoPack::NLPSolverClientInterface::STANDARD_MEMBER_COMPOSITION_MEMBERS ( int  ,
max_iter   
)

Set the maximum number of iterations the rSQP algorithm can perform.

MoochoPack::NLPSolverClientInterface::STANDARD_MEMBER_COMPOSITION_MEMBERS ( double  ,
max_run_time   
)

Set the maximum run_time.

MoochoPack::NLPSolverClientInterface::STANDARD_MEMBER_COMPOSITION_MEMBERS ( value_type  ,
opt_tol   
)

Set the termination tolerance for the relative (scaled) linear dependence of the gradients part of the first order necessary optimality conditions.

MoochoPack::NLPSolverClientInterface::STANDARD_MEMBER_COMPOSITION_MEMBERS ( value_type  ,
feas_tol   
)

Set the termination tolerance for the (scaled) equality constraints ||c(x*)||inf which is part of the first order necessary optimality conditions.

MoochoPack::NLPSolverClientInterface::STANDARD_MEMBER_COMPOSITION_MEMBERS ( value_type  ,
comp_tol   
)

Set the termination tolerance for the complementarity condition for the (scaled) bound constraints which is part of the first order necessary optimality conditions.

MoochoPack::NLPSolverClientInterface::STANDARD_MEMBER_COMPOSITION_MEMBERS ( value_type  ,
step_tol   
)

Set the termination tolerance for the change in the estimate of the solution.

The test is: |d(i)|/(1+|x(i)|) < step_tol.

MoochoPack::NLPSolverClientInterface::STANDARD_MEMBER_COMPOSITION_MEMBERS ( EJournalOutputLevel  ,
journal_output_level   
)

Determine the amount of output to a journal file.

MoochoPack::NLPSolverClientInterface::STANDARD_MEMBER_COMPOSITION_MEMBERS ( EJournalOutputLevel  ,
null_space_journal_output_level   
)

Determine the amount of output of the null space to a journal file.

This option allows the user to perform a higher level of output for quantities in the null space.

MoochoPack::NLPSolverClientInterface::STANDARD_MEMBER_COMPOSITION_MEMBERS ( int  ,
journal_print_digits   
)

Set the precesion of the journal output.

MoochoPack::NLPSolverClientInterface::STANDARD_MEMBER_COMPOSITION_MEMBERS ( bool  ,
check_results   
)

Set whether computations will be double checked or not.

MoochoPack::NLPSolverClientInterface::STANDARD_MEMBER_COMPOSITION_MEMBERS ( bool  ,
calc_conditioning   
)

Set whether the condition numbers of important matrics is computed and printed or not.

MoochoPack::NLPSolverClientInterface::STANDARD_MEMBER_COMPOSITION_MEMBERS ( bool  ,
calc_matrix_norms   
)

Set whether or not matrix norms are computed and printed.

MoochoPack::NLPSolverClientInterface::STANDARD_MEMBER_COMPOSITION_MEMBERS ( bool  ,
calc_matrix_info_null_space_only   
)

Set whether calc_conditioning and calc_matrix_norms apply to only null space matrices.

MoochoPack::NLPSolverClientInterface::STANDARD_COMPOSITION_MEMBERS ( NLP  ,
nlp   
)

<<std comp>="">> members for the nlp

MoochoPack::NLPSolverClientInterface::STANDARD_COMPOSITION_MEMBERS ( AlgorithmTracker  ,
track   
)

<<std comp>="">> members for the track

virtual EFindMinReturn MoochoPack::NLPSolverClientInterface::find_min ( ) [pure virtual]

Find the minimun of the set NLP.

This function returns SOLUTION_FOUND if the NLP has been solved to the desired tolerances. In this case this->track().output_final(...,TERMINATE_TRUE) and this->nlp().report_final_solution(...,true) are called before this function returns..

If the solution is not found, then this->nlp().report_final_solution(...,false) is called and one of the following occurs:

  • If the maximum number of iterations has been exceeded then MAX_ITER_EXCEEDED will be returned. In this case this->track().output_final(...,MAX_ITER_EXCEEDED) is called.
  • If the maximum runtime has been exceeded then MAX_RUN_TIME_EXCEEDED will be returned. In this case this->track().output_final(...,MAX_RUN_TIME_EXCEEDED) is called.
  • An exception is thrown. The client should be prepaired to catch any exceptions thrown from this function. All of the purposefully thrown exceptions are derived from std::exception so the client can check the what() function to see and description of the error. If an exception is thrown then this->track().output_final(...,TERMINATE_FALSE) will be called before this exception is rethrown out of this functiion. If the constraints are found to be infeasible, then the exception InfeasibleConstraints will be thrown. If a line search failure occurs then the exception LineSearchFailure will be thrown. If some test failed then the exception TestFailed will be thrown. Many other exceptions may be thrown but these are the main ones that the SQP algorithms known about and will purposefully generate.

Preconditions:

Postcondtions:

  • Minimum of NLP is found to opt_tol, max_iter was reached or max_run_time reached (throw std::exection)

Implemented in MoochoPack::NLPAlgoContainer.

virtual void MoochoPack::NLPSolverClientInterface::print_algorithm ( std::ostream &  out) const [pure virtual]

Prints a description of the algorithm.

Implemented in MoochoPack::NLPAlgoClientInterface, and MoochoPack::NLPAlgoContainer.

virtual void MoochoPack::NLPSolverClientInterface::set_algo_timing ( bool  algo_timing) [pure virtual]

Causes algorithm to be timed.

Call with algo_timing == true before calling find_min() to have the algorithm timed.

Implemented in MoochoPack::NLPAlgoContainer.

virtual bool MoochoPack::NLPSolverClientInterface::algo_timing ( ) const [pure virtual]
virtual void MoochoPack::NLPSolverClientInterface::print_algorithm_times ( std::ostream &  out) const [pure virtual]

Outputs table of times for each step and the cummulative times.

Call after find_min() has executed to get a table of times.

Implemented in MoochoPack::NLPAlgoContainer.


Member Data Documentation

Definition at line 256 of file MoochoPack_NLPSolverClientInterface.hpp.

Definition at line 258 of file MoochoPack_NLPSolverClientInterface.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines