This class describes a parameter: it consists of
#include <CompDescrParam.h>
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. |
This class describes a parameter: it consists of
a multidimensional array
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.
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.
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.
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.
Set** CompDescrParam::indices [private] |
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().