class for a stochastic (node-based) variable More...
#include <corenode_base.hpp>


Public Member Functions | |
| SP_variable (MP_set const &s1=MP_set::getEmpty(), MP_set const &s2=MP_set::getEmpty()) | |
| double | value (int const i1=0, int const i2=0) const |
| get the value of a given variable | |
Private Attributes | |
| CoreNodeBase * | p2node |
| pointer to the node the var belongs to | |
| int | varIndx |
| index of the 1st el. in the vector of node's variables | |
class for a stochastic (node-based) variable
Basically, this is identical to the MP_variable, but it registers itself with the scenario-tree node and adds a new value() method.
In this example, we have implemented only variables indexed on simple one- or two-dimensional sets.
Definition at line 111 of file corenode_base.hpp.
| FlopSmiEx::CoreNodeBase::SP_variable::SP_variable | ( | MP_set const & | s1 = MP_set::getEmpty(), |
|
| MP_set const & | s2 = MP_set::getEmpty() | |||
| ) | [inline] |
Definition at line 116 of file corenode_base.hpp.
| double FlopSmiEx::CoreNodeBase::SP_variable::value | ( | int const | i1 = 0, |
|
| int const | i2 = 0 | |||
| ) | const [inline] |
get the value of a given variable
For this to work, the CoreNodeBase::p2varValues must be pointed to the vector of scenario solution, using CoreNodeBase::set_var_values().
Note that we use the f method inherited from MP_variable to compute the offset for a given combination of indices.
Definition at line 141 of file corenode_base.hpp.
pointer to the node the var belongs to
Definition at line 113 of file corenode_base.hpp.
int FlopSmiEx::CoreNodeBase::SP_variable::varIndx [private] |
index of the 1st el. in the vector of node's variables
Definition at line 114 of file corenode_base.hpp.
1.6.1