My Project
CsdpSolver Class Reference

The CsdpSolver class solves problems using Csdp. More...

#include <OSCsdpSolver.h>

Inheritance diagram for CsdpSolver:
DefaultSolver

Public Member Functions

 CsdpSolver ()
 the CsdpSolver class constructor
 
virtual ~CsdpSolver ()
 the CsdpSolver class destructor
 
virtual void solve ()
 solve results in an instance being read into the Csdp data structures and optimized
 
virtual void buildSolverInstance ()
 The implementation of the virtual functions.
 
virtual void setSolverOptions ()
 The implementation of the virtual functions.
 
void dataEchoCheck ()
 use this for debugging, print out the instance that the solver thinks it has and compare this with the OSiL file
 
- Public Member Functions inherited from DefaultSolver
 DefaultSolver ()
 default constructor.
 
virtual ~DefaultSolver ()=0
 default destructor.
 

Public Attributes

OSiLReaderm_osilreader
 m_osilreader is an OSiLReader object used to create an osinstance from an osil string if needed
 
OSoLReaderm_osolreader
 m_osolreader is an OSoLReader object used to create an osoption from an osol string if needed
 
- Public Attributes inherited from DefaultSolver
std::string osil
 osil holds the problem instance as a std::string
 
std::string osol
 osol holds the options for the solver
 
std::string osrl
 osrl holds the solution or result of the model
 
OSInstanceosinstance
 osinstance holds the problem instance in-memory as an OSInstance object
 
OSOptionosoption
 osoption holds the solver options in-memory as an OSOption object
 
OSResultosresult
 osresult holds the solution or result of the model in-memory as an OSResult object
 
std::string sSolverName
 sSolverName is the name of the Coin solver used, e.g.
 
bool bCallbuildSolverInstance
 bCallbuildSolverInstance is set to true if buildSolverService has been called
 
bool bSetSolverOptions
 bSetSolverOptions is set to true if setSolverOptions has been called, false otherwise
 

Private Attributes

int nC_rows
 
int nC_blks
 
int ncon
 
struct blockmatrix C_matrix
 
double * rhsValues
 
struct constraintmatrix * mconstraints
 
struct blockmatrix X Z
 
double * y
 
double pobj
 
double dobj
 
OSrLWriterosrlwriter
 
Methods to block default compiler methods.

The compiler automatically generates the following three methods.

Since the default compiler implementation is generally not what you want (for all but the most simple classes), we usually put the declarations of these methods in the private section and never implement them. This prevents the compiler from implementing an incorrect "default" behavior without us knowing. (See Scott Meyers book, "Effective C++")

std::string * csdpErrorMsg
 

Detailed Description

The CsdpSolver class solves problems using Csdp.

Author
Jun Ma, Kipp Martin, Horand Gassmann
Version
1.0, 05/26/2014
Since
OS 2.8
Remarks
this class takes an OSiL instance and optimizes it using the COIN-OR Csdp solver

Definition at line 71 of file OSCsdpSolver.h.

Constructor & Destructor Documentation

◆ CsdpSolver()

CsdpSolver::CsdpSolver ( )

the CsdpSolver class constructor

Definition at line 51 of file OSCsdpSolver.cpp.

◆ ~CsdpSolver()

CsdpSolver::~CsdpSolver ( )
virtual

the CsdpSolver class destructor

Definition at line 64 of file OSCsdpSolver.cpp.

Member Function Documentation

◆ solve()

void CsdpSolver::solve ( )
virtual

solve results in an instance being read into the Csdp data structures and optimized

Implements DefaultSolver.

Definition at line 718 of file OSCsdpSolver.cpp.

◆ buildSolverInstance()

void CsdpSolver::buildSolverInstance ( )
virtual

The implementation of the virtual functions.

Returns
void.

If we're using unsigned shorts, make sure that the problem isn't too big.

Allocate space for the C matrix (A0).

Handle diagonal blocks and matrix blocks separately.

Allocate space for the constraints (again using 1-based indexing).

Null out all pointers in constraints.

Go through all of the blocks in each of the constraint matrices, and allocate space for the entries and indices.

initialize and allocate storage for the entries in this block of this constraint.

Implements DefaultSolver.

Definition at line 85 of file OSCsdpSolver.cpp.

◆ setSolverOptions()

void CsdpSolver::setSolverOptions ( )
virtual

The implementation of the virtual functions.

Returns
void.

Since CSDP provides no user interface for solver options other than reading them in from the file param.csdp (if this file exists) the only choice is to write the options to file so that they can be read back by the CSDP method initparams(), called from easy_sdp().

Note also that initial values are not treated here; there is the special method setInitialValues() that should be used for that purpose.

Implements DefaultSolver.

Definition at line 522 of file OSCsdpSolver.cpp.

◆ dataEchoCheck()

void CsdpSolver::dataEchoCheck ( )

use this for debugging, print out the instance that the solver thinks it has and compare this with the OSiL file

Definition at line 1081 of file OSCsdpSolver.cpp.

Member Data Documentation

◆ nC_rows

int CsdpSolver::nC_rows
private

Definition at line 74 of file OSCsdpSolver.h.

◆ nC_blks

int CsdpSolver::nC_blks
private

Definition at line 75 of file OSCsdpSolver.h.

◆ ncon

int CsdpSolver::ncon
private

Definition at line 76 of file OSCsdpSolver.h.

◆ C_matrix

struct blockmatrix CsdpSolver::C_matrix
private

Definition at line 77 of file OSCsdpSolver.h.

◆ rhsValues

double* CsdpSolver::rhsValues
private

Definition at line 78 of file OSCsdpSolver.h.

◆ mconstraints

struct constraintmatrix* CsdpSolver::mconstraints
private

Definition at line 79 of file OSCsdpSolver.h.

◆ Z

struct blockmatrix X CsdpSolver::Z
private

Definition at line 80 of file OSCsdpSolver.h.

◆ y

double* CsdpSolver::y
private

Definition at line 81 of file OSCsdpSolver.h.

◆ pobj

double CsdpSolver::pobj
private

Definition at line 82 of file OSCsdpSolver.h.

◆ dobj

double CsdpSolver::dobj
private

Definition at line 82 of file OSCsdpSolver.h.

◆ m_osilreader

OSiLReader* CsdpSolver::m_osilreader

m_osilreader is an OSiLReader object used to create an osinstance from an osil string if needed

Definition at line 126 of file OSCsdpSolver.h.

◆ m_osolreader

OSoLReader* CsdpSolver::m_osolreader

m_osolreader is an OSoLReader object used to create an osoption from an osol string if needed

Definition at line 132 of file OSCsdpSolver.h.

◆ osrlwriter

OSrLWriter* CsdpSolver::osrlwriter
private

Definition at line 136 of file OSCsdpSolver.h.

◆ csdpErrorMsg

std::string* CsdpSolver::csdpErrorMsg
private

Definition at line 154 of file OSCsdpSolver.h.


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