class for a stochastic (node-based) constraint More...
#include <corenode_base.hpp>
Public Member Functions | |
p2node (CoreNodeBase::p2activeNode) | |
constrIndx (static_cast< int >(p2node->all_constraints.size())) | |
![]() | |
MP_constraint (const MP_set_base &s1=MP_set::getEmpty(), const MP_set_base &s2=MP_set::getEmpty(), const MP_set_base &s3=MP_set::getEmpty(), const MP_set_base &s4=MP_set::getEmpty(), const MP_set_base &s5=MP_set::getEmpty()) | |
construct the MP_constraint with appropriate sets for indexing. More... | |
MP_constraint & | operator() (const MP_index_exp &i1=MP_index_exp::getEmpty(), const MP_index_exp &i2=MP_index_exp::getEmpty(), const MP_index_exp &i3=MP_index_exp::getEmpty(), const MP_index_exp &i4=MP_index_exp::getEmpty(), const MP_index_exp &i5=MP_index_exp::getEmpty()) |
operator int () | |
virtual | ~MP_constraint () |
double | price (int i1=0, int i2=0, int i3=0, int i4=0, int i5=0) const |
void | coefficients (GenerateFunctor &f) |
int | row_number () const |
MP_constraint & | such_that (const MP_boolean &b) |
void | insertVariables (std::set< MP_variable * > &v) |
void | operator= (const Constraint &v) |
void | display (std::string s="") const |
![]() | |
int | size () const |
![]() | |
std::string | getName () const |
void | setName (const std::string &n) |
Public Attributes | |
__pad0__: MP_constraint(s1) | |
![]() | |
MP_model * | M |
int | offset |
MP_expression | left |
MP_expression | right |
Sense_enum | sense |
Private Attributes | |
CoreNodeBase * | p2node |
pointer to the node the constr. belongs to More... | |
int | constrIndx |
Additional Inherited Members | |
![]() | |
RowMajor (int s1, int s2, int s3, int s4, int s5) | |
int | f (int i1=0, int i2=0, int i3=0, int i4=0, int i5=0) const |
![]() | |
int | size1 |
int | size2 |
int | size3 |
int | size4 |
int | size5 |
int | size_ |
class for a stochastic (node-based) constraint
Basically, this is identical to the MP_constraint, but it registers itself with the scenario-tree node and adds a new value()
method.
So far, we implement only variables indexed on simple one-dimensional sets.
Note that constraints are different from variables, since we cannot get a pointer to one constraint in the set (one row). This is because if we have an MP_constraint
C
, then
C(i)
sets the internal indices to point to the right row and returns a pointer to C
(as pointer to C(i)
does not exist); by default, the internal indices point to the first row.C()
returns the row of the currently selected row, based on the values of the internal indices; this is why C(i)
() returns the row corresponding to the i-th constraint!C.row_number(i)
is the same as
(), but with bound checking. This implies that even if we put pointers/references to C(i)
into all_constraints
, we get repeated pointers to the same object. One way around this is to detect this when we process the list, but that would mean an extra burden on the user. Instead, we add a vector constr_row_offsets
of offsets that are added to the rows. Definition at line 170 of file corenode_base.hpp.
FlopSmiEx::CoreNodeBase::SP_constraint::p2node | ( | CoreNodeBase::p2activeNode | ) |
|
inline |
Definition at line 177 of file corenode_base.hpp.
|
private |
pointer to the node the constr. belongs to
Definition at line 172 of file corenode_base.hpp.
|
private |
Definition at line 173 of file corenode_base.hpp.
FlopSmiEx::CoreNodeBase::SP_constraint::__pad0__ |
Definition at line 176 of file corenode_base.hpp.