ScenTreeStruct Class Reference

Class describing the scenario-tree structure. More...

Inheritance diagram for ScenTreeStruct:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 ScenTreeStruct (const int nNodes, const int firstL)
 Constructs the object.
virtual ~ScenTreeStruct ()
virtual int get_parent (int n) const =0
 This function returns the parent of a given node (and 0 for the root).

Public Attributes

int nmbNodes
 nodes are 0..nmbNodes-1, where 0 is root
int firstLeaf
 nodes firstLeaf..nmbNodes-1 are leaves


Detailed Description

Class describing the scenario-tree structure.

Definition at line 154 of file investment.cpp.


Constructor & Destructor Documentation

ScenTreeStruct::ScenTreeStruct ( const int  nNodes,
const int  firstL 
) [inline]

Constructs the object.

Definition at line 160 of file investment.cpp.

virtual ScenTreeStruct::~ScenTreeStruct (  )  [inline, virtual]

Definition at line 163 of file investment.cpp.


Member Function Documentation

virtual int ScenTreeStruct::get_parent ( int  n  )  const [pure virtual]

This function returns the parent of a given node (and 0 for the root).

In a general case, this would be given by a table, for balanced trees one can use a simple formula. The question is what to do with the root: should the function return 0, -1, or throw an exception?

Implemented in BinTreeStruct.


Member Data Documentation

int ScenTreeStruct::nmbNodes

nodes are 0..nmbNodes-1, where 0 is root

Definition at line 156 of file investment.cpp.

Referenced by main().

int ScenTreeStruct::firstLeaf

nodes firstLeaf..nmbNodes-1 are leaves

Definition at line 157 of file investment.cpp.

Referenced by main().


The documentation for this class was generated from the following file:
Generated on Mon Jan 26 10:53:13 2009 for investment by  doxygen 1.5.4