NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
NumeRe::Cluster Class Reference

This class represents a whole cluster. The single items are stored as pointers to the abstract cluster item. This object can be constructed from many different base items and has more or less all memory-like functions. More...

#include <cluster.hpp>

Inheritance diagram for NumeRe::Cluster:
Collaboration diagram for NumeRe::Cluster:

Public Member Functions

 Cluster ()
 
 Cluster (const Cluster &cluster)
 
 Cluster (const std::vector< mu::value_type > &vVals)
 
 Cluster (const std::vector< std::string > &vStrings)
 
 ~Cluster ()
 
Clusteroperator= (const Cluster &cluster)
 
Clusteroperator= (const std::vector< mu::value_type > &vVals)
 
Clusteroperator= (const std::vector< std::string > &vStrings)
 
void push_back (ClusterItem *item)
 This member function appends an arbitrary cluster item at the back of the internal cluster array buffer. More...
 
void push_back (const mu::value_type &val)
 This member function constructs a new double cluster item at the back of the internal cluster array buffer. More...
 
void push_back (const std::string &strval)
 This member function constructs a new string cluster item at the back of the internal cluster array buffer. More...
 
void pop_back ()
 This member function removes the last item in the internal memory buffer and frees the associated memory. More...
 
size_t size () const
 This member function returns the size of the internal memory buffer as items. More...
 
size_t getBytes () const
 This member function returns the size of the associated memory as bytes. More...
 
void clear ()
 This member function clears the internal memory buffer and frees the associated memory. More...
 
bool isMixed () const
 This member function returns, whether the data in the cluster have mixed type. More...
 
bool isDouble () const
 This member function returns, whether the data in the cluster have only double as type. More...
 
bool isString () const
 This member function returns, whether the data in the cluster have only string as type. More...
 
unsigned short getType (size_t i) const
 This member function returns the type of the i-th cluster item in the internal memory buffer. More...
 
mu::value_type getDouble (size_t i) const
 This member function returns the data of the i-th cluster item in memory as a value. More...
 
void setDouble (size_t i, const mu::value_type &value)
 This member function assigns a value as data for the i-th cluster item in memory. The type of the i-th cluster item is adapted on-the-fly. More...
 
std::vector< mu::value_typegetDoubleArray () const
 This member function returns the data of all cluster items memory as a value vector. More...
 
void insertDataInArray (std::vector< mu::value_type > *vTarget, const VectorIndex &_vLine)
 This member function inserts the data of all cluster items memory into the pointer passed to the function. This function is used for cached memory accesses. More...
 
void setDoubleArray (const std::vector< mu::value_type > &vVals)
 This member function assigns values as data for the all cluster items in memory. The type of the cluster items is adapted on-the-fly. More...
 
void setDoubleArray (int nNum, mu::value_type *data)
 This member function assigns values as data for the all cluster items in memory. The type of the cluster items is adapted on-the-fly. More...
 
void assignResults (Indices _idx, int nNum, mu::value_type *data)
 This member function assigns calculation results as data for the cluster items in memory, which are referenced by the passed indices. The type of the cluster items is adapted on-the-fly. More...
 
std::string getString (size_t i) const
 This member function returns the data of the i-th cluster item in memory as a string. More...
 
std::string getInternalString (size_t i) const
 This member function returns the data of the i-th cluster item in memory as a string. More...
 
std::string getParserString (size_t i) const
 This member function returns the data of the i-th cluster item in memory as a parser string. More...
 
void setString (size_t i, const std::string &strval)
 This member function assigns a string as data for the i-th cluster item in memory. The type of the i-th cluster item is adapted on-the-fly. More...
 
std::vector< std::string > getStringArray () const
 This member function returns the data of all cluster items memory as a value vector. More...
 
std::vector< std::string > getInternalStringArray () const
 This member function returns the data of all cluster items memory as a value vector. More...
 
void setStringArray (const std::vector< std::string > &sVals)
 This member function assigns values as data for the all cluster items in memory. The type of the cluster items is adapted on-the-fly. More...
 
std::vector< std::string > to_string () const
 Converts all contents of this cluster to a vector of strings. Intended to be used for data transfer. More...
 
std::string getVectorRepresentation () const
 This member function constructs a plain vector from the data in memory, which can be inserted in the commandline as a replacement for the call to the cluster. More...
 
std::string getShortVectorRepresentation (size_t maxStringLength) const
 This member function constructs a short version of a plain vector from the data in memory, which is used to display a preview of the contained data in the variable viewers. More...
 
std::vector< int > sortElements (long long int i1, long long int i2, const std::string &sSortingExpression)
 This public member function provides access to the sorting algorithm for the cluster object. More...
 
void deleteItems (long long int i1, long long int i2)
 This public member function erases elements located from the index i1 to i2. More...
 
void deleteItems (const VectorIndex &vLines)
 This public member function erases elements referenced by the passed VectorIndex. More...
 
mu::value_type std (const VectorIndex &_vLine)
 This member function calculates the standard deviation of the data in memory. Cluster items, which do not have the type "value" are ignored. More...
 
mu::value_type avg (const VectorIndex &_vLine)
 This member function calculates the average of the data in memory. Cluster items, which do not have the type "value" are ignored. More...
 
mu::value_type max (const VectorIndex &_vLine)
 This member function calculates the maximal value of the data in memory. Cluster items, which do not have the type "value" are ignored. More...
 
std::string strmax (const VectorIndex &_vLine)
 This member function calculates the maximal string value of the data in memory. Cluster items of all types are used and converted on-the-fly. More...
 
mu::value_type min (const VectorIndex &_vLine)
 This member function calculates the minimal value of the data in memory. Cluster items, which do not have the type "value" are ignored. More...
 
std::string strmin (const VectorIndex &_vLine)
 This member function calculates the minimal string value of the data in memory. Cluster items of all types are used and converted on-the-fly. More...
 
mu::value_type prd (const VectorIndex &_vLine)
 This member function calculates the product of the data in memory. Cluster items, which do not have the type "value" are ignored. More...
 
mu::value_type sum (const VectorIndex &_vLine)
 This member function calculates the sum of the data in memory. Cluster items, which do not have the type "value" are ignored. More...
 
std::string strsum (const VectorIndex &_vLine)
 This member function calculates the string concatenation of the data in memory. Cluster items of all types are used and converted on-the-fly. More...
 
mu::value_type num (const VectorIndex &_vLine)
 This member function counts the number of valid cluster items in memory. Cluster items of any type are counted, if they do have a valid value (depending on their type). More...
 
mu::value_type and_func (const VectorIndex &_vLine)
 This member function applies an "AND" to the data in memory. Cluster items, which do not have the type "value" are ignored. More...
 
mu::value_type or_func (const VectorIndex &_vLine)
 This member function applies an "OR" to the data in memory. Cluster items, which do not have the type "value" are ignored. More...
 
mu::value_type xor_func (const VectorIndex &_vLine)
 This member function applies an "exclusive OR" to the data in memory. Cluster items, which do not have the type "value" are ignored. More...
 
mu::value_type cnt (const VectorIndex &_vLine)
 This member function counts the number of valid cluster items in memory. Cluster items of any type are counted, if the vector index points to a valid location. More...
 
mu::value_type norm (const VectorIndex &_vLine)
 This member function calculates the euclidic vector norm of the data in memory. Cluster items, which do not have the type "value" are ignored. More...
 
mu::value_type cmp (const VectorIndex &_vLine, mu::value_type dRef, int _nType)
 This member function compares the values in memory with the referenced value and returns indices or values depending on the passed type. Cluster items, which do not have the type "value" are ignored. More...
 
mu::value_type med (const VectorIndex &_vLine)
 This member function calculates the median value of the data in memory. Cluster items, which do not have the type "value" are ignored. More...
 
mu::value_type pct (const VectorIndex &_vLine, mu::value_type dPct)
 This member function calculates the p-th percentile of the data in memory. Cluster items, which do not have the type "value" are ignored. More...
 
- Public Member Functions inherited from Sorter
virtual ~Sorter ()
 
bool qSort (int *nIndex, int nElements, int nColumn, long long int nLeft, long long int nRight, int nSign)
 This public member function is the interface to the quicksort algorithm, which itself is implemented as a private member function of this class. More...
 
bool sortSubList (int *nIndex, int nElements, ColumnKeys *KeyList, long long int i1, long long int i2, long long int j1, int nSign, long long int nColumns)
 This public member function handles the hierarchical sorting process of many columns together. The ColumnKeys object contains the necessary information needed for the hierarchical sorting. More...
 
ColumnKeysevaluateKeyList (std::string &sKeyList, long long int nColumnCount)
 This public member function creates a ColumnKeys object from a string containing the hierarchical sorting order for the current sorting process. More...
 

Private Member Functions

void assign (const Cluster &cluster)
 Private cluster copy assignment function. More...
 
void assign (const std::vector< mu::value_type > &vVals)
 Private double vector assignment function. More...
 
void assign (const std::vector< std::string > &vStrings)
 Private string vector assignment function. More...
 
void assignVectorResults (Indices _idx, int nNum, mu::value_type *data)
 Private result assignment function for values using vectors as indices. More...
 
virtual int compare (int i, int j, int col) override
 This private member function is an override for the sorter object. More...
 
virtual bool isValue (int line, int col) override
 This private member function is an override for the sorter object. More...
 
void reorderElements (std::vector< int > vIndex, int i1, int i2)
 This private member function reorders the elements in the cluster based upon the passed index vector. More...
 
void reduceSize (size_t z)
 Reduces the size of this cluster to the specified number of elements. Does not create anything, if the cluster is already smaller. More...
 

Private Attributes

std::vector< ClusterItem * > vClusterArray
 
bool bSortCaseInsensitive
 
int nGlobalType
 

Additional Inherited Members

virtual int compare (int i, int j, int col)=0
 
virtual bool isValue (int line, int col)=0
 

Detailed Description

This class represents a whole cluster. The single items are stored as pointers to the abstract cluster item. This object can be constructed from many different base items and has more or less all memory-like functions.

Definition at line 324 of file cluster.hpp.

Constructor & Destructor Documentation

◆ Cluster() [1/4]

NumeRe::Cluster::Cluster ( )
inline

◆ Cluster() [2/4]

NumeRe::Cluster::Cluster ( const Cluster cluster)
inline

Definition at line 346 of file cluster.hpp.

References assign().

Here is the call graph for this function:

◆ Cluster() [3/4]

NumeRe::Cluster::Cluster ( const std::vector< mu::value_type > &  vVals)
inline

Definition at line 350 of file cluster.hpp.

References assign().

Here is the call graph for this function:

◆ Cluster() [4/4]

NumeRe::Cluster::Cluster ( const std::vector< std::string > &  vStrings)
inline

Definition at line 354 of file cluster.hpp.

References assign().

Here is the call graph for this function:

◆ ~Cluster()

NumeRe::Cluster::~Cluster ( )
inline

Definition at line 359 of file cluster.hpp.

References clear().

Here is the call graph for this function:

Member Function Documentation

◆ and_func()

mu::value_type NumeRe::Cluster::and_func ( const VectorIndex _vLine)

This member function applies an "AND" to the data in memory. Cluster items, which do not have the type "value" are ignored.

Parameters
_vLineconst VectorIndex&
Returns
mu::value_type

Definition at line 1506 of file cluster.cpp.

References getDouble(), getType(), mu::isnan(), NumeRe::ClusterItem::ITEMTYPE_DOUBLE, mu::real(), VectorIndex::size(), and vClusterArray.

Referenced by replaceEntityOccurence().

Here is the call graph for this function:

◆ assign() [1/3]

void NumeRe::Cluster::assign ( const Cluster cluster)
private

Private cluster copy assignment function.

Parameters
clusterconst Cluster&
Returns
void

Definition at line 39 of file cluster.cpp.

References bSortCaseInsensitive, clear(), NumeRe::ClusterItem::ITEMTYPE_DOUBLE, nGlobalType, and vClusterArray.

Referenced by Cluster(), and operator=().

Here is the call graph for this function:

◆ assign() [2/3]

void NumeRe::Cluster::assign ( const std::vector< mu::value_type > &  vVals)
private

Private double vector assignment function.

Parameters
vValsconst std::vector<mu::value_type>&
Returns
void

Definition at line 67 of file cluster.cpp.

References bSortCaseInsensitive, clear(), NumeRe::ClusterItem::ITEMTYPE_DOUBLE, nGlobalType, and vClusterArray.

Here is the call graph for this function:

◆ assign() [3/3]

void NumeRe::Cluster::assign ( const std::vector< std::string > &  vStrings)
private

Private string vector assignment function.

Parameters
vStringsconst std::vector<std::string>&
Returns
void

Definition at line 92 of file cluster.cpp.

References bSortCaseInsensitive, clear(), NumeRe::ClusterItem::ITEMTYPE_STRING, nGlobalType, and vClusterArray.

Here is the call graph for this function:

◆ assignResults()

void NumeRe::Cluster::assignResults ( Indices  _idx,
int  nNum,
mu::value_type data 
)

This member function assigns calculation results as data for the cluster items in memory, which are referenced by the passed indices. The type of the cluster items is adapted on-the-fly.

Parameters
_idxIndices
nNumint
datamu::value_type*
Returns
void

Definition at line 720 of file cluster.cpp.

References assignVectorResults(), VectorIndex::front(), VectorIndex::isOpenEnd(), Indices::row, and setDoubleArray().

Referenced by FlowCtrl::calc(), FlowCtrl::compile(), NumeReKernel::MainLoop(), and Procedure::ProcCalc().

Here is the call graph for this function:

◆ assignVectorResults()

void NumeRe::Cluster::assignVectorResults ( Indices  _idx,
int  nNum,
mu::value_type data 
)
private

Private result assignment function for values using vectors as indices.

Parameters
_idxIndices
nNumint
datamu::value_type*
Returns
void

Definition at line 119 of file cluster.cpp.

References VectorIndex::front(), NumeRe::ClusterItem::ITEMTYPE_DOUBLE, NumeRe::ClusterItem::ITEMTYPE_INVALID, max, nGlobalType, push_back(), Indices::row, VectorIndex::setOpenEndIndex(), size(), VectorIndex::size(), and vClusterArray.

Referenced by assignResults().

Here is the call graph for this function:

◆ avg()

mu::value_type NumeRe::Cluster::avg ( const VectorIndex _vLine)

This member function calculates the average of the data in memory. Cluster items, which do not have the type "value" are ignored.

Parameters
_vLineconst VectorIndex&
Returns
mu::value_type

Definition at line 1198 of file cluster.cpp.

References date::abs(), getDouble(), getType(), mu::isnan(), NumeRe::ClusterItem::ITEMTYPE_DOUBLE, VectorIndex::size(), and vClusterArray.

Referenced by replaceEntityOccurence(), and std().

Here is the call graph for this function:

◆ clear()

void NumeRe::Cluster::clear ( )

This member function clears the internal memory buffer and frees the associated memory.

Returns
void

Definition at line 395 of file cluster.cpp.

References NumeRe::ClusterItem::ITEMTYPE_INVALID, nGlobalType, and vClusterArray.

Referenced by assign(), NumeRe::StringParser::createStringOutput(), deleteItems(), performMatrixOperation(), NumeRe::StringParser::storeStringToDataObjects(), and ~Cluster().

◆ cmp()

mu::value_type NumeRe::Cluster::cmp ( const VectorIndex _vLine,
mu::value_type  dRef,
int  _nType 
)

This member function compares the values in memory with the referenced value and returns indices or values depending on the passed type. Cluster items, which do not have the type "value" are ignored.

Parameters
_vLineconst VectorIndex&
dRefmu::value_type
_nTypeint
Returns
mu::value_type

Definition at line 1675 of file cluster.cpp.

References date::abs(), getDouble(), getType(), intCast(), mu::isnan(), NumeRe::ClusterItem::ITEMTYPE_DOUBLE, mu::real(), VectorIndex::size(), and vClusterArray.

Referenced by replaceEntityOccurence().

Here is the call graph for this function:

◆ cnt()

mu::value_type NumeRe::Cluster::cnt ( const VectorIndex _vLine)

This member function counts the number of valid cluster items in memory. Cluster items of any type are counted, if the vector index points to a valid location.

Parameters
_vLineconst VectorIndex&
Returns
mu::value_type

Definition at line 1612 of file cluster.cpp.

References VectorIndex::size(), and vClusterArray.

Referenced by replaceEntityOccurence().

Here is the call graph for this function:

◆ compare()

int NumeRe::Cluster::compare ( int  i,
int  j,
int  col 
)
overrideprivatevirtual

This private member function is an override for the sorter object.

Parameters
iint
jint
colint
Returns
int

Implements Sorter.

Definition at line 160 of file cluster.cpp.

References bSortCaseInsensitive, getDouble(), getParserString(), isDouble(), isMixed(), isString(), mu::real(), toLowerCase(), and vClusterArray.

Here is the call graph for this function:

◆ deleteItems() [1/2]

void NumeRe::Cluster::deleteItems ( const VectorIndex vLines)

This public member function erases elements referenced by the passed VectorIndex.

Parameters
vLinesconst VectorIndex&
Returns
void

Definition at line 1116 of file cluster.cpp.

References NumeRe::ClusterItem::ITEMTYPE_INVALID, nGlobalType, VectorIndex::size(), and vClusterArray.

Here is the call graph for this function:

◆ deleteItems() [2/2]

void NumeRe::Cluster::deleteItems ( long long int  i1,
long long int  i2 
)

This public member function erases elements located from the index i1 to i2.

Parameters
i1long longint
i2long longint
Returns
void

Definition at line 1072 of file cluster.cpp.

References clear(), NumeRe::ClusterItem::ITEMTYPE_INVALID, nGlobalType, and vClusterArray.

Referenced by searchAndDeleteCluster().

Here is the call graph for this function:

◆ getBytes()

size_t NumeRe::Cluster::getBytes ( ) const

This member function returns the size of the associated memory as bytes.

Returns
size_t

Definition at line 369 of file cluster.cpp.

References getType(), NumeRe::ClusterItem::ITEMTYPE_DOUBLE, NumeRe::ClusterItem::ITEMTYPE_STRING, and vClusterArray.

Here is the call graph for this function:

◆ getDouble()

mu::value_type NumeRe::Cluster::getDouble ( size_t  i) const

◆ getDoubleArray()

std::vector< mu::value_type > NumeRe::Cluster::getDoubleArray ( ) const

This member function returns the data of all cluster items memory as a value vector.

Returns
std::vector<mu::value_type>

Definition at line 588 of file cluster.cpp.

References getDouble(), and vClusterArray.

Here is the call graph for this function:

◆ getInternalString()

std::string NumeRe::Cluster::getInternalString ( size_t  i) const

This member function returns the data of the i-th cluster item in memory as a string.

Parameters
isize_t
Returns
std::string

Definition at line 763 of file cluster.cpp.

References vClusterArray.

Referenced by getInternalStringArray(), and FlowCtrl::range_based_for_loop().

◆ getInternalStringArray()

std::vector< std::string > NumeRe::Cluster::getInternalStringArray ( ) const

This member function returns the data of all cluster items memory as a value vector.

Returns
std::vector<std::string>

Definition at line 848 of file cluster.cpp.

References getInternalString(), and vClusterArray.

Referenced by tableMethod_categorize(), tableMethod_counteq(), tableMethod_findCols(), tableMethod_index(), and tableMethod_rank().

Here is the call graph for this function:

◆ getParserString()

std::string NumeRe::Cluster::getParserString ( size_t  i) const

This member function returns the data of the i-th cluster item in memory as a parser string.

Parameters
isize_t
Returns
std::string

Definition at line 781 of file cluster.cpp.

References vClusterArray.

Referenced by compare(), ProcedureVarFactory::evaluateProcedureArguments(), getStringArray(), isValue(), num(), replaceDataEntities(), strmax(), and strmin().

◆ getShortVectorRepresentation()

std::string NumeRe::Cluster::getShortVectorRepresentation ( size_t  maxStringLength) const

This member function constructs a short version of a plain vector from the data in memory, which is used to display a preview of the contained data in the variable viewers.

Parameters
maxStringLengthsize_t
Returns
std::string

Definition at line 962 of file cluster.cpp.

References ellipsize(), getDouble(), getString(), getType(), NumeRe::ClusterItem::ITEMTYPE_DOUBLE, toString(), and vClusterArray.

Referenced by NumeReDebugger::decodeType().

Here is the call graph for this function:

◆ getString()

std::string NumeRe::Cluster::getString ( size_t  i) const

This member function returns the data of the i-th cluster item in memory as a string.

Parameters
isize_t
Returns
std::string

Definition at line 745 of file cluster.cpp.

References vClusterArray.

Referenced by cmd_show(), NumeReDebugger::gatherLoopBasedInformations(), getShortVectorRepresentation(), and NumeReKernel::getStringTable().

◆ getStringArray()

std::vector< std::string > NumeRe::Cluster::getStringArray ( ) const

This member function returns the data of all cluster items memory as a value vector.

Returns
std::vector<std::string>

Definition at line 828 of file cluster.cpp.

References getParserString(), and vClusterArray.

Here is the call graph for this function:

◆ getType()

unsigned short NumeRe::Cluster::getType ( size_t  i) const

◆ getVectorRepresentation()

std::string NumeRe::Cluster::getVectorRepresentation ( ) const

This member function constructs a plain vector from the data in memory, which can be inserted in the commandline as a replacement for the call to the cluster.

Returns
std::string

Definition at line 929 of file cluster.cpp.

References to_string(), and vClusterArray.

Here is the call graph for this function:

◆ insertDataInArray()

void NumeRe::Cluster::insertDataInArray ( std::vector< mu::value_type > *  vTarget,
const VectorIndex _vLine 
)

This member function inserts the data of all cluster items memory into the pointer passed to the function. This function is used for cached memory accesses.

Parameters
vTargetstd::vector<mu::value_type>*
_vLineconst VectorIndex&
Returns
void

Definition at line 612 of file cluster.cpp.

References VectorIndex::size(), and vClusterArray.

Referenced by handleCachedDataAccess().

Here is the call graph for this function:

◆ isDouble()

bool NumeRe::Cluster::isDouble ( ) const

This member function returns, whether the data in the cluster have only double as type.

Returns
bool

Definition at line 451 of file cluster.cpp.

References getType(), NumeRe::ClusterItem::ITEMTYPE_DOUBLE, NumeRe::ClusterItem::ITEMTYPE_INVALID, NumeRe::ClusterItem::ITEMTYPE_MIXED, nGlobalType, and vClusterArray.

Referenced by compare(), handleCachedDataAccess(), FlowCtrl::range_based_for_loop(), replaceDataEntities(), strmax(), strmin(), and strsum().

Here is the call graph for this function:

◆ isMixed()

bool NumeRe::Cluster::isMixed ( ) const

This member function returns, whether the data in the cluster have mixed type.

Returns
bool

Definition at line 414 of file cluster.cpp.

References getType(), NumeRe::ClusterItem::ITEMTYPE_INVALID, NumeRe::ClusterItem::ITEMTYPE_MIXED, nGlobalType, and vClusterArray.

Referenced by compare().

Here is the call graph for this function:

◆ isString()

bool NumeRe::Cluster::isString ( ) const

This member function returns, whether the data in the cluster have only string as type.

Returns
bool

Definition at line 487 of file cluster.cpp.

References getType(), NumeRe::ClusterItem::ITEMTYPE_INVALID, NumeRe::ClusterItem::ITEMTYPE_MIXED, NumeRe::ClusterItem::ITEMTYPE_STRING, nGlobalType, and vClusterArray.

Referenced by compare(), max(), min(), FlowCtrl::range_based_for_loop(), and sum().

Here is the call graph for this function:

◆ isValue()

bool NumeRe::Cluster::isValue ( int  line,
int  col 
)
overrideprivatevirtual

This private member function is an override for the sorter object.

Parameters
lineint
colint
Returns
bool

Implements Sorter.

Definition at line 207 of file cluster.cpp.

References getDouble(), getParserString(), getType(), mu::isnan(), NumeRe::ClusterItem::ITEMTYPE_DOUBLE, NumeRe::ClusterItem::ITEMTYPE_STRING, mu::real(), and vClusterArray.

Here is the call graph for this function:

◆ max()

mu::value_type NumeRe::Cluster::max ( const VectorIndex _vLine)

This member function calculates the maximal value of the data in memory. Cluster items, which do not have the type "value" are ignored.

Parameters
_vLineconst VectorIndex&
Returns
mu::value_type

Definition at line 1234 of file cluster.cpp.

References getDouble(), getType(), mu::isnan(), isString(), NumeRe::ClusterItem::ITEMTYPE_DOUBLE, mu::real(), VectorIndex::size(), and vClusterArray.

Referenced by replaceEntityOccurence().

Here is the call graph for this function:

◆ med()

mu::value_type NumeRe::Cluster::med ( const VectorIndex _vLine)

This member function calculates the median value of the data in memory. Cluster items, which do not have the type "value" are ignored.

Parameters
_vLineconst VectorIndex&
Returns
mu::value_type

Definition at line 1784 of file cluster.cpp.

References getDouble(), getType(), mu::isnan(), NumeRe::ClusterItem::ITEMTYPE_DOUBLE, qSortDouble(), mu::real(), VectorIndex::size(), and vClusterArray.

Referenced by replaceEntityOccurence().

Here is the call graph for this function:

◆ min()

mu::value_type NumeRe::Cluster::min ( const VectorIndex _vLine)

This member function calculates the minimal value of the data in memory. Cluster items, which do not have the type "value" are ignored.

Parameters
_vLineconst VectorIndex&
Returns
mu::value_type

Definition at line 1306 of file cluster.cpp.

References getDouble(), getType(), mu::isnan(), isString(), NumeRe::ClusterItem::ITEMTYPE_DOUBLE, mu::real(), VectorIndex::size(), and vClusterArray.

Referenced by replaceEntityOccurence().

Here is the call graph for this function:

◆ norm()

mu::value_type NumeRe::Cluster::norm ( const VectorIndex _vLine)

This member function calculates the euclidic vector norm of the data in memory. Cluster items, which do not have the type "value" are ignored.

Parameters
_vLineconst VectorIndex&
Returns
mu::value_type

Definition at line 1639 of file cluster.cpp.

References date::abs(), getDouble(), getType(), mu::isnan(), NumeRe::ClusterItem::ITEMTYPE_DOUBLE, VectorIndex::size(), and vClusterArray.

Referenced by replaceEntityOccurence().

Here is the call graph for this function:

◆ num()

mu::value_type NumeRe::Cluster::num ( const VectorIndex _vLine)

This member function counts the number of valid cluster items in memory. Cluster items of any type are counted, if they do have a valid value (depending on their type).

Parameters
_vLineconst VectorIndex&
Returns
mu::value_type

Definition at line 1475 of file cluster.cpp.

References getDouble(), getParserString(), getType(), mu::isnan(), NumeRe::ClusterItem::ITEMTYPE_DOUBLE, NumeRe::ClusterItem::ITEMTYPE_STRING, mu::real(), VectorIndex::size(), and vClusterArray.

Referenced by replaceEntityOccurence().

Here is the call graph for this function:

◆ operator=() [1/3]

Cluster & NumeRe::Cluster::operator= ( const Cluster cluster)
inline

Definition at line 364 of file cluster.hpp.

References assign().

Here is the call graph for this function:

◆ operator=() [2/3]

Cluster & NumeRe::Cluster::operator= ( const std::vector< mu::value_type > &  vVals)
inline

Definition at line 369 of file cluster.hpp.

References assign().

Here is the call graph for this function:

◆ operator=() [3/3]

Cluster & NumeRe::Cluster::operator= ( const std::vector< std::string > &  vStrings)
inline

Definition at line 374 of file cluster.hpp.

References assign().

Here is the call graph for this function:

◆ or_func()

mu::value_type NumeRe::Cluster::or_func ( const VectorIndex _vLine)

This member function applies an "OR" to the data in memory. Cluster items, which do not have the type "value" are ignored.

Parameters
_vLineconst VectorIndex&
Returns
mu::value_type

Definition at line 1542 of file cluster.cpp.

References getDouble(), getType(), mu::isnan(), NumeRe::ClusterItem::ITEMTYPE_DOUBLE, mu::real(), VectorIndex::size(), and vClusterArray.

Referenced by replaceEntityOccurence().

Here is the call graph for this function:

◆ pct()

mu::value_type NumeRe::Cluster::pct ( const VectorIndex _vLine,
mu::value_type  dPct 
)

This member function calculates the p-th percentile of the data in memory. Cluster items, which do not have the type "value" are ignored.

Parameters
_vLineconst VectorIndex&
dPctmu::value_type
Returns
mu::value_type

Definition at line 1851 of file cluster.cpp.

References getDouble(), getType(), mu::isnan(), NumeRe::ClusterItem::ITEMTYPE_DOUBLE, qSortDouble(), mu::real(), VectorIndex::size(), and vClusterArray.

Referenced by replaceEntityOccurence().

Here is the call graph for this function:

◆ pop_back()

void NumeRe::Cluster::pop_back ( )

This member function removes the last item in the internal memory buffer and frees the associated memory.

Returns
void

Definition at line 337 of file cluster.cpp.

References NumeRe::ClusterItem::ITEMTYPE_INVALID, nGlobalType, and vClusterArray.

◆ prd()

mu::value_type NumeRe::Cluster::prd ( const VectorIndex _vLine)

This member function calculates the product of the data in memory. Cluster items, which do not have the type "value" are ignored.

Parameters
_vLineconst VectorIndex&
Returns
mu::value_type

Definition at line 1378 of file cluster.cpp.

References date::abs(), getDouble(), mu::isnan(), VectorIndex::size(), and vClusterArray.

Referenced by replaceEntityOccurence().

Here is the call graph for this function:

◆ push_back() [1/3]

void NumeRe::Cluster::push_back ( ClusterItem item)

This member function appends an arbitrary cluster item at the back of the internal cluster array buffer.

Parameters
itemClusterItem*
Returns
void

Definition at line 274 of file cluster.cpp.

References NumeRe::ClusterItem::getType(), NumeRe::ClusterItem::ITEMTYPE_INVALID, NumeRe::ClusterItem::ITEMTYPE_MIXED, nGlobalType, and vClusterArray.

Referenced by assignVectorResults(), NumeRe::StringParser::createStringOutput(), getDataFromObject(), replaceDataEntities(), setDouble(), setDoubleArray(), setString(), and setStringArray().

Here is the call graph for this function:

◆ push_back() [2/3]

void NumeRe::Cluster::push_back ( const mu::value_type val)

This member function constructs a new double cluster item at the back of the internal cluster array buffer.

Parameters
valconst mu::value_type&
Returns
void

Definition at line 296 of file cluster.cpp.

References NumeRe::ClusterItem::ITEMTYPE_INVALID, NumeRe::ClusterItem::ITEMTYPE_MIXED, NumeRe::ClusterItem::ITEMTYPE_STRING, nGlobalType, and vClusterArray.

◆ push_back() [3/3]

void NumeRe::Cluster::push_back ( const std::string &  strval)

This member function constructs a new string cluster item at the back of the internal cluster array buffer.

Parameters
strvalconst std::string&
Returns
void

Definition at line 317 of file cluster.cpp.

References NumeRe::ClusterItem::ITEMTYPE_DOUBLE, NumeRe::ClusterItem::ITEMTYPE_INVALID, NumeRe::ClusterItem::ITEMTYPE_MIXED, nGlobalType, and vClusterArray.

◆ reduceSize()

void NumeRe::Cluster::reduceSize ( size_t  s)
private

Reduces the size of this cluster to the specified number of elements. Does not create anything, if the cluster is already smaller.

Parameters
ssize_t
Returns
void

Definition at line 253 of file cluster.cpp.

References vClusterArray.

Referenced by setDoubleArray(), and setStringArray().

◆ reorderElements()

void NumeRe::Cluster::reorderElements ( std::vector< int >  vIndex,
int  i1,
int  i2 
)
private

This private member function reorders the elements in the cluster based upon the passed index vector.

Parameters
vIndexstd::vector<int>
i1int
i2int
Returns
void

Definition at line 230 of file cluster.cpp.

References vClusterArray.

Referenced by sortElements().

◆ setDouble()

void NumeRe::Cluster::setDouble ( size_t  i,
const mu::value_type value 
)

This member function assigns a value as data for the i-th cluster item in memory. The type of the i-th cluster item is adapted on-the-fly.

Parameters
isize_t
valueconst mu::value_type&
Returns
void

Definition at line 561 of file cluster.cpp.

References getType(), NumeRe::ClusterItem::ITEMTYPE_DOUBLE, NumeRe::ClusterItem::ITEMTYPE_INVALID, nGlobalType, push_back(), and vClusterArray.

Referenced by cmd_clear(), ProcedureVarFactory::createLocalInlineVars(), ProcedureVarFactory::createTestStatsCluster(), performMatrixOperation(), FlowCtrl::range_based_for_loop(), setDoubleArray(), NumeReKernel::StartUp(), NumeRe::StringParser::storeStringToDataObjects(), and FlowCtrl::updateTestStats().

Here is the call graph for this function:

◆ setDoubleArray() [1/2]

void NumeRe::Cluster::setDoubleArray ( const std::vector< mu::value_type > &  vVals)

This member function assigns values as data for the all cluster items in memory. The type of the cluster items is adapted on-the-fly.

Parameters
vValsconst std::vector<mu::value_type>&
Returns
void

Definition at line 648 of file cluster.cpp.

References getType(), NumeRe::ClusterItem::ITEMTYPE_DOUBLE, nGlobalType, push_back(), reduceSize(), setDouble(), and vClusterArray.

Referenced by assignResults(), FlowCtrl::calc(), FlowCtrl::compile(), NumeReKernel::createCalculationAnswer(), ProcedureVarFactory::createLocalClusters(), NumeRe::StringParser::eval(), FlowCtrl::evalRangeBasedHeader(), ProcedureVarFactory::evaluateProcedureArguments(), Procedure::ProcCalc(), and NumeRe::StringParser::storeStringResults().

Here is the call graph for this function:

◆ setDoubleArray() [2/2]

void NumeRe::Cluster::setDoubleArray ( int  nNum,
mu::value_type data 
)

This member function assigns values as data for the all cluster items in memory. The type of the cluster items is adapted on-the-fly.

Parameters
nNumint
datamu::value_type*
Returns
void

Definition at line 683 of file cluster.cpp.

References getType(), NumeRe::ClusterItem::ITEMTYPE_DOUBLE, nGlobalType, push_back(), reduceSize(), setDouble(), and vClusterArray.

Here is the call graph for this function:

◆ setString()

void NumeRe::Cluster::setString ( size_t  i,
const std::string &  strval 
)

This member function assigns a string as data for the i-th cluster item in memory. The type of the i-th cluster item is adapted on-the-fly.

Parameters
isize_t
strvalconst std::string&
Returns
void

Definition at line 801 of file cluster.cpp.

References getType(), NumeRe::ClusterItem::ITEMTYPE_INVALID, NumeRe::ClusterItem::ITEMTYPE_STRING, nGlobalType, push_back(), and vClusterArray.

Referenced by ProcedureVarFactory::createLocalInlineStrings(), ProcedureVarFactory::createTestStatsCluster(), FlowCtrl::range_based_for_loop(), and NumeRe::StringParser::storeStringToDataObjects().

Here is the call graph for this function:

◆ setStringArray()

void NumeRe::Cluster::setStringArray ( const std::vector< std::string > &  sVals)

This member function assigns values as data for the all cluster items in memory. The type of the cluster items is adapted on-the-fly.

Parameters
sValsconst std::vector<std::string>&
Returns
void

Definition at line 871 of file cluster.cpp.

References getType(), NumeRe::ClusterItem::ITEMTYPE_STRING, nGlobalType, push_back(), reduceSize(), and vClusterArray.

Here is the call graph for this function:

◆ size()

◆ sortElements()

std::vector< int > NumeRe::Cluster::sortElements ( long long int  i1,
long long int  i2,
const std::string &  sSortingExpression 
)

This public member function provides access to the sorting algorithm for the cluster object.

Parameters
i1long longint
i2long longint
sSortingExpressionconst std::string&
Returns
std::vector<int>

Definition at line 1009 of file cluster.cpp.

References bSortCaseInsensitive, SyntaxError::CANNOT_SORT_DATA, findParameter(), SyntaxError::invalid_position, Sorter::qSort(), reorderElements(), and vClusterArray.

Referenced by sortClusters().

Here is the call graph for this function:

◆ std()

mu::value_type NumeRe::Cluster::std ( const VectorIndex _vLine)

This member function calculates the standard deviation of the data in memory. Cluster items, which do not have the type "value" are ignored.

Parameters
_vLineconst VectorIndex&
Returns
mu::value_type

Definition at line 1160 of file cluster.cpp.

References date::abs(), avg(), getDouble(), getType(), mu::isnan(), NumeRe::ClusterItem::ITEMTYPE_DOUBLE, VectorIndex::size(), and vClusterArray.

Referenced by replaceEntityOccurence().

Here is the call graph for this function:

◆ strmax()

std::string NumeRe::Cluster::strmax ( const VectorIndex _vLine)

This member function calculates the maximal string value of the data in memory. Cluster items of all types are used and converted on-the-fly.

Parameters
_vLineconst VectorIndex&
Returns
string

Definition at line 1271 of file cluster.cpp.

References getParserString(), isDouble(), VectorIndex::size(), and vClusterArray.

Here is the call graph for this function:

◆ strmin()

std::string NumeRe::Cluster::strmin ( const VectorIndex _vLine)

This member function calculates the minimal string value of the data in memory. Cluster items of all types are used and converted on-the-fly.

Parameters
_vLineconst VectorIndex&
Returns
std::string

Definition at line 1343 of file cluster.cpp.

References getParserString(), isDouble(), VectorIndex::size(), and vClusterArray.

Here is the call graph for this function:

◆ strsum()

std::string NumeRe::Cluster::strsum ( const VectorIndex _vLine)

This member function calculates the string concatenation of the data in memory. Cluster items of all types are used and converted on-the-fly.

Parameters
_vLineconst VectorIndex&
Returns
std::string

Definition at line 1444 of file cluster.cpp.

References isDouble(), VectorIndex::size(), and vClusterArray.

Here is the call graph for this function:

◆ sum()

mu::value_type NumeRe::Cluster::sum ( const VectorIndex _vLine)

This member function calculates the sum of the data in memory. Cluster items, which do not have the type "value" are ignored.

Parameters
_vLineconst VectorIndex&
Returns
mu::value_type

Definition at line 1411 of file cluster.cpp.

References date::abs(), getDouble(), getType(), mu::isnan(), isString(), NumeRe::ClusterItem::ITEMTYPE_DOUBLE, VectorIndex::size(), and vClusterArray.

Referenced by replaceEntityOccurence().

Here is the call graph for this function:

◆ to_string()

std::vector< std::string > NumeRe::Cluster::to_string ( ) const

Converts all contents of this cluster to a vector of strings. Intended to be used for data transfer.

Returns
std::vector<std::string>

Definition at line 903 of file cluster.cpp.

References getDouble(), getType(), NumeRe::ClusterItem::ITEMTYPE_DOUBLE, toCmdString(), and vClusterArray.

Referenced by FlowCtrl::calc(), FlowCtrl::compile(), getVectorRepresentation(), and Procedure::ProcCalc().

Here is the call graph for this function:

◆ xor_func()

mu::value_type NumeRe::Cluster::xor_func ( const VectorIndex _vLine)

This member function applies an "exclusive OR" to the data in memory. Cluster items, which do not have the type "value" are ignored.

Parameters
_vLineconst VectorIndex&
Returns
mu::value_type

Definition at line 1572 of file cluster.cpp.

References getDouble(), getType(), mu::isnan(), NumeRe::ClusterItem::ITEMTYPE_DOUBLE, mu::real(), VectorIndex::size(), and vClusterArray.

Referenced by replaceEntityOccurence().

Here is the call graph for this function:

Member Data Documentation

◆ bSortCaseInsensitive

bool NumeRe::Cluster::bSortCaseInsensitive
private

Definition at line 328 of file cluster.hpp.

Referenced by assign(), Cluster(), compare(), and sortElements().

◆ nGlobalType

int NumeRe::Cluster::nGlobalType
mutableprivate

◆ vClusterArray


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