Public Member Functions | Private Member Functions | Private Attributes

CompDescrParam Class Reference

This class describes a parameter: it consists of

More...

#include <CompDescrParam.h>

Inheritance diagram for CompDescrParam:
CompDescr

List of all members.

Public Member Functions

 CompDescrParam (ModelComp *mc, SyntaxNode *desc)
 Construct given data file description and model component.
std::string toString () const

Private Member Functions

void processValueTableList (const SyntaxNode *node, const SyntaxNodeIx *ix)
 Service routine that processes a tree below a TOKVALUETABLELIST node.

Private Attributes

int nix
 Number of indices.
int nsets
 Number of indexing sets (different to nix).
Set ** indices
 Pointers to the indexing sets.
int n
 Total number of entries: product of the number of elements in all indexing sets.
int nread
 Number of values that are given so far.
double * values
 The array of values.

Detailed Description

This class describes a parameter: it consists of

a multidimensional array


Constructor & Destructor Documentation

CompDescrParam::CompDescrParam ( ModelComp mc,
SyntaxNode desc 
)

Construct given data file description and model component.

Parses the parameter description given in a data file.

Construct from data

This routine constructs a CompDescrParam (the actual parameter values) from a tree of SyntaxNodes originating from the data file.

Parameters:
mc Reference to the Component in the model file (so we can get indexing sets and dimension).
desc The SyntaxNode tree giving the parameter value description as expressed in the data file.

References SyntaxNode::begin(), Set::dim(), SyntaxNode::end(), Set::findPos(), SyntaxNodeIx::getModelComp(), SyntaxNodeIx::getNComp(), SyntaxNode::getOpCode(), SyntaxNode::getValue(), ModelComp::getValue(), ID, ModelComp::id, ModelComp::indexing, indices, n, SyntaxNode::nchild(), nix, nread, nsets, PRINT_LOG, processValueTableList(), GlobalVariables::prtLvl, Set::size(), and values.


Member Function Documentation

void CompDescrParam::processValueTableList ( const SyntaxNode node,
const SyntaxNodeIx ix 
) [private]

Service routine that processes a tree below a TOKVALUETABLELIST node.

Processes a part of a SyntaxNode-tree representing a value_table_list.

Parameters:
node The SyntaxNode of type TOKVALUETABLELIST that describes the values.
ix The indexing expression of the ModelComp that represents the parameter (to get ix->sets_mc).

References SyntaxNode::begin(), SyntaxNode::end(), SyntaxNode::getOpCode(), indices, labelToSetElement(), SyntaxNode::nchild(), nread, Set::size(), and values.

Referenced by CompDescrParam().

string CompDescrParam::toString (  )  const [virtual]

Reimplemented from CompDescr.

References Set::dim(), indices, n, nix, to_string(), and values.


Member Data Documentation

Pointers to the indexing sets.

Referenced by CompDescrParam(), processValueTableList(), and toString().

int CompDescrParam::n [private]

Total number of entries: product of the number of elements in all indexing sets.

Referenced by CompDescrParam(), and toString().

int CompDescrParam::nix [private]

Number of indices.

Referenced by CompDescrParam(), and toString().

int CompDescrParam::nread [private]

Number of values that are given so far.

Referenced by CompDescrParam(), and processValueTableList().

int CompDescrParam::nsets [private]

Number of indexing sets (different to nix).

Referenced by CompDescrParam().

double* CompDescrParam::values [private]

The array of values.

Referenced by CompDescrParam(), processValueTableList(), and toString().


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