NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
|
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>
Public Member Functions | |
Cluster () | |
Cluster (const Cluster &cluster) | |
Cluster (const std::vector< mu::value_type > &vVals) | |
Cluster (const std::vector< std::string > &vStrings) | |
~Cluster () | |
Cluster & | operator= (const Cluster &cluster) |
Cluster & | operator= (const std::vector< mu::value_type > &vVals) |
Cluster & | operator= (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_type > | getDoubleArray () 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... | |
ColumnKeys * | evaluateKeyList (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 |
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.
|
inline |
Definition at line 341 of file cluster.hpp.
References bSortCaseInsensitive, NumeRe::ClusterItem::ITEMTYPE_INVALID, and nGlobalType.
|
inline |
Definition at line 346 of file cluster.hpp.
References assign().
|
inline |
Definition at line 350 of file cluster.hpp.
References assign().
|
inline |
Definition at line 354 of file cluster.hpp.
References assign().
|
inline |
Definition at line 359 of file cluster.hpp.
References clear().
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.
_vLine | const VectorIndex& |
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().
|
private |
Private cluster copy assignment function.
cluster | const Cluster& |
Definition at line 39 of file cluster.cpp.
References bSortCaseInsensitive, clear(), NumeRe::ClusterItem::ITEMTYPE_DOUBLE, nGlobalType, and vClusterArray.
Referenced by Cluster(), and operator=().
|
private |
Private double vector assignment function.
vVals | const std::vector<mu::value_type>& |
Definition at line 67 of file cluster.cpp.
References bSortCaseInsensitive, clear(), NumeRe::ClusterItem::ITEMTYPE_DOUBLE, nGlobalType, and vClusterArray.
|
private |
Private string vector assignment function.
vStrings | const std::vector<std::string>& |
Definition at line 92 of file cluster.cpp.
References bSortCaseInsensitive, clear(), NumeRe::ClusterItem::ITEMTYPE_STRING, nGlobalType, and vClusterArray.
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.
_idx | Indices |
nNum | int |
data | mu::value_type* |
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().
|
private |
Private result assignment function for values using vectors as indices.
_idx | Indices |
nNum | int |
data | mu::value_type* |
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().
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.
_vLine | const VectorIndex& |
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().
void NumeRe::Cluster::clear | ( | ) |
This member function clears the internal memory buffer and frees the associated memory.
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().
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.
_vLine | const VectorIndex& |
dRef | mu::value_type |
_nType | int |
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().
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.
_vLine | const VectorIndex& |
Definition at line 1612 of file cluster.cpp.
References VectorIndex::size(), and vClusterArray.
Referenced by replaceEntityOccurence().
|
overrideprivatevirtual |
This private member function is an override for the sorter object.
i | int |
j | int |
col | int |
Implements Sorter.
Definition at line 160 of file cluster.cpp.
References bSortCaseInsensitive, getDouble(), getParserString(), isDouble(), isMixed(), isString(), mu::real(), toLowerCase(), and vClusterArray.
void NumeRe::Cluster::deleteItems | ( | const VectorIndex & | vLines | ) |
This public member function erases elements referenced by the passed VectorIndex.
vLines | const VectorIndex& |
Definition at line 1116 of file cluster.cpp.
References NumeRe::ClusterItem::ITEMTYPE_INVALID, nGlobalType, VectorIndex::size(), and vClusterArray.
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.
i1 | long longint |
i2 | long longint |
Definition at line 1072 of file cluster.cpp.
References clear(), NumeRe::ClusterItem::ITEMTYPE_INVALID, nGlobalType, and vClusterArray.
Referenced by searchAndDeleteCluster().
size_t NumeRe::Cluster::getBytes | ( | ) | const |
This member function returns the size of the associated memory as bytes.
Definition at line 369 of file cluster.cpp.
References getType(), NumeRe::ClusterItem::ITEMTYPE_DOUBLE, NumeRe::ClusterItem::ITEMTYPE_STRING, and vClusterArray.
mu::value_type NumeRe::Cluster::getDouble | ( | size_t | i | ) | const |
This member function returns the data of the i-th cluster item in memory as a value.
i | size_t |
Definition at line 541 of file cluster.cpp.
References vClusterArray.
Referenced by and_func(), avg(), cmd_show(), cmp(), compare(), NumeReDebugger::gatherLoopBasedInformations(), getDataFromObject(), getDoubleArray(), getShortVectorRepresentation(), NumeReKernel::getStringTable(), isValue(), max(), med(), min(), norm(), num(), or_func(), pct(), prd(), FlowCtrl::range_based_for_loop(), replaceDataEntities(), std(), sum(), to_string(), and xor_func().
std::vector< mu::value_type > NumeRe::Cluster::getDoubleArray | ( | ) | const |
This member function returns the data of all cluster items memory as a value vector.
Definition at line 588 of file cluster.cpp.
References getDouble(), and vClusterArray.
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.
i | size_t |
Definition at line 763 of file cluster.cpp.
References vClusterArray.
Referenced by getInternalStringArray(), and FlowCtrl::range_based_for_loop().
std::vector< std::string > NumeRe::Cluster::getInternalStringArray | ( | ) | const |
This member function returns the data of all cluster items memory as a value vector.
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().
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.
i | size_t |
Definition at line 781 of file cluster.cpp.
References vClusterArray.
Referenced by compare(), ProcedureVarFactory::evaluateProcedureArguments(), getStringArray(), isValue(), num(), replaceDataEntities(), strmax(), and strmin().
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.
maxStringLength | size_t |
Definition at line 962 of file cluster.cpp.
References ellipsize(), getDouble(), getString(), getType(), NumeRe::ClusterItem::ITEMTYPE_DOUBLE, toString(), and vClusterArray.
Referenced by NumeReDebugger::decodeType().
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.
i | size_t |
Definition at line 745 of file cluster.cpp.
References vClusterArray.
Referenced by cmd_show(), NumeReDebugger::gatherLoopBasedInformations(), getShortVectorRepresentation(), and NumeReKernel::getStringTable().
std::vector< std::string > NumeRe::Cluster::getStringArray | ( | ) | const |
This member function returns the data of all cluster items memory as a value vector.
Definition at line 828 of file cluster.cpp.
References getParserString(), and vClusterArray.
unsigned short NumeRe::Cluster::getType | ( | size_t | i | ) | const |
This member function returns the type of the i-th cluster item in the internal memory buffer.
i | size_t |
Definition at line 524 of file cluster.cpp.
References NumeRe::ClusterItem::ITEMTYPE_INVALID, and vClusterArray.
Referenced by and_func(), avg(), cmd_show(), cmp(), NumeReDebugger::gatherLoopBasedInformations(), getBytes(), getShortVectorRepresentation(), NumeReKernel::getStringTable(), isDouble(), isMixed(), isString(), isValue(), max(), med(), min(), norm(), num(), or_func(), pct(), FlowCtrl::range_based_for_loop(), replaceDataEntities(), setDouble(), setDoubleArray(), setString(), setStringArray(), std(), sum(), to_string(), and xor_func().
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.
Definition at line 929 of file cluster.cpp.
References to_string(), and vClusterArray.
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.
vTarget | std::vector<mu::value_type>* |
_vLine | const VectorIndex& |
Definition at line 612 of file cluster.cpp.
References VectorIndex::size(), and vClusterArray.
Referenced by handleCachedDataAccess().
bool NumeRe::Cluster::isDouble | ( | ) | const |
This member function returns, whether the data in the cluster have only double as type.
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().
bool NumeRe::Cluster::isMixed | ( | ) | const |
This member function returns, whether the data in the cluster have mixed type.
Definition at line 414 of file cluster.cpp.
References getType(), NumeRe::ClusterItem::ITEMTYPE_INVALID, NumeRe::ClusterItem::ITEMTYPE_MIXED, nGlobalType, and vClusterArray.
Referenced by compare().
bool NumeRe::Cluster::isString | ( | ) | const |
This member function returns, whether the data in the cluster have only string as type.
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().
|
overrideprivatevirtual |
This private member function is an override for the sorter object.
line | int |
col | int |
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.
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.
_vLine | const VectorIndex& |
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().
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.
_vLine | const VectorIndex& |
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().
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.
_vLine | const VectorIndex& |
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().
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.
_vLine | const VectorIndex& |
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().
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).
_vLine | const VectorIndex& |
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().
Definition at line 364 of file cluster.hpp.
References assign().
|
inline |
Definition at line 369 of file cluster.hpp.
References assign().
|
inline |
Definition at line 374 of file cluster.hpp.
References assign().
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.
_vLine | const VectorIndex& |
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().
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.
_vLine | const VectorIndex& |
dPct | 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().
void NumeRe::Cluster::pop_back | ( | ) |
This member function removes the last item in the internal memory buffer and frees the associated memory.
Definition at line 337 of file cluster.cpp.
References NumeRe::ClusterItem::ITEMTYPE_INVALID, nGlobalType, and vClusterArray.
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.
_vLine | const VectorIndex& |
Definition at line 1378 of file cluster.cpp.
References date::abs(), getDouble(), mu::isnan(), VectorIndex::size(), and vClusterArray.
Referenced by replaceEntityOccurence().
void NumeRe::Cluster::push_back | ( | ClusterItem * | item | ) |
This member function appends an arbitrary cluster item at the back of the internal cluster array buffer.
item | ClusterItem* |
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().
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.
val | const mu::value_type& |
Definition at line 296 of file cluster.cpp.
References NumeRe::ClusterItem::ITEMTYPE_INVALID, NumeRe::ClusterItem::ITEMTYPE_MIXED, NumeRe::ClusterItem::ITEMTYPE_STRING, nGlobalType, and vClusterArray.
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.
strval | const std::string& |
Definition at line 317 of file cluster.cpp.
References NumeRe::ClusterItem::ITEMTYPE_DOUBLE, NumeRe::ClusterItem::ITEMTYPE_INVALID, NumeRe::ClusterItem::ITEMTYPE_MIXED, nGlobalType, and vClusterArray.
|
private |
Reduces the size of this cluster to the specified number of elements. Does not create anything, if the cluster is already smaller.
s | size_t |
Definition at line 253 of file cluster.cpp.
References vClusterArray.
Referenced by setDoubleArray(), and setStringArray().
|
private |
This private member function reorders the elements in the cluster based upon the passed index vector.
vIndex | std::vector<int> |
i1 | int |
i2 | int |
Definition at line 230 of file cluster.cpp.
References vClusterArray.
Referenced by sortElements().
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.
i | size_t |
value | const mu::value_type& |
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().
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.
vVals | const std::vector<mu::value_type>& |
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().
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.
nNum | int |
data | mu::value_type* |
Definition at line 683 of file cluster.cpp.
References getType(), NumeRe::ClusterItem::ITEMTYPE_DOUBLE, nGlobalType, push_back(), reduceSize(), setDouble(), and vClusterArray.
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.
i | size_t |
strval | const std::string& |
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().
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.
sVals | const std::vector<std::string>& |
Definition at line 871 of file cluster.cpp.
References getType(), NumeRe::ClusterItem::ITEMTYPE_STRING, nGlobalType, push_back(), reduceSize(), and vClusterArray.
size_t NumeRe::Cluster::size | ( | ) | const |
This member function returns the size of the internal memory buffer as items.
Definition at line 356 of file cluster.cpp.
References vClusterArray.
Referenced by NumeRe::StringFuncHandler::applySpecialStringFuncs(), assignVectorResults(), NumeReDebugger::decodeType(), DataAccessParser::evalIndices(), ProcedureVarFactory::evaluateProcedureArguments(), Plot::extractDataValues(), getDataForFit(), NumeReKernel::getStringTable(), handleCachedDataAccess(), FlowCtrl::range_based_for_loop(), replaceDataEntities(), searchAndDeleteCluster(), sortClusters(), and NumeRe::ClusterManager::updateClusterSizeVariables().
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.
i1 | long longint |
i2 | long longint |
sSortingExpression | const std::string& |
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().
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.
_vLine | const VectorIndex& |
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().
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.
_vLine | const VectorIndex& |
Definition at line 1271 of file cluster.cpp.
References getParserString(), isDouble(), VectorIndex::size(), and vClusterArray.
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.
_vLine | const VectorIndex& |
Definition at line 1343 of file cluster.cpp.
References getParserString(), isDouble(), VectorIndex::size(), and vClusterArray.
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.
_vLine | const VectorIndex& |
Definition at line 1444 of file cluster.cpp.
References isDouble(), VectorIndex::size(), and vClusterArray.
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.
_vLine | const VectorIndex& |
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().
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.
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().
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.
_vLine | const VectorIndex& |
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().
|
private |
Definition at line 328 of file cluster.hpp.
Referenced by assign(), Cluster(), compare(), and sortElements().
|
mutableprivate |
Definition at line 329 of file cluster.hpp.
Referenced by assign(), assignVectorResults(), clear(), Cluster(), deleteItems(), isDouble(), isMixed(), isString(), pop_back(), push_back(), setDouble(), setDoubleArray(), setString(), and setStringArray().
|
private |
Definition at line 327 of file cluster.hpp.
Referenced by and_func(), assign(), assignVectorResults(), avg(), clear(), cmp(), cnt(), compare(), deleteItems(), getBytes(), getDouble(), getDoubleArray(), getInternalString(), getInternalStringArray(), getParserString(), getShortVectorRepresentation(), getString(), getStringArray(), getType(), getVectorRepresentation(), insertDataInArray(), isDouble(), isMixed(), isString(), isValue(), max(), med(), min(), norm(), num(), or_func(), pct(), pop_back(), prd(), push_back(), reduceSize(), reorderElements(), setDouble(), setDoubleArray(), setString(), setStringArray(), size(), sortElements(), std(), strmax(), strmin(), strsum(), sum(), to_string(), and xor_func().