#include "BonAmplInterface.hpp"
#include "OsiClpSolverInterface.hpp"
#include "BonTMINLP.hpp"
#include "IpIpoptApplication.hpp"
#include "BonIpoptSolver.hpp"
#include "BonminConfig.h"
#include "CoinError.hpp"
#include <string>
#include <cmath>
Include dependency graph for InterfaceTest.cpp:
Go to the source code of this file.
Defines | |
#define | MAKE_STRING(exp) std::string(#exp) |
#define | MyAssert(exp) MyAssertFunc(exp, MAKE_STRING(exp), __FILE__, __LINE__); |
#define | DblEqAssert(a, b) DblEqAssertFunc(a,MAKE_STRING(a),b,MAKE_STRING(b), __FILE__, __LINE__); |
Functions | |
void | MyAssertFunc (bool c, const std::string &s, const std::string &file, unsigned int line) |
void | DblEqAssertFunc (const double &a, const std::string &a_s, const double &b, const std::string &b_s, const std::string &file, unsigned int line) |
void | testGetMethods (OsiTMINLPInterface &si) |
Test function for the Osi interface to Ipopt (or any nlp solver). | |
void | testOptimAndSolutionQuery (OsiTMINLPInterface &si) |
void | testSetMethods (OsiTMINLPInterface &si) |
Test set methods. | |
void | testOa (Bonmin::OsiTMINLPInterface &si) |
void | testFp (Bonmin::AmplInterface &si) |
void | interfaceTest (Ipopt::SmartPtr< TNLPSolver > solver) |
int | main () |
#define MAKE_STRING | ( | exp | ) | std::string(#exp) |
Definition at line 49 of file InterfaceTest.cpp.
#define MyAssert | ( | exp | ) | MyAssertFunc(exp, MAKE_STRING(exp), __FILE__, __LINE__); |
Definition at line 50 of file InterfaceTest.cpp.
Referenced by testGetMethods(), testOa(), testOptimAndSolutionQuery(), and testSetMethods().
#define DblEqAssert | ( | a, | |||
b | ) | DblEqAssertFunc(a,MAKE_STRING(a),b,MAKE_STRING(b), __FILE__, __LINE__); |
Definition at line 51 of file InterfaceTest.cpp.
Referenced by testFp(), testGetMethods(), testOa(), and testSetMethods().
void MyAssertFunc | ( | bool | c, | |
const std::string & | s, | |||
const std::string & | file, | |||
unsigned int | line | |||
) |
Definition at line 32 of file InterfaceTest.cpp.
void DblEqAssertFunc | ( | const double & | a, | |
const std::string & | a_s, | |||
const double & | b, | |||
const std::string & | b_s, | |||
const std::string & | file, | |||
unsigned int | line | |||
) |
Definition at line 39 of file InterfaceTest.cpp.
void testGetMethods | ( | OsiTMINLPInterface & | si | ) |
Test function for the Osi interface to Ipopt (or any nlp solver).
If Solver passes all the test then it should have everything needed to be integrated into bonmin.
Definition at line 58 of file InterfaceTest.cpp.
References DblEqAssert, Bonmin::OsiTMINLPInterface::getColLower(), Bonmin::OsiTMINLPInterface::getColUpper(), Bonmin::OsiTMINLPInterface::getInfinity(), Bonmin::OsiTMINLPInterface::getNumCols(), Bonmin::OsiTMINLPInterface::getNumRows(), Bonmin::OsiTMINLPInterface::getObjSense(), Bonmin::OsiTMINLPInterface::getRowLower(), Bonmin::OsiTMINLPInterface::getRowUpper(), Bonmin::OsiTMINLPInterface::isBinary(), Bonmin::OsiTMINLPInterface::isContinuous(), Bonmin::OsiTMINLPInterface::isFreeBinary(), Bonmin::OsiTMINLPInterface::isInteger(), Bonmin::OsiTMINLPInterface::isIntegerNonBinary(), MyAssert, and Bonmin::OsiTMINLPInterface::setColLower().
Referenced by interfaceTest().
void testOptimAndSolutionQuery | ( | OsiTMINLPInterface & | si | ) |
Definition at line 121 of file InterfaceTest.cpp.
References e, Bonmin::OsiTMINLPInterface::getColSolution(), Bonmin::OsiTMINLPInterface::getIterationCount(), Bonmin::OsiTMINLPInterface::getObjValue(), Bonmin::OsiTMINLPInterface::getRowActivity(), Bonmin::OsiTMINLPInterface::getRowPrice(), Bonmin::OsiTMINLPInterface::initialSolve(), Bonmin::OsiTMINLPInterface::isProvenOptimal(), and MyAssert.
Referenced by interfaceTest().
void testSetMethods | ( | OsiTMINLPInterface & | si | ) |
Test set methods.
Definition at line 164 of file InterfaceTest.cpp.
References DblEqAssert, e, Bonmin::OsiTMINLPInterface::getColLower(), Bonmin::OsiTMINLPInterface::getColSolution(), Bonmin::OsiTMINLPInterface::getColUpper(), Bonmin::OsiTMINLPInterface::getWarmStart(), Bonmin::OsiTMINLPInterface::initialSolve(), Bonmin::OsiTMINLPInterface::isProvenOptimal(), MyAssert, Bonmin::OsiTMINLPInterface::resolve(), Bonmin::OsiTMINLPInterface::setColLower(), Bonmin::OsiTMINLPInterface::setColUpper(), Bonmin::OsiTMINLPInterface::setWarmStart(), and ws.
Referenced by interfaceTest().
void testOa | ( | Bonmin::OsiTMINLPInterface & | si | ) |
Definition at line 190 of file InterfaceTest.cpp.
References DblEqAssert, e, Bonmin::OsiTMINLPInterface::extractLinearRelaxation(), Bonmin::OsiTMINLPInterface::getNumCols(), Bonmin::OsiTMINLPInterface::getObjSense(), Bonmin::OsiTMINLPInterface::isInteger(), k, lp, and MyAssert.
Referenced by interfaceTest().
void testFp | ( | Bonmin::AmplInterface & | si | ) |
Definition at line 260 of file InterfaceTest.cpp.
References DblEqAssert, e, Bonmin::OsiTMINLPInterface::getColSolution(), Bonmin::OsiTMINLPInterface::getFeasibilityOuterApproximation(), and x.
void interfaceTest | ( | Ipopt::SmartPtr< TNLPSolver > | solver | ) |
Definition at line 271 of file InterfaceTest.cpp.
References Bonmin::BonminAmplSetup::initialize(), Bonmin::BabSetupBase::nonlinearSolver(), Bonmin::OsiTMINLPInterface::setExposeWarmStart(), Bonmin::OsiTMINLPInterface::setSolver(), testGetMethods(), testOa(), testOptimAndSolutionQuery(), and testSetMethods().
Referenced by main().
int main | ( | void | ) |