#include <iostream>
#include "NLPInterfacePack_NLPWBCounterExample.hpp"
#include "MoochoPack_MoochoSolver.hpp"
#include "Teuchos_GlobalMPISession.hpp"
#include "Teuchos_CommandLineProcessor.hpp"
#include "Teuchos_StandardCatchMacros.hpp"
int main( int argc, char* argv[] )
{
bool success = true;
try {
MoochoSolver solver;
double xinit[3] = { 0.0, 0.0, 0.0 };
double a = 0.0;
double b = 1.0;
bool nlp_selects_basis = true;
bool linear_obj = true;
CommandLineProcessor clp(false);
solver.setup_commandline_processor(&clp);
clp.setOption( "x1-init", &xinit[0], "Initail guess for x(1)" );
clp.setOption( "x2-init", &xinit[1], "Initail guess for x(2)" );
clp.setOption( "x3-init", &xinit[2], "Initail guess for x(3)" );
clp.setOption( "a", &a, "Constant for c(1)" );
clp.setOption( "b", &b, "Constant for c(2)" );
clp.setOption(
"nlp-selects-basis", "no-nlp-selects-basis", &nlp_selects_basis
,"Determine if NLP will select basis" );
clp.setOption(
"linear-obj", "nonlinear-obj", &linear_obj
,"Determine if objective is linear" );
CommandLineProcessor::EParseCommandLineReturn
parse_return = clp.parse(argc,argv,&std::cerr);
if( parse_return != CommandLineProcessor::PARSE_SUCCESSFUL )
return parse_return;
NLPWBCounterExample
nlp(xinit,a,b,nlp_selects_basis,linear_obj);
const MoochoSolver::ESolutionStatus
solution_status = solver.solve_nlp();
return solution_status;
}
return MoochoSolver::SOLVE_RETURN_EXCEPTION;
}