60 namespace MoochoPack {
64 ,
const std::string xml_filename
65 ,
const std::string problem_name
66 ,
const std::string algorithm_description
68 :AlgorithmTracker(journal_out)
71 ,xml_filename_(xml_filename)
72 ,problem_name_(problem_name)
73 ,algorithm_description_(algorithm_description)
84 const NLPObjGrad &nlp =
dyn_cast<
const NLPObjGrad>(_algo.nlp());
91 std::ofstream &
out = *xml_out.
get();
98 out << ind <<
"<Solution status=\"UNKNOWN_FAILURE\" objective_value=\"?\" constraint_norm=\"?\"/>\n";
100 out << ind <<
"<Iterations overall=\"?\"/>\n";
115 const NLPObjGrad &nlp =
dyn_cast<
const NLPObjGrad>(_algo.nlp());
116 const NLPFirstOrder *nlp_foi =
dynamic_cast<const NLPFirstOrder*
>(&nlp);
122 std::ofstream &
out = *xml_out.
get();
129 char soln_status[256];
133 std::strcpy(soln_status,
"SOLVED");
136 std::strcpy(soln_status,
"FAILED");
139 std::strcpy(soln_status,
"MAX_ITER");
142 std::strcpy(soln_status,
"MAX_RUN_TIME");
145 std::strcpy(soln_status,
"INTERRUPTED_SOLVED");
148 std::strcpy(soln_status,
"INTERRUPTED_FAILED");
151 std::strcpy(soln_status,
"UNKNOWN_STATUS");
156 out << ind <<
"<Solution status=\"" << soln_status;
158 if (s.f().updated_k(0)) {
159 out <<
"\" objective_value=\"" << s.f().get_k(0) <<
"\"";
162 out <<
"\" objective_value=\"?\"";
165 if (m && s.c().updated_k(0)) {
166 out <<
" constraint_norm=\"" << s.c().get_k(0).norm_inf() <<
"\"";
169 out <<
" constraint_norm=\"?\"";
175 out << ind <<
"<Iterations overall=\"" << s.
k() <<
"\"/>\n";
178 out << ind <<
"<Evaluations>\n"
179 << ind << ind <<
"<Objective evaluations=\"" << nlp.num_f_evals() <<
"\"/>\n"
180 << ind << ind <<
"<Constraint evaluations=\"" << ( m ? nlp.num_c_evals() : 0 ) <<
"\"/>\n"
181 << ind << ind <<
"<Objective_Gradient evaluations=\"" << nlp.num_Gf_evals() <<
"\"/>\n"
182 << ind << ind <<
"<Constraint_Gradient evaluations=\"";
186 out << nlp_foi->num_Gc_evals();
197 << ind <<
"</Evaluations>\n";
256 std::ofstream &
out = *xml_out.
get();
261 time_t current_time = time(NULL);
263 std::strcpy(time_str, ctime(¤t_time));
265 out <<
"<Problem name=\"" <<
problem_name_ <<
"\" time=\"" << time_str <<
"\">\n";
267 out << ind <<
"<Dimension n=\"?\" m=\"?\"/>\n";
270 true, std::logic_error
271 ,
"Error!, this function stopped compiling so RAB commented "
272 "it out on 2/4/2005. Sorry!"
309 const NLP &nlp = _algo.nlp();
315 true, std::logic_error
316 ,
"Error!, this function stopped compiling so RAB commented "
317 "it out on 2/4/2005. Sorry!"
360 out <<
"</Problem>\n";
AbstractLinAlgPack::size_type size_type
void open_problem_element(std::ostream &out, const Algorithm &algo) const
Print the header to the output.
MoochoTrackerXMLSummary()
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
rSQP Algorithm control class.
void output_final(const Algorithm &algo, EAlgoReturn algo_return) const
void output_iteration(const Algorithm &algo) const
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
T_To & dyn_cast(T_From &from)
Reduced space SQP state encapsulation interface.
std::string xml_filename_
std::string problem_name_
Acts as the central hub for an iterative algorithm.
NLPAlgoState & rsqp_state()
<<std aggr>="">> members for algo_cntr
void close_problem_element(std::ostream &out) const
void output_pre_file() const
Set the output stream for summary outputting.
NLPAlgo & rsqp_algo(Algorithm &algo)
Convert from a Algorithm to a NLPAlgo.