- Main Page
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# OSMatlab Class Reference

The OSMatlab Class. More...

`#include <OSMatlabSolver.h>`

Collaboration diagram for OSMatlab:

[legend]
List of all members.

## Public Member Functions
| OSMatlab ()
| the OSMatlab class constructor
| ~OSMatlab ()
| the OSMatlab class destructor
std::string | solve ()
| Solve the problem instance.
void | createOSInstance ()
| Create an OSInstance.
## Public Attributes
SparseMatrix * | sparseMat
| sparseMat is a pointer to an OS Sprase Matrix data structure
double * | bl
| bl is a pointer to the lower bounds on the constraints
double * | bu
| bu is a pointer to the upper bounds on the constraints
double * | obj
| obj is a pointer to the objective function coefficients
double * | vl
| vl is a pointer to the lower bounds on the varialbes
double * | vu
| vu is a pointer to the upper bounds on the variables
int | numVar
| numVar is the number of variables in the problem
int | numCon
| numCon is the number of constraints in the problem
char * | varType
| varType is a pointer to the variable type eg C, B, I
bool | objType
| objType indicates whether or not we have a max (1) or a min (0)
int | numQTerms
| numQTerms is the number of quadratic terms
int * | qRows
| qRows is a pointer to the row index of each quadratic term
int * | qIndex1
| qIndex1 is a pointer to the index of the first variable in each of the quadratic terms
int * | qIndex2
| qIndex2 is a pointer to the index of the second variable in each of the quadratic terms
double * | qVal
| qVal is a pointer to the coefficient value of each of the quadratic terms.
DefaultSolver * | solverType
| solverType is the a pointer to the sovler that will be requested
std::string | instanceName
| instanceName is the name of the problem instance
std::string | sSolverName
| sSolverName is the name of the solver
std::string | sAgentAddress
| is the address of the solver service
OSInstance * | osinstance
| osinstance is a pointer to an OSInstance object that gets created from the MATLAB data structures
std::string | osil
| is the osil instance that gets created from the MATLAB data structures

## Detailed Description

The OSMatlab Class.

Author:
  Robert Fourer, Jun Ma, Kipp Martin

Version:
  1.0, 03/14/2004

Since:
  OS 1.0

Remarks:
  the OSMatlab class is used by the matlabSolver mex (Matlab EXecutable) which takes MATLAB data structures and creats an OSiL string.

for now we can only handle linear integer and quadratic programming problems, not general nonlinear problems

Definition at line 61 of file OSMatlabSolver.h.

## Constructor & Destructor Documentation

OSMatlab::OSMatlab | ( |  | ) |

the OSMatlab class constructor

Definition at line 32 of file OSMatlabSolver.cpp.

References bl, bu, instanceName, numCon, numQTerms, numVar, obj, objType, osinstance, qIndex1, qIndex2, qRows, qVal, sAgentAddress, solverType, sparseMat, sSolverName, varType, vl, and vu.

OSMatlab::~OSMatlab | ( |  | ) |

the OSMatlab class destructor

Definition at line 56 of file OSMatlabSolver.cpp.

References osinstance.

## Member Function Documentation

std::string OSMatlab::solve | ( |  | ) |

Solve the problem instance.

Returns:
  a string with the solution in OSrL format

Definition at line 60 of file OSMatlabSolver.cpp.

References ErrorClass::errormsg, OSiLWriter::m_bWhiteSpace, osil, DefaultSolver::osinstance, osinstance, DefaultSolver::osol, DefaultSolver::osrl, sAgentAddress, OSSolverAgent::solve(), DefaultSolver::solve(), IpoptSolver::solve(), solverType, DefaultSolver::sSolverName, sSolverName, and OSiLWriter::writeOSiL().

void OSMatlab::createOSInstance | ( |  | ) |

Create an OSInstance.

Definition at line 216 of file OSMatlabSolver.cpp.

References OSInstance::addConstraint(), OSInstance::addObjective(), OSInstance::addVariable(), bl, bu, SparseMatrix::indexes, SparseVector::indexes, instanceName, numCon, numQTerms, numVar, obj, objType, osinstance, qIndex1, qIndex2, qRows, qVal, OSInstance::setConstraintNumber(), OSInstance::setInstanceDescription(), OSInstance::setInstanceName(), OSInstance::setLinearConstraintCoefficients(), OSInstance::setObjectiveNumber(), OSInstance::setQuadraticTermsInNonlinearExpressions(), OSInstance::setVariableNumber(), sparseMat, SparseMatrix::starts, SparseMatrix::startSize, SparseMatrix::values, SparseVector::values, SparseMatrix::valueSize, varType, vl, and vu.

## Member Data Documentation

SparseMatrix* OSMatlab::sparseMat

sparseMat is a pointer to an OS Sprase Matrix data structure

Definition at line 74 of file OSMatlabSolver.h.

Referenced by createOSInstance(), and OSMatlab().

double* OSMatlab::bl

bl is a pointer to the lower bounds on the constraints

Definition at line 79 of file OSMatlabSolver.h.

Referenced by createOSInstance(), and OSMatlab().

double* OSMatlab::bu

bu is a pointer to the upper bounds on the constraints

Definition at line 84 of file OSMatlabSolver.h.

Referenced by createOSInstance(), and OSMatlab().

double* OSMatlab::obj

obj is a pointer to the objective function coefficients

Definition at line 89 of file OSMatlabSolver.h.

Referenced by createOSInstance(), and OSMatlab().

double* OSMatlab::vl

vl is a pointer to the lower bounds on the varialbes

Definition at line 94 of file OSMatlabSolver.h.

Referenced by createOSInstance(), and OSMatlab().

double* OSMatlab::vu

vu is a pointer to the upper bounds on the variables

Definition at line 99 of file OSMatlabSolver.h.

Referenced by createOSInstance(), and OSMatlab().

int OSMatlab::numVar

numVar is the number of variables in the problem

Definition at line 104 of file OSMatlabSolver.h.

Referenced by createOSInstance(), and OSMatlab().

int OSMatlab::numCon

numCon is the number of constraints in the problem

Definition at line 109 of file OSMatlabSolver.h.

Referenced by createOSInstance(), and OSMatlab().

char* OSMatlab::varType

varType is a pointer to the variable type eg C, B, I

Definition at line 114 of file OSMatlabSolver.h.

Referenced by createOSInstance(), and OSMatlab().

bool OSMatlab::objType

objType indicates whether or not we have a max (1) or a min (0)

Definition at line 119 of file OSMatlabSolver.h.

Referenced by createOSInstance(), and OSMatlab().

int OSMatlab::numQTerms

numQTerms is the number of quadratic terms

Definition at line 122 of file OSMatlabSolver.h.

Referenced by createOSInstance(), and OSMatlab().

int* OSMatlab::qRows

qRows is a pointer to the row index of each quadratic term

Definition at line 127 of file OSMatlabSolver.h.

Referenced by createOSInstance(), and OSMatlab().

int* OSMatlab::qIndex1

qIndex1 is a pointer to the index of the first variable in each of the quadratic terms

Definition at line 132 of file OSMatlabSolver.h.

Referenced by createOSInstance(), and OSMatlab().

int* OSMatlab::qIndex2

qIndex2 is a pointer to the index of the second variable in each of the quadratic terms

Definition at line 137 of file OSMatlabSolver.h.

Referenced by createOSInstance(), and OSMatlab().

double* OSMatlab::qVal

qVal is a pointer to the coefficient value of each of the quadratic terms.

Definition at line 142 of file OSMatlabSolver.h.

Referenced by createOSInstance(), and OSMatlab().

DefaultSolver* OSMatlab::solverType

solverType is the a pointer to the sovler that will be requested

Definition at line 147 of file OSMatlabSolver.h.

Referenced by OSMatlab(), and solve().

std::string OSMatlab::instanceName

instanceName is the name of the problem instance

Definition at line 150 of file OSMatlabSolver.h.

Referenced by createOSInstance(), and OSMatlab().

std::string OSMatlab::sSolverName

sSolverName is the name of the solver

Definition at line 153 of file OSMatlabSolver.h.

Referenced by OSMatlab(), and solve().

std::string OSMatlab::sAgentAddress

is the address of the solver service

Definition at line 156 of file OSMatlabSolver.h.

Referenced by OSMatlab(), and solve().

OSInstance* OSMatlab::osinstance

osinstance is a pointer to an OSInstance object that gets created from the MATLAB data structures

Definition at line 174 of file OSMatlabSolver.h.

Referenced by createOSInstance(), OSMatlab(), solve(), and ~OSMatlab().

std::string OSMatlab::osil

is the osil instance that gets created from the MATLAB data structures

Definition at line 179 of file OSMatlabSolver.h.

Referenced by solve().

The documentation for this class was generated from the following files:

- /home/coin/SVN-release/OS-2.3.5/OS/src/OSSolverInterfaces/OSMatlabSolver.h
- /home/coin/SVN-release/OS-2.3.5/OS/src/OSSolverInterfaces/OSMatlabSolver.cpp