Limbo 3.5.4
Loading...
Searching...
No Matches
LpDataBase Class Reference

Custom class that inheritates LpParser::LpDataBase with all the required callbacks defined. More...

Inheritance diagram for LpDataBase:
LpParser::LpDataBase

Public Types

typedef LpParser::int64_t int64_t
 use int64_t in base type

Public Member Functions

 LpDataBase ()
 constructor
void add_variable (string const &vname, double l, double r)
 add variable that l <= vname <= r.
void add_constraint (string const &cname, LpParser::TermArray const &terms, char compare, double constant)
 add constraint that terms compare constant.
void add_objective (bool minimize, LpParser::TermArray const &terms)
 add object terms
void set_integer (string const &vname, bool binary)
 set integer variables

Detailed Description

Custom class that inheritates LpParser::LpDataBase with all the required callbacks defined.

Definition at line 20 of file test_bison.cpp.

Member Typedef Documentation

◆ int64_t

typedef LpParser::int64_t LpDataBase::int64_t

use int64_t in base type

Definition at line 24 of file test_bison.cpp.

Constructor & Destructor Documentation

◆ LpDataBase()

LpDataBase::LpDataBase ( )
inline

constructor

Definition at line 26 of file test_bison.cpp.

Member Function Documentation

◆ add_constraint()

void LpDataBase::add_constraint ( string const & cname,
LpParser::TermArray const & terms,
char compare,
double constant )
inlinevirtual

add constraint that terms compare constant.

Parameters
cnamename of the constraint
termsarray of terms in left hand side
compareoperator '<', '>', '='
constantconstant in the right hand side

Implements LpParser::LpDataBase.

Definition at line 43 of file test_bison.cpp.

◆ add_objective()

void LpDataBase::add_objective ( bool minimize,
LpParser::TermArray const & terms )
inlinevirtual

add object terms

Parameters
minimizetrue denotes minimizing object, false denotes maximizing object
termsarray of terms

Implements LpParser::LpDataBase.

Definition at line 53 of file test_bison.cpp.

◆ add_variable()

void LpDataBase::add_variable ( string const & vname,
double l,
double r )
inlinevirtual

add variable that l <= vname <= r.

Parameters
vnamevariable name
llower bound
rupper bound

Implements LpParser::LpDataBase.

Definition at line 34 of file test_bison.cpp.

◆ set_integer()

void LpDataBase::set_integer ( string const & vname,
bool binary )
inlinevirtual

set integer variables

Parameters
vnameinteger variables
binarydenotes whether they are binary variables

Implements LpParser::LpDataBase.

Definition at line 67 of file test_bison.cpp.


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