#include <cppad/cppad.hpp>
#include "OSCoinSolver.h"
#include "OSConfig.h"
#include "OSmps2osil.h"
#include "OSResult.h"
#include "OSiLReader.h"
#include "OSiLWriter.h"
#include "OSrLReader.h"
#include "OSrLWriter.h"
#include "OSInstance.h"
#include "OSFileUtil.h"
#include "OSDefaultSolver.h"
#include "OSWSUtil.h"
#include "OSSolverAgent.h"
#include "OShL.h"
#include "OSErrorClass.h"
#include "OSBase64.h"
#include "OSCommonUtil.h"
#include <CoinMpsIO.hpp>
#include <CoinPackedMatrix.hpp>
#include "OSMathUtil.h"
Go to the source code of this file.
Functions | |
int | main (int argC, char *argV[]) |
double | getObjVal (std::string osrl) |
Solvers:
COIN-Ipopt tested on:
COIN-Clp tested on parincLinearByRow.osil
COIN-Cbc tested on p0033.osil
Knitro tested on:
COIN-SYMPHONY test on p0033.osil
COIN-DyLP tested onparincLinear.osil
COIN-Volume tested on volumeTest.osil
GLPK tested on p0033.osil
Cplex tested on p0033.osil
Lindo tested on:
We test the mps to osil converter progam OSmps2osil on parincLinear.mps. Solve with Cbc.
We test the AMPL nl file format to osil converter program OSnl2osil on hs71.nl. Solve with Lindo.
We test the base 64 format on problem parincLinear. We first read in the parinc.mps file into an osil string and then set m_bWriteBase64 = true. We then write a new instance in base 64 format and solve it.
We next test the parsers. We test parsing the osil file parincLinear.osil and the osrl file parincLinear.osrl.
Next we test the prefix and postfix routines. For the test problem rosenbrockmod.osil create an OSExpressionTree from the objective function. Then invoke the getPostfix() method and get a postfix vector representation of the expression tree. Then use createExpressionTreeFromPostfix to create an expression tree back. Then use getPrefix() to get a prefix vector from this expression tree. Then use createExpressionTreeFromPrefix to create and expression. Then use getPostfix() to get the postfix vector back and compare with the very first postfix vector and make sure they are the same.
Next test all of the nonlinear operators. The file testOperators.osil uses every nonlinear operator currently defined. Parse this file to make sure the parser works on every operator and then use expTree->m_treeRoot->calculateFunction to make sure the operators are evaluated correctly.
Finally test CppAD. Read in CppADTestLag.osil and make sure gradient and Hessian calculations are working correctly.
Definition in file unitTest.cpp.
int main | ( | int | argC, | |
char * | argV[] | |||
) |
Definition at line 201 of file unitTest.cpp.
References DefaultSolver::buildSolverInstance(), IpoptSolver::buildSolverInstance(), OSInstance::calculateConstraintFunctionGradient(), OSnLNode::calculateFunction(), OSInstance::calculateHessian(), OSnLNode::createExpressionTreeFromPostfix(), OSnLNode::createExpressionTreeFromPrefix(), OSnl2osil::createOSInstance(), OSmps2osil::createOSInstance(), DoubleVector::el, ErrorClass::errormsg, FileUtil::getFileAsString(), OSInstance::getJacobianSparsityPattern(), OSInstance::getLagrangianHessianSparsityPattern(), OSInstance::getNonlinearExpressionTree(), OSInstance::getNonlinearExpressionTreeInPostfix(), OSInstance::getNonlinearExpressionTreeInPrefix(), getObjVal(), OSnLNode::getPostfixFromExpressionTree(), SparseHessianMatrix::hessDimension, SparseHessianMatrix::hessValues, OSInstance::instanceData, InstanceData::linearConstraintCoefficients, OSiLWriter::m_bWhiteSpace, OSiLWriter::m_bWriteBase64, OSExpressionTree::m_treeRoot, SparseVector::number, LinearConstraintCoefficients::numberOfValues, OS_NEAR_EQUAL, DefaultSolver::osil, OSnl2osil::osinstance, osinstance, DefaultSolver::osinstance, OSmps2osil::osinstance, DefaultSolver::osol, osresult, DefaultSolver::osrl, OSiLReader::readOSiL(), OSrLReader::readOSrL(), DefaultSolver::solve(), IpoptSolver::solve(), DefaultSolver::sSolverName, LinearConstraintCoefficients::value, SparseVector::values, OSiLWriter::writeOSiL(), and OSrLWriter::writeOSrL().
double getObjVal | ( | std::string | osrl | ) |
Definition at line 1458 of file unitTest.cpp.
References os_strtod(), and OSNAN.
Referenced by main().