irafhy
Interval arithmetic based Reachability Analysis Framework for Hybrid Automaton
irafhy::GLPKWrapper Class Reference

#include <GLPKWrapper.h>

Collaboration diagram for irafhy::GLPKWrapper:
Collaboration graph

Public Member Functions

 GLPKWrapper ()
 constructor More...
 
void init (const Eigen::VectorXd &objectCoefficients, double objectConstantTerm, const Eigen::MatrixXd &constraintMatrix, const std::vector< capd::interval > &constraintRowBounds, const std::vector< capd::interval > &constraintColBounds, LINEPROG_DIRECTION direction)
 initialize the problem with given information More...
 
 ~GLPKWrapper ()
 destructor More...
 
void solve (bool isExact)
 solve the problem with wrapped GLPK library More...
 
Evaluation result (const Eigen::VectorXd &objectCoefficients, const Eigen::MatrixXd &constraintMatrix, const std::vector< capd::interval > &constraintRowBounds) const
 get the resulting of the solving More...
 

Private Member Functions

void createArrays (std::size_t size)
 allocate memory for the GLPK array More...
 
void fillArrays (const Eigen::VectorXd &objectCoefficients, double objectConstantTerm, const Eigen::MatrixXd &constraintMatrix, const std::vector< capd::interval > &constraintRowBounds, const std::vector< capd::interval > &constraintColBounds)
 fill the GLPK array with given information More...
 
void deleteArrays ()
 release the memory More...
 

Private Attributes

glp_prob * glpProb_ = nullptr
 pointer to the GLPK problem More...
 
glp_smcp param_
 GLPK related parameters. More...
 
int * ia_ = nullptr
 pointer to the ia array of GLPK problem More...
 
int * ja_ = nullptr
 pointer to the ja array of GLPK problem More...
 
std::size_t rowCnt_
 number of the rows of constraints More...
 
std::size_t colCnt_
 number of the variables More...
 
double * array_ = nullptr
 GLPK data array. More...
 
bool isExact_
 solve LP problem in exact arithmetic or not More...
 
LINEPROG_DIRECTION direction_
 optimizing direction of the problem More...
 
bool isReady_
 is data prepared More...
 
bool solved_
 is the problem solved by GLPK More...
 
bool isArrayCreated_ = false
 is the GLPK array created More...
 

Constructor & Destructor Documentation

◆ GLPKWrapper()

irafhy::GLPKWrapper::GLPKWrapper ( )
inline

constructor

References init(), result(), solve(), and ~GLPKWrapper().

Here is the call graph for this function:

◆ ~GLPKWrapper()

irafhy::GLPKWrapper::~GLPKWrapper ( )

destructor

References deleteArrays(), glpProb_, isReady_, and solved_.

Referenced by GLPKWrapper().

Here is the call graph for this function:

Member Function Documentation

◆ createArrays()

void irafhy::GLPKWrapper::createArrays ( std::size_t  size)
private

allocate memory for the GLPK array

Parameters
sizesize of the array

References array_, deleteArrays(), ia_, isArrayCreated_, and ja_.

Referenced by init().

Here is the call graph for this function:

◆ deleteArrays()

void irafhy::GLPKWrapper::deleteArrays ( )
private

release the memory

References array_, ia_, isArrayCreated_, and ja_.

Referenced by createArrays(), and ~GLPKWrapper().

◆ fillArrays()

void irafhy::GLPKWrapper::fillArrays ( const Eigen::VectorXd &  objectCoefficients,
double  objectConstantTerm,
const Eigen::MatrixXd &  constraintMatrix,
const std::vector< capd::interval > &  constraintRowBounds,
const std::vector< capd::interval > &  constraintColBounds 
)
private

fill the GLPK array with given information

Parameters
objectCoefficientscoefficients of the object function
objectConstantTermconstant item of the object function
constraintMatrixlinear constraints
constraintRowBoundsbounds of the linear constraints
constraintColBoundsbounds of variables

References array_, colCnt_, glpProb_, ia_, isArrayCreated_, ja_, and rowCnt_.

Referenced by init().

◆ init()

void irafhy::GLPKWrapper::init ( const Eigen::VectorXd &  objectCoefficients,
double  objectConstantTerm,
const Eigen::MatrixXd &  constraintMatrix,
const std::vector< capd::interval > &  constraintRowBounds,
const std::vector< capd::interval > &  constraintColBounds,
LINEPROG_DIRECTION  direction 
)

initialize the problem with given information

Parameters
objectCoefficientscoefficients of object function
objectConstantTermconstant term of object function
constraintMatrixlinear constraints
constraintRowBoundsbounds of linear constraints
constraintColBoundsbounds of variables
directiondirection of the linear programming

References createArrays(), direction_, fillArrays(), glpProb_, isReady_, irafhy::MAX, irafhy::MIN, and param_.

Referenced by GLPKWrapper().

Here is the call graph for this function:

◆ result()

Evaluation irafhy::GLPKWrapper::result ( const Eigen::VectorXd &  objectCoefficients,
const Eigen::MatrixXd &  constraintMatrix,
const std::vector< capd::interval > &  constraintRowBounds 
) const

get the resulting of the solving

Parameters
objectCoefficientscoefficients of object function
constraintMatrixlinear constraints
constraintRowBoundsbounds of linear constraints
Returns
result of the linear programming

References colCnt_, irafhy::FEASIBLE, glpProb_, irafhy::INFEASIBLE, irafhy::NO_FEASIBLE, irafhy::OPTIMAL, rowCnt_, solved_, irafhy::UNBOUNDED, and irafhy::UNDEFINED.

Referenced by GLPKWrapper().

◆ solve()

void irafhy::GLPKWrapper::solve ( bool  isExact)

solve the problem with wrapped GLPK library

Parameters
isExactusing exact arithmetic or not

References array_, colCnt_, glpProb_, ia_, isReady_, ja_, rowCnt_, and solved_.

Referenced by GLPKWrapper().

Member Data Documentation

◆ array_

double* irafhy::GLPKWrapper::array_ = nullptr
private

GLPK data array.

Referenced by createArrays(), deleteArrays(), fillArrays(), and solve().

◆ colCnt_

std::size_t irafhy::GLPKWrapper::colCnt_
private

number of the variables

Referenced by fillArrays(), result(), and solve().

◆ direction_

LINEPROG_DIRECTION irafhy::GLPKWrapper::direction_
private

optimizing direction of the problem

Referenced by init().

◆ glpProb_

glp_prob* irafhy::GLPKWrapper::glpProb_ = nullptr
private

pointer to the GLPK problem

Referenced by fillArrays(), init(), result(), solve(), and ~GLPKWrapper().

◆ ia_

int* irafhy::GLPKWrapper::ia_ = nullptr
private

pointer to the ia array of GLPK problem

Referenced by createArrays(), deleteArrays(), fillArrays(), and solve().

◆ isArrayCreated_

bool irafhy::GLPKWrapper::isArrayCreated_ = false
mutableprivate

is the GLPK array created

Referenced by createArrays(), deleteArrays(), and fillArrays().

◆ isExact_

bool irafhy::GLPKWrapper::isExact_
private

solve LP problem in exact arithmetic or not

◆ isReady_

bool irafhy::GLPKWrapper::isReady_
mutableprivate

is data prepared

Referenced by init(), solve(), and ~GLPKWrapper().

◆ ja_

int* irafhy::GLPKWrapper::ja_ = nullptr
private

pointer to the ja array of GLPK problem

Referenced by createArrays(), deleteArrays(), fillArrays(), and solve().

◆ param_

glp_smcp irafhy::GLPKWrapper::param_
private

GLPK related parameters.

Referenced by init().

◆ rowCnt_

std::size_t irafhy::GLPKWrapper::rowCnt_
private

number of the rows of constraints

Referenced by fillArrays(), result(), and solve().

◆ solved_

bool irafhy::GLPKWrapper::solved_
mutableprivate

is the problem solved by GLPK

Referenced by result(), solve(), and ~GLPKWrapper().


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