26#include "../utils/tools.hpp"
227 virtual void setString(
const std::string& strval)
override
309 virtual void setString(
const std::string& strval)
override
332 void assign(
const std::vector<mu::value_type>& vVals);
333 void assign(
const std::vector<std::string>& vStrings);
335 virtual int compare(
int i,
int j,
int col)
override;
336 virtual bool isValue(
int line,
int col)
override;
350 Cluster(
const std::vector<mu::value_type>& vVals)
354 Cluster(
const std::vector<std::string>& vStrings)
382 void push_back(
const std::string& strval);
393 unsigned short getType(
size_t i)
const;
406 void setString(
size_t i,
const std::string& strval);
411 std::vector<std::string>
to_string()
const;
415 std::vector<int>
sortElements(
long long int i1,
long long int i2,
const std::string& sSortingExpression);
416 void deleteItems(
long long int i1,
long long int i2);
463 bool isCluster(
const std::string& sCluster)
const;
This is a cluster item, which contains a double. It features conversions to and from strings on-the-f...
virtual std::string getParserString() override
Returns the internal value converted to a string.
virtual std::string getString() override
Returns the internal value converted to a string.
virtual void setDouble(const mu::value_type &val) override
Overwrites the internal value.
virtual void setString(const std::string &strval) override
Overwrites the internal value with the passed string, which will converted to a value first.
ClusterDoubleItem(const mu::value_type &value)
virtual std::string getInternalString() override
Returns the internal value converted to a string.
virtual ~ClusterDoubleItem() override
virtual mu::value_type getDouble() override
Returns the internal value.
This class represents a whole cluster. The single items are stored as pointers to the abstract cluste...
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 clus...
bool isString() const
This member function returns, whether the data in the cluster have only string as type.
bool bSortCaseInsensitive
size_t size() const
This member function returns the size of the internal memory buffer as items.
void clear()
This member function clears the internal memory buffer and frees the associated memory.
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.
std::string getString(size_t i) const
This member function returns the data of the i-th cluster item in memory as a string.
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-t...
void push_back(ClusterItem *item)
This member function appends an arbitrary cluster item at the back of the internal cluster array buff...
mu::value_type med(const VectorIndex &_vLine)
This member function calculates the median value of the data in memory. Cluster items,...
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....
void assignVectorResults(Indices _idx, int nNum, mu::value_type *data)
Private result assignment function for values using vectors as indices.
mu::value_type min(const VectorIndex &_vLine)
This member function calculates the minimal value of the data in memory. Cluster items,...
Cluster(const Cluster &cluster)
Cluster & operator=(const std::vector< std::string > &vStrings)
void assignResults(Indices _idx, int nNum, mu::value_type *data)
This member function assigns calculation results as data for the cluster items in memory,...
std::vector< std::string > getInternalStringArray() const
This member function returns the data of all cluster items memory as a value vector.
mu::value_type cnt(const VectorIndex &_vLine)
This member function counts the number of valid cluster items in memory. Cluster items of any type ar...
std::vector< ClusterItem * > vClusterArray
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.
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 typ...
mu::value_type num(const VectorIndex &_vLine)
This member function counts the number of valid cluster items in memory. Cluster items of any type ar...
Cluster(const std::vector< std::string > &vStrings)
mu::value_type xor_func(const VectorIndex &_vLine)
This member function applies an "exclusive OR" to the data in memory. Cluster items,...
Cluster & operator=(const Cluster &cluster)
mu::value_type avg(const VectorIndex &_vLine)
This member function calculates the average of the data in memory. Cluster items, which do not have t...
Cluster(const std::vector< mu::value_type > &vVals)
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 clus...
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 func...
std::string getVectorRepresentation() const
This member function constructs a plain vector from the data in memory, which can be inserted in the ...
mu::value_type max(const VectorIndex &_vLine)
This member function calculates the maximal value of the data in memory. Cluster items,...
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.
bool isMixed() const
This member function returns, whether the data in the cluster have mixed type.
void reduceSize(size_t z)
Reduces the size of this cluster to the specified number of elements. Does not create anything,...
virtual bool isValue(int line, int col) override
This private member function is an override for the sorter object.
mu::value_type std(const VectorIndex &_vLine)
This member function calculates the standard deviation of the data in memory. Cluster items,...
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,...
void assign(const Cluster &cluster)
Private cluster copy assignment function.
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.
std::string getInternalString(size_t i) const
This member function returns the data of the i-th cluster item in memory as a string.
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...
mu::value_type norm(const VectorIndex &_vLine)
This member function calculates the euclidic vector norm of the data in memory. Cluster items,...
std::string strsum(const VectorIndex &_vLine)
This member function calculates the string concatenation of the data in memory. Cluster items of all ...
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.
virtual int compare(int i, int j, int col) override
This private member function is an override for the sorter object.
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 v...
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 t...
std::vector< mu::value_type > getDoubleArray() const
This member function returns the data of all cluster items memory as a value vector.
Cluster & operator=(const std::vector< mu::value_type > &vVals)
void pop_back()
This member function removes the last item in the internal memory buffer and frees the associated mem...
mu::value_type prd(const VectorIndex &_vLine)
This member function calculates the product of the data in memory. Cluster items, which do not have t...
size_t getBytes() const
This member function returns the size of the associated memory as bytes.
std::string strmin(const VectorIndex &_vLine)
This member function calculates the minimal string value of the data in memory. Cluster items of all ...
std::string getShortVectorRepresentation(size_t maxStringLength) const
This member function constructs a short version of a plain vector from the data in memory,...
bool isDouble() const
This member function returns, whether the data in the cluster have only double as type.
unsigned short getType(size_t i) const
This member function returns the type of the i-th cluster item in the internal memory buffer.
std::string strmax(const VectorIndex &_vLine)
This member function calculates the maximal string value of the data in memory. Cluster items of all ...
std::vector< std::string > getStringArray() const
This member function returns the data of all cluster items memory as a value vector.
void deleteItems(long long int i1, long long int i2)
This public member function erases elements located from the index i1 to i2.
This is an abstract cluster item. It is used as root class of any cluster items and only contains the...
virtual std::string getParserString()
Base implementation. Returns a string with quotation marks.
virtual void setString(const std::string &strval)
Base implementation. Does nothing.
virtual void setDouble(const mu::value_type &val)
Base implementation. Does nothing.
virtual std::string getString()
Base implementation. Always returns an empty string.
unsigned short getType() const
Returns the ClusterItemType.
virtual std::string getInternalString()
Base implementation. Returns an empty string.
virtual mu::value_type getDouble()
Base implementation. Returns always NaN.
ClusterItem(unsigned short type)
ClusterItemType
Defines the available types of clusters.
This class is the management class for the different clusters, which are currently available in memor...
bool containsClusters(const std::string &sCmdLine) const
This member function detects, whether any cluster is used in the current expression.
void appendCluster(const std::string &sCluster, const Cluster &cluster)
This member function appends the passed cluster to the internal cluster map using the passed string a...
void removeTemporaryClusters()
This member function returns all temporary clusters from the internal map. Temporary clusters are ind...
mu::value_type dClusterElementsCount
void removeCluster(const std::string &sCluster)
This member function removes the cluster from memory, which corresponds to the passed cluster identif...
Cluster & getCluster(StringView sCluster)
This member function returns a reference to the cluster indicated by the passed cluster identifier.
bool updateClusterSizeVariables(StringView sCluster)
This member function updates the dimension variable reserved for cluster accesses with the size of th...
Cluster & newCluster(const std::string &sCluster)
This member function creates a new cluster from the passed cluster identifier and returns a reference...
std::map< std::string, Cluster > mClusterMap
bool isCluster(StringView sCluster) const
This member function returns true, if the passed cluster identifier can be found in the internal map.
std::string validateClusterName(const std::string &sCluster)
This member function creates a valid cluster identifier name, which can be used to create or append a...
std::map< std::string, Cluster >::iterator mapStringViewFind(StringView view)
This private member function returns an iterator to the referenced cluster or std::map::end().
std::string createTemporaryCluster(const std::string &suffix="")
This member function creates a temporary cluster with a unique name and returns this name to the call...
const std::map< std::string, Cluster > & getClusterMap() const
void clearAllClusters()
Clear all clusters currently in memory.
This is a cluster item, which contains a string. It features conversions to and from doubles on-the-f...
virtual void setDouble(const mu::value_type &val) override
Overwrites the internal string with the passed value, which will be converted to a string first.
virtual std::string getString() override
Returns the internal string.
ClusterStringItem(const std::string &strval)
virtual mu::value_type getDouble() override
Returns the internal string converted to a value.
virtual ~ClusterStringItem() override
virtual void setString(const std::string &strval) override
Overwrites the internal string.
virtual std::string getInternalString() override
Returns the internal string.
Abstract parent class to implement the sorting functionality (using Quicksort) on a more generic leve...
This class is the immutable (const) version of a string view. It can be constructed from a MutableStr...
This class abstracts all the index logics, i.e. the logical differences between single indices and in...
CONSTCD11 std::chrono::duration< Rep, Period > abs(std::chrono::duration< Rep, Period > d)
MUP_BASETYPE value_type
The numeric datatype used by the parser.
bool isnan(const value_type &v)
This structure is central for managing the indices of a table or cluster read or write data access....
std::string toString(int)
Converts an integer to a string without the Settings bloat.