42 #ifndef MOOCHOPACK_MOOCHO_SOLVER_HPP
43 #define MOOCHOPACK_MOOCHO_SOLVER_HPP
45 #include "MoochoPack_Types.hpp"
46 #include "MoochoPack_NLPAlgoContainer.hpp"
47 #include "OptionsFromStreamPack_CommandLineOptionsFromStreamProcessor.hpp"
49 namespace MoochoPack {
179 OUTPUT_TO_BLACK_HOLE_DEFAULT
180 ,OUTPUT_TO_BLACK_HOLE_TRUE
181 ,OUTPUT_TO_BLACK_HOLE_FALSE
190 SOLVE_RETURN_SOLVED = 0
191 ,SOLVE_RETURN_NLP_TEST_FAILED = 1
192 ,SOLVE_RETURN_MAX_ITER = 2
193 ,SOLVE_RETURN_MAX_RUN_TIME = 3
194 ,SOLVE_RETURN_EXCEPTION = 4
210 const std::string &options_file_name =
"Moocho.opt"
211 ,
const std::string &extra_options_str =
""
389 const std::string &file_context_postfix
391 ,
const int procRank = -1
392 ,
const int numProcs = -1
723 #ifndef DOXYGEN_COMPILE
728 mutable bool reconfig_solver_;
729 mutable value_type workspace_MB_;
730 mutable value_type obj_scale_;
731 mutable bool test_nlp_;
732 mutable bool print_algo_;
733 mutable bool algo_timing_;
734 mutable bool generate_stats_file_;
735 mutable bool print_opt_grp_not_accessed_;
736 mutable bool throw_exceptions_;
737 mutable std::string output_file_tag_;
738 mutable bool do_console_outputting_;
739 mutable bool do_summary_outputting_;
740 mutable bool do_journal_outputting_;
741 mutable bool do_algo_outputting_;
742 mutable int configuration_;
743 #ifndef DOXYGEN_COMPILE
761 std::string file_context_postfix_;
762 std::string file_proc_postfix_;
769 void generate_output_streams()
const;
837 output_file_tag_ = output_file_tag;
849 return do_console_outputting_;
861 return do_summary_outputting_;
873 return do_journal_outputting_;
885 return do_algo_outputting_;
897 return generate_stats_file_;
902 #endif // MOOCHOPACK_MOOCHO_SOLVER_HPP
const ostream_ptr_t & get_console_out() const
Get the non-const smart pointer to the set output stream for console outputting.
void set_options(const options_ptr_t &options)
Set the various options to use.
void setup_commandline_processor(Teuchos::CommandLineProcessor *clp)
Setup the commandline processor to process commandline options.
void set_output_context(const std::string &file_context_postfix, EOutputToBlackHole output_to_black_hole=OUTPUT_TO_BLACK_HOLE_DEFAULT, const int procRank=-1, const int numProcs=-1)
Setup the context for outputting.
void update_solver() const
Setup the state of the solver and get ready for a solve.
RCP< IterationPack::AlgorithmTracker > track_ptr_t
bool generate_stats_file() const
Return if a statistics file will be generated or not.
const ostream_ptr_t & get_summary_out() const
Get the non-const smart pointer to the set output stream for summary outputting.
void set_journal_out(const ostream_ptr_t &journal_out)
Set the std::ostream object to use for journal output by the MOOCHO step objects. ...
const config_ptr_t & get_config() const
Return the configuration object being used.
Implementation for NLPAlgo solver.
const ostream_ptr_t & get_journal_out() const
Get the non-const smart pointer to the set output stream for journal outputting.
bool do_console_outputting() const
Return if console outputting is performed or not.
RCP< NLPInterfacePack::NLP > nlp_ptr_t
bool do_summary_outputting() const
Return if summary outputting is performed or not.
const track_ptr_t & get_track() const
Get the non-const smart pointer to the set AlgorithmTracker object.
const options_ptr_t & get_options() const
Get the OptionsFromStream object being used to extract the options from.
bool do_journal_outputting() const
Return if journal outputting is performed or not.
MoochoSolver(const std::string &options_file_name="Moocho.opt", const std::string &extra_options_str="")
Constructs to uninitialized.
const ostream_ptr_t & error_out() const
Return the std::ostream object used for error reporting on exceptions.
Universal interface to a MOOCHO solver.
RCP< std::ostream > generate_output_file(const std::string &fileNameBase) const
Generate an output file given a base file name.
RCP< std::ostream > ostream_ptr_t
void set_config(const config_ptr_t &config)
Set the algorithm configuration object.
const ostream_ptr_t & get_algo_out() const
Get the non-const smart pointer to the set output stream for algo outputting.
void set_console_out(const ostream_ptr_t &console_out)
Set the std::ostream object to use for console output by a MoochoTrackerConsoleStd object...
RCP< NLPAlgoConfig > config_ptr_t
This is the most basic interface that clients use to solve an NLP.
bool do_algo_outputting() const
Return if algo outputting is performed or not.
void set_summary_out(const ostream_ptr_t &summary_out)
Set the std::ostream object to use for summary output.
NLPSolverClientInterface & get_solver()
Get the underlying NLPSolverClientInterface object.
ESolutionStatus solve_nlp() const
Solve the NLP.
const nlp_ptr_t & get_nlp() const
Get the non-const smart pointer to the set NLP object.
void set_nlp(const nlp_ptr_t &nlp)
Set the NLP to be solved.
void set_output_file_tag(const std::string &)
Set a tag for output file names for all file names that are created internally.
void set_track(const track_ptr_t &track)
RCP< OptionsFromStreamPack::OptionsFromStream > options_ptr_t
OptionsFromStreamPack::CommandLineOptionsFromStreamProcessor & commandLineOptionsFromStreamProcessor()
void set_algo_out(const ostream_ptr_t &algo_out)
Set the std::ostream object to use for algorithm output.
void set_error_handling(bool throw_exceptions, const ostream_ptr_t &error_out)
Set the error output and whether exceptions will be thrown from these functions or not...
bool throw_exceptions() const
Return if exceptions will be thrown out of this->solve_nlp().