Classes | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
FlopSmiEx::CoreNodeBase Class Reference

Problem-independent base class for an LP/MIP model in one node of a tree. More...

#include <corenode_base.hpp>

Collaboration diagram for FlopSmiEx::CoreNodeBase:
Collaboration graph
[legend]

Classes

class  SP_constraint
 class for a stochastic (node-based) constraint More...
 
class  SP_variable
 class for a stochastic (node-based) variable More...
 

Public Member Functions

 CoreNodeBase (CoreNodeBase *p2pred, int nodeStage=-1)
 constructor More...
 
virtual ~CoreNodeBase ()
 destructor More...
 
void set_var_values (double const *p2values)
 point a given pointer to the vector of scenario solution values More...
 
MP_expressionget_obj_func ()
 make and return the recursive objective function More...
 

Public Attributes

CoreNodeBasep2parent
 pointer to the node's parent More...
 
CoreNodeBasep2child
 pointer to the node's child More...
 
int stage
 stage of the node (used only for reporting) More...
 
references to variables and constraints
vector< VariableRef const * > all_variables
 The idea is to have "meta objects" with all variables and constraints in a node. More...
 
vector< MP_constraint * > all_constraints
 list of ref. to constraints More...
 
vector< int > constr_row_offsets
 list of row offsets More...
 

Protected Member Functions

void make_obj_func_rec ()
 create the objective function expression, recursively for all children More...
 

Protected Attributes

MP_expression objFuncNode
 objective function in this node More...
 
MP_expression objFuncRec
 objective function in this node and below More...
 

Static Protected Attributes

static CoreNodeBasep2activeNode
 static pointer to the current CoreNodeBase object More...
 
static double const * p2varValues
 vector of scenario solution values, for use in SP_variable More...
 

Detailed Description

Problem-independent base class for an LP/MIP model in one node of a tree.

Definition at line 36 of file corenode_base.hpp.

Constructor & Destructor Documentation

FlopSmiEx::CoreNodeBase::CoreNodeBase ( CoreNodeBase p2pred,
int  nodeStage = -1 
)
inline

constructor

Definition at line 62 of file corenode_base.hpp.

virtual FlopSmiEx::CoreNodeBase::~CoreNodeBase ( )
inlinevirtual

destructor

Definition at line 72 of file corenode_base.hpp.

Member Function Documentation

void FlopSmiEx::CoreNodeBase::set_var_values ( double const *  p2values)
inline

point a given pointer to the vector of scenario solution values

Definition at line 91 of file corenode_base.hpp.

MP_expression& FlopSmiEx::CoreNodeBase::get_obj_func ( )
inline

make and return the recursive objective function

This probably makes sense only in root nodes.

Definition at line 97 of file corenode_base.hpp.

void FlopSmiEx::CoreNodeBase::make_obj_func_rec ( )
protected

create the objective function expression, recursively for all children

This function is protected, as it only makes sense to call it in the root, to create the complete objective function.

Member Data Documentation

CoreNodeBase* FlopSmiEx::CoreNodeBase::p2activeNode
staticprotected

static pointer to the current CoreNodeBase object

Each time a variable or constraint is constructed, it should register itself with the node it belongs to. However, this means that they need a pointer to the node object. The easiest option is to pass a pointer to the constructor, but this would clutter the code. Instead, we declare this static variable and let the CoreNodeBase's constructor set it to itself. Since every node calls the constructor of the base class first, p2activeNode will point to the correct node at the time the node's variables and constraints get constructed.

Definition at line 47 of file corenode_base.hpp.

double const* FlopSmiEx::CoreNodeBase::p2varValues
staticprotected

vector of scenario solution values, for use in SP_variable

The value() member of SP_variable needs to have access to scenario solution values. One option would be to pass a pointer, but this would make the function a bit more difficult to read. Instead, we point this static pointer to the solution and then use this one in value() instead.

Definition at line 55 of file corenode_base.hpp.

MP_expression FlopSmiEx::CoreNodeBase::objFuncNode
protected

objective function in this node

Definition at line 57 of file corenode_base.hpp.

MP_expression FlopSmiEx::CoreNodeBase::objFuncRec
protected

objective function in this node and below

Definition at line 58 of file corenode_base.hpp.

CoreNodeBase* FlopSmiEx::CoreNodeBase::p2parent

pointer to the node's parent

Definition at line 74 of file corenode_base.hpp.

CoreNodeBase* FlopSmiEx::CoreNodeBase::p2child

pointer to the node's child

Definition at line 75 of file corenode_base.hpp.

int FlopSmiEx::CoreNodeBase::stage

stage of the node (used only for reporting)

Definition at line 76 of file corenode_base.hpp.

vector<VariableRef const *> FlopSmiEx::CoreNodeBase::all_variables

The idea is to have "meta objects" with all variables and constraints in a node.

This is important in creation of the Smi object, where we have to associate the nodes variables and constraints to stages. Without these new objects, we would have to access all the derived classes independently, cluttering the code. list of ref. to variables

Definition at line 85 of file corenode_base.hpp.

vector<MP_constraint *> FlopSmiEx::CoreNodeBase::all_constraints

list of ref. to constraints

Definition at line 86 of file corenode_base.hpp.

vector<int> FlopSmiEx::CoreNodeBase::constr_row_offsets

list of row offsets

Definition at line 87 of file corenode_base.hpp.


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