44 #include "NLPInterfacePack_NLPWBCounterExample.hpp"
45 #include "MoochoPack_MoochoSolver.hpp"
46 #include "Teuchos_GlobalMPISession.hpp"
47 #include "Teuchos_CommandLineProcessor.hpp"
48 #include "Teuchos_StandardCatchMacros.hpp"
50 int main(
int argc,
char* argv[] )
67 double xinit[3] = { 0.0, 0.0, 0.0 };
70 bool nlp_selects_basis =
true;
71 bool linear_obj =
true;
73 CommandLineProcessor clp(
false);
74 solver.setup_commandline_processor(&clp);
75 clp.setOption(
"x1-init", &xinit[0],
"Initail guess for x(1)" );
76 clp.setOption(
"x2-init", &xinit[1],
"Initail guess for x(2)" );
77 clp.setOption(
"x3-init", &xinit[2],
"Initail guess for x(3)" );
78 clp.setOption(
"a", &a,
"Constant for c(1)" );
79 clp.setOption(
"b", &b,
"Constant for c(2)" );
81 "nlp-selects-basis",
"no-nlp-selects-basis", &nlp_selects_basis
82 ,
"Determine if NLP will select basis" );
84 "linear-obj",
"nonlinear-obj", &linear_obj
85 ,
"Determine if objective is linear" );
86 CommandLineProcessor::EParseCommandLineReturn
87 parse_return = clp.parse(argc,argv,&std::cerr);
88 if( parse_return != CommandLineProcessor::PARSE_SUCCESSFUL )
97 nlp(xinit,a,b,nlp_selects_basis,linear_obj);
101 const MoochoSolver::ESolutionStatus
102 solution_status = solver.solve_nlp();
108 return solution_status;
113 return MoochoSolver::SOLVE_RETURN_EXCEPTION;
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
#define TEUCHOS_STANDARD_CATCH_STATEMENTS(VERBOSE, ERR_STREAM, SUCCESS_FLAG)
NLP subclass for the Waechter and Biegler Counter Example.