/Users/kmartin/Documents/files/code/cpp/OScpp/COIN-OS/OS/test/unitTest.cpp File Reference

#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)


Detailed Description

This file runs the OS unitTest.

Author:
Robert Fourer, Jun Ma, Kipp Martin,
Version:
1.0, 10/05/2005
Since:
OS1.0
Remarks:
Copyright (C) 2005, Robert Fourer, Jun Ma, Kipp Martin, Northwestern University, and the University of Chicago. All Rights Reserved. This software is licensed under the Common Public License. Please see the accompanying LICENSE file in root directory for terms.
This is the OS unitTest. It currently runs the following tests.

Solvers:

COIN-Ipopt tested on:

  1. avion2.osil
  2. HS071_NLP.osil
  3. rosenbrockmod.osil
  4. parincQuadratic.osil
  5. parincLinear.osil
  6. callBackTest.osil
  7. callBackTestRowMajor.osil

COIN-Clp tested on parincLinearByRow.osil

COIN-Cbc tested on p0033.osil

Knitro tested on:

  1. rosenbrockmod.osil
  2. callBackTest.osil
  3. parincQuadratic.osil
  4. HS071_NLP

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:

  1. lindoapiaddins.osil
  2. rosenbrockmode.osil
  3. parincquadratic.osil
  4. wayneQuadratic.osil -- the only nonlinear integer problem in unitTest

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.


Function Documentation

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().


Generated on Sat Mar 29 22:38:04 2008 by  doxygen 1.5.3