25#include "../maths/filtering.hpp"
106 virtual int compare(
int i,
int j,
int col)
override;
107 virtual bool isValue(
int line,
int col)
override;
126 int getLines(
bool _bFull =
false)
const;
129 int getCols(
bool _bFull =
false)
const;
157 void writeData(
int _nLine,
int _nCol,
const std::string& sValue);
165 bool save(std::string _sFileName,
const std::string& sTableName,
unsigned short nPrecision);
169 std::vector<int>
sortElements(
int i1,
int i2,
int j1 = 0,
int j2 = 0,
const std::string& sSortingExpression =
"");
191 std::vector<mu::value_type>
size(
const VectorIndex& _vIndex,
int dir)
const;
194 std::vector<mu::value_type>
findCols(
const std::vector<std::string>& vColNames)
const;
195 std::vector<mu::value_type>
countIfEqual(
const VectorIndex& _vCols,
const std::vector<mu::value_type>& vValues,
const std::vector<std::string>& vStringValues)
const;
196 std::vector<mu::value_type>
getIndex(
size_t col,
const std::vector<mu::value_type>& vValues,
const std::vector<std::string>& vStringValues)
const;
203 std::vector<mu::value_type>
getBins(
size_t col,
size_t nBins)
const;
This class defines a dynamic size 2D matrix with a single 1D internal buffer. If the internal buffer ...
This class represents a single table in memory, or a - so to say - single memory page to be handled b...
void writeDataDirect(int _nLine, int _nCol, const mu::value_type &_dData)
This member function provides an unsafe but direct way of writing data to the table....
ValueVector readMixedMem(const VectorIndex &_vLine, const VectorIndex &_vCol) const
This member function returns the elements stored at the selected positions.
std::vector< mu::value_type > size(const VectorIndex &_vIndex, int dir) const
Implementation of the SIZE multi argument function.
size_t getHeadlineCount() const
This member function returns the number of lines needed for the table column headline of the selected...
~Memory()
Memory class destructor, which will free the allocated memory.
NumeRe::Table extractTable(const std::string &_sTable, const VectorIndex &lines, const VectorIndex &cols)
Create a copy-efficient table object from the data contents.
bool getSaveStatus() const
Returns, whether the contents of the current table are already saved into either a usual file or into...
bool retouch(VectorIndex _vLine, VectorIndex _vCol, AppDir Direction=ALL)
This method is the retouching main method. It will redirect the control into the specialized member f...
std::vector< mu::value_type > getBins(size_t col, size_t nBins) const
Calculate the number of elements per bin in the selected column.
std::vector< mu::value_type > countIfEqual(const VectorIndex &_vCols, const std::vector< mu::value_type > &vValues, const std::vector< std::string > &vStringValues) const
Counts all values in the selected columns, which match to the passed values (either numerically or st...
int getFilledElemsInColumn(size_t col) const
Returns the number of filled elements in the selected column without the trailing but with the intern...
mu::value_type num(const VectorIndex &_vLine, const VectorIndex &_vCol) const
Implementation for the NUM multi argument function.
bool retouch1D(const VectorIndex &_vLine, const VectorIndex &_vCol, AppDir Direction)
This member function retouches single dimension data (along columns or rows).
void writeComment(const std::string &comment)
Update the comment associated with this table.
mu::value_type readMemInterpolated(double _dLine, double _dCol) const
This member function returns a (bilinearily) interpolated element at the selected double positions.
std::string getComment() const
Return the comment associated with this table.
mu::value_type sum(const VectorIndex &_vLine, const VectorIndex &_vCol) const
Implementation for the SUM multi argument function.
int getLines(bool _bFull=false) const
This member function will return the number of lines, which are currently available in this table.
bool convertColumns(const VectorIndex &_vCol, const std::string &_sType)
This member function tries to convert the selected columns to the target column type,...
mu::value_type xor_func(const VectorIndex &_vLine, const VectorIndex &_vCol) const
Implementation for the XOR multi argument function.
NumeRe::TableMetaData getMetaData() const
Return the internal meta data structure.
mu::value_type std(const VectorIndex &_vLine, const VectorIndex &_vCol) const
Implementation for the STD multi argument function.
void markModified()
Mark this table as modified.
int getCols(bool _bFull=false) const
This member function will return the number of columns, which are currently available in this table.
TableColumnArray memArray
bool isValid() const
Returns true, if at least a single valid value is available in this table.
std::vector< mu::value_type > getZScore(size_t col, const VectorIndex &_vIndex) const
Calculate the standardized values of the selected column.
mu::value_type norm(const VectorIndex &_vLine, const VectorIndex &_vCol) const
Implementation for the NORM multi argument function.
mu::value_type min(const VectorIndex &_vLine, const VectorIndex &_vCol) const
Implementation for the MIN multi argument function.
mu::value_type cmp(const VectorIndex &_vLine, const VectorIndex &_vCol, mu::value_type dRef=0.0, int _nType=0) const
Implementation for the CMP multi argument function.
Memory()
Default constructor.
void writeData(int _nLine, int _nCol, const mu::value_type &_dData)
This member function writes the passed value to the selected position. The table is automatically enl...
mu::value_type pct(const VectorIndex &_vLine, const VectorIndex &_vCol, mu::value_type dPct=0.5) const
Implementation for the PCT multi argument function.
bool retouch2D(const VectorIndex &_vLine, const VectorIndex &_vCol)
This member function retouches two dimensional data (using a specialized filter class instance).
virtual bool isValue(int line, int col) override
Override for the virtual Sorter class member function. Returns true, if the selected element is a val...
size_t getSize() const
Returns the overall used number of bytes for this table.
mu::value_type prd(const VectorIndex &_vLine, const VectorIndex &_vCol) const
Implementation for the PRD multi argument function.
void importTable(NumeRe::Table _table, const VectorIndex &lines, const VectorIndex &cols)
Import data from a copy-efficient table object. Completely replaces the contents, which were in the i...
long long int getLastSaved() const
This member function returns the time- point, where the table was saved last time.
bool isValidElement(size_t _nLine, size_t _nCol) const
Returns true, if the element at the selected positions is valid. Only checks internally,...
void writeDataDirectUnsafe(int _nLine, int _nCol, const mu::value_type &_dData)
This member function provides an even more unsafe but direct way of writing data to the table....
void reorderColumn(const VectorIndex &vIndex, int i1, int i2, int j1=0)
This member function simply reorders the contents of the selected column using the passed index vecto...
bool clear()
This member function frees the internally used memory block completely.
mu::value_type readMem(size_t _nLine, size_t _nCol) const
This member function returns the element stored at the selected position.
Boundary findValidBoundary(const VectorIndex &_vLine, const VectorIndex &_vCol, int i, int j) const
This member function finds the smallest possible boundary around a set of invalid values to be used a...
mu::value_type avg(const VectorIndex &_vLine, const VectorIndex &_vCol) const
Implementation for the AVG multi argument function.
Matrix readMemAsMatrix(const VectorIndex &_vLine, const VectorIndex &_vCol) const
This member function returns the elements stored at the selected positions as a Matrix.
mu::value_type or_func(const VectorIndex &_vLine, const VectorIndex &_vCol) const
Implementation for the OR multi argument function.
std::vector< mu::value_type > minpos(const VectorIndex &_vIndex, int dir) const
Implementation of the MINPOS multi argument function.
void setSaveStatus(bool _bIsSaved)
This member function changes the saved state to the passed value.
mu::value_type getSpearmanCorr(size_t col1, const VectorIndex &_vIndex1, size_t col2, const VectorIndex &_vIndex2) const
Implements the scorr() table method and calculates the spearman correlation coefficient of the two se...
AnovaResult getOneWayAnova(size_t colCategories, size_t colValues, const VectorIndex &_vIndex, double significance) const
Calculates the simples form of a ANOVA F test.
bool smooth(VectorIndex _vLine, VectorIndex _vCol, NumeRe::FilterSettings _settings, AppDir Direction=ALL)
This member function smoothes the data described by the passed VectorIndex indices using the passed F...
mu::value_type getCovariance(size_t col1, const VectorIndex &_vIndex1, size_t col2, const VectorIndex &_vIndex2) const
Implements the cov() table method and calculates the covariance of the two selected columns.
bool onlyValidValues(const VectorIndex &_vLine, const VectorIndex &_vCol) const
This method is a wrapper for detecting, whether a row or column does only contain valid values (no Na...
void writeSingletonData(Indices &_idx, const mu::value_type &_dData)
This member function writes multiple copies of a single value to a range in the table....
std::vector< mu::value_type > maxpos(const VectorIndex &_vIndex, int dir) const
Implementation of the MAXPOS multi argument function.
std::vector< mu::value_type > getRank(size_t col, const VectorIndex &_vIndex, RankingStrategy _strat) const
Rank the selected column according the selected ranking strategy.
mu::value_type med(const VectorIndex &_vLine, const VectorIndex &_vCol) const
Implementation for the MED multi argument function.
mu::value_type getPearsonCorr(size_t col1, const VectorIndex &_vIndex1, size_t col2, const VectorIndex &_vIndex2) const
Implements the pcorr() table method and calculates the pearson correlation coefficient of the two sel...
mu::value_type cnt(const VectorIndex &_vLine, const VectorIndex &_vCol) const
Implementation for the CNT multi argument function.
void copyElementsInto(std::vector< mu::value_type > *vTarget, const VectorIndex &_vLine, const VectorIndex &_vCol) const
This member function will copy the selected elements into the passed vector instance....
int getElemsInColumn(size_t col) const
Returns the number of elements in the selected column (but might contain invalid values).
TableColumn::ColumnType getType(const VectorIndex &_vCol) const
Returns the "common" type of the selected columns.
Memory & operator=(const Memory &other)
Assignment operator.
bool resizeMemory(size_t _nLines, size_t _nCols)
This member function will handle all memory grow operations by doubling the base size,...
size_t getAppendedZeroes(size_t _i) const
Returns the number of empty cells at the end of the selected columns.
virtual int compare(int i, int j, int col) override
Override for the virtual Sorter class member function. Returns 0, if both elements are equal,...
bool Allocate(size_t _nNCols, bool shrink=false)
This member function is the Memory class allocator. It will handle all memory allocations.
ValueVector getCategoryList(const VectorIndex &_vCol) const
Returns a key-value list containing the categories and their respective index.
void deleteEntry(int _nLine, int _nCol)
This member function deletes a single entry from the memory table.
std::vector< int > sortElements(int i1, int i2, int j1=0, int j2=0, const std::string &sSortingExpression="")
This member function is the interface function for the Sorter class. It will pre- evaluate the passed...
void smoothingWindow2D(const VectorIndex &_vLine, const VectorIndex &_vCol, size_t i, size_t j, NumeRe::Filter *_filter)
This private member function realizes the application of a smoothing window to 2D data sets.
mu::value_type max(const VectorIndex &_vLine, const VectorIndex &_vCol) const
Implementation for the MAX multi argument function.
mu::value_type and_func(const VectorIndex &_vLine, const VectorIndex &_vCol) const
Implementation for the AND multi argument function.
bool setCategories(const VectorIndex &_vCol, const std::vector< std::string > &vCategories)
Updates the categories of a categorical column and switches the column type if necessary.
void calculateStats(const VectorIndex &_vLine, const VectorIndex &_vCol, std::vector< StatsLogic > &operation) const
Driver code for simplifying the calculation of various stats using OpenMP, if possible.
bool shrink()
This member function shrinks the table memory to the smallest possible dimensions reachable in powers...
void setMetaData(const NumeRe::TableMetaData &meta)
Update the internal meta data with the passed one.
std::vector< mu::value_type > findCols(const std::vector< std::string > &vColNames) const
Finds the columns IDs, whose headlines match to the passed strings. Can return multiple column IDs pe...
Memory * extractRange(const VectorIndex &_vLine, const VectorIndex &_vCol) const
This member function extracts a range of this table and returns it as a new Memory instance.
ValueVector readMemAsString(const VectorIndex &_vLine, const VectorIndex &_vCol) const
This member function returns the elements stored at the selected positions.
NumeRe::TableMetaData m_meta
bool save(std::string _sFileName, const std::string &sTableName, unsigned short nPrecision)
This member function is used for saving the contents of this memory page into a file....
void createTableHeaders()
This member function creates the column headlines, if they are empty.
bool setHeadLineElement(size_t _i, const std::string &_sHead)
Writes a new table column headline to the selected column.
void convert()
This member function tries to convert all string columns to value columns, if it is possible.
bool bSortCaseInsensitive
bool resample(VectorIndex _vLine, VectorIndex _vCol, std::pair< size_t, size_t > samples, AppDir Direction=ALL, std::string sFilter="lanczos3")
This member function resamples the data described by the passed coordinates using the new samples nSa...
void smoothingWindow1D(const VectorIndex &_vLine, const VectorIndex &_vCol, size_t i, size_t j, NumeRe::Filter *_filter, bool smoothLines)
This private member function realizes the application of a smoothing window to 1D data sets.
std::vector< mu::value_type > getIndex(size_t col, const std::vector< mu::value_type > &vValues, const std::vector< std::string > &vStringValues) const
Determines the positions of all elements, which correspond to the passed values (either numerically o...
void deleteBulk(const VectorIndex &_vLine, const VectorIndex &_vCol)
This member function deletes a whole range of entries from the memory table.
std::string getHeadLineElement(size_t _i) const
Returns the table column headline for the selected column. Will return a default headline,...
This class represents the central memory managing instance. It will handle all tables and clusters,...
This class represents the file input and output adapter for the MemoryManager class,...
This is an abstract base class for any type of a data filter. Requires some methods to be implemented...
This data container is a copy- efficient table to interchange data between Kernel and GUI.
Abstract parent class to implement the sorting functionality (using Quicksort) on a more generic leve...
This class abstracts all the index logics, i.e. the logical differences between single indices and in...
std::vector< std::string > ValueVector
This type defines a generic value vector.
MUP_BASETYPE value_type
The numeric datatype used by the parser.
Contains the relevant results of the ANOVA F test.
mu::value_type m_significance
mu::value_type m_significanceVal
This structure contains the information of a two-dimensional boundary.
This structure is central for managing the indices of a table or cluster read or write data access....
This structure contains the necessary information to create an instance of one of the following filte...
Simplify the creation of some statistics by externalizing the operation code and unifying the driver ...
std::vector< TblColPtr > TableColumnArray
This typedef represents the actual table, which is implemented using a std::vector.