My Project
|
This file runs the OS unitTest. More...
#include <cppad/cppad.hpp>
#include "OSCoinSolver.h"
#include "OSConfig.h"
#include "OSmps2osil.h"
#include "OSResult.h"
#include "OSOption.h"
#include "OSiLReader.h"
#include "OSiLWriter.h"
#include "OSoLReader.h"
#include "OSoLWriter.h"
#include "OSrLReader.h"
#include "OSrLWriter.h"
#include "OSInstance.h"
#include "OSFileUtil.h"
#include "CoinError.hpp"
#include "OSDefaultSolver.h"
#include "OSWSUtil.h"
#include "OSSolverAgent.h"
#include "OShL.h"
#include "OSErrorClass.h"
#include "OSBase64.h"
#include "OSCommonUtil.h"
#include "OSMathUtil.h"
#include <CoinMpsIO.hpp>
#include <CoinPackedMatrix.hpp>
Go to the source code of this file.
Macros | |
#define | DEBUG |
#define | COMPONENT_DEBUG |
Functions | |
int | main (int argC, char *argV[]) |
double | getObjVal (std::string osrl) |
This file runs the OS unitTest.
This is the OS unitTest. It currently runs the following tests.
Solvers:
COIN-Clp tested on parincLinearByRow.osil
COIN-Cbc tested on p0033.osil
COIN-Ipopt tested on:
COIN-SYMPHONY test on p0033.osil COIN-BONMIN test on bonminEx1.osil and wayneQuadratic
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.
In addition there are a number of tests concerning th logic of many of the components of the OS project. These tests have little in common with the installation and functionality tests, but they are useful for debugging and to give a thorough workout to the program logic. These tests can be added selectively using several conditional variables:
The first logic test concerns 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.
Next test CppAD. Read in CppADTestLag.osil and make sure gradient and Hessian calculations are working correctly.
We next test the parsers. We test parsing the osil file parincLinear.osil, finplan1.osil, the osrl file parincLinear.osrl and the osol file osolTest.osol. We test the get() and set() methods for osinstance.
Definition in file unitTest.cpp.
#define DEBUG |
Definition at line 104 of file unitTest.cpp.
#define COMPONENT_DEBUG |
Definition at line 107 of file unitTest.cpp.
int main | ( | int | argC, |
char * | argV[] ) |
in this part of the unitTest we 1) read an OSoL string from a file 2) create an OSOption object from the string 3) add options to various array-valued elements 4) retrieve pieces of the OSOption object with get() methods 5) insert these pieces into a second OSOption object with set() methods 6) compare the two OSOption objects to make sure they are equal 7) write a new OSoL string from the in-memory OSOption object 8) read the string back again into a third OSOption object 9) compare to the original OSOption object 10) read two more OSoL strings from different files
!!
in this part of the unitTest we 1) read an OSrL string from a file 2) create an OSResult object from the string 3) write a new OSrL string from the in-memory OSResult object 4) read the string back again to make sure nothing was lost in translation
Definition at line 212 of file unitTest.cpp.
double getObjVal | ( | std::string | osrl | ) |
Definition at line 3199 of file unitTest.cpp.