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

This class represents a single table in memory, or a - so to say - single memory page to be handled by the MemoryManager class instance. More...

#include <memory.hpp>

Inheritance diagram for Memory:
Collaboration diagram for Memory:

Public Types

enum  AppDir { ALL = 0x0 , LINES = 0x1 , COLS = 0x2 , GRID = 0x4 }
 
enum  RankingStrategy { RANK_DENSE , RANK_COMPETETIVE , RANK_FRACTIONAL }
 

Public Member Functions

 Memory ()
 Default constructor. More...
 
 Memory (size_t _nCols)
 Specialized constructor to allocate a defined table size. More...
 
 ~Memory ()
 Memory class destructor, which will free the allocated memory. More...
 
Memoryoperator= (const Memory &other)
 Assignment operator. More...
 
bool resizeMemory (size_t _nLines, size_t _nCols)
 This member function will handle all memory grow operations by doubling the base size, which shall be incremented, as long as it is smaller than the requested size. More...
 
bool isValid () const
 Returns true, if at least a single valid value is available in this table. More...
 
bool isValidElement (size_t _nLine, size_t _nCol) const
 Returns true, if the element at the selected positions is valid. Only checks internally, if the value is not a NaN value. More...
 
bool shrink ()
 This member function shrinks the table memory to the smallest possible dimensions reachable in powers of two. More...
 
void convert ()
 This member function tries to convert all string columns to value columns, if it is possible. More...
 
bool convertColumns (const VectorIndex &_vCol, const std::string &_sType)
 This member function tries to convert the selected columns to the target column type, if it is possible. More...
 
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. More...
 
int getLines (bool _bFull=false) const
 This member function will return the number of lines, which are currently available in this table. More...
 
int getElemsInColumn (size_t col) const
 Returns the number of elements in the selected column (but might contain invalid values). More...
 
int getFilledElemsInColumn (size_t col) const
 Returns the number of filled elements in the selected column without the trailing but with the internal invalid values. More...
 
int getCols (bool _bFull=false) const
 This member function will return the number of columns, which are currently available in this table. More...
 
size_t getSize () const
 Returns the overall used number of bytes for this table. More...
 
mu::value_type readMem (size_t _nLine, size_t _nCol) const
 This member function returns the element stored at the selected position. More...
 
mu::value_type readMemInterpolated (double _dLine, double _dCol) const
 This member function returns a (bilinearily) interpolated element at the selected double positions. More...
 
std::vector< mu::value_typereadMem (const VectorIndex &_vLine, const VectorIndex &_vCol) const
 This member function returns the elements stored at the selected positions. More...
 
Matrix readMemAsMatrix (const VectorIndex &_vLine, const VectorIndex &_vCol) const
 This member function returns the elements stored at the selected positions as a Matrix. More...
 
ValueVector readMixedMem (const VectorIndex &_vLine, const VectorIndex &_vCol) const
 This member function returns the elements stored at the selected positions. More...
 
ValueVector readMemAsString (const VectorIndex &_vLine, const VectorIndex &_vCol) const
 This member function returns the elements stored at the selected positions. More...
 
TableColumn::ColumnType getType (const VectorIndex &_vCol) const
 Returns the "common" type of the selected columns. More...
 
ValueVector getCategoryList (const VectorIndex &_vCol) const
 Returns a key-value list containing the categories and their respective index. More...
 
MemoryextractRange (const VectorIndex &_vLine, const VectorIndex &_vCol) const
 This member function extracts a range of this table and returns it as a new Memory instance. More...
 
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. This member function avoids copies of the vector instance by directly writing to the target instance. More...
 
std::string getHeadLineElement (size_t _i) const
 Returns the table column headline for the selected column. Will return a default headline, if the column is empty or does not exist. More...
 
std::vector< std::string > getHeadLineElement (const VectorIndex &_vCol) const
 Returns the table column headlines for the selected columns. Will return default headlines for empty or non-existing columns. More...
 
size_t getAppendedZeroes (size_t _i) const
 Returns the number of empty cells at the end of the selected columns. More...
 
size_t getHeadlineCount () const
 This member function returns the number of lines needed for the table column headline of the selected column. More...
 
std::string getComment () const
 Return the comment associated with this table. More...
 
NumeRe::TableMetaData getMetaData () const
 Return the internal meta data structure. More...
 
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. The table is automatically enlarged, if necessary. More...
 
void writeSingletonData (Indices &_idx, const std::string &_sValue)
 This member function writes multiple copies of a single string to a range in the table. The table is automatically enlarged, if necessary. More...
 
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 enlarged, if necessary. More...
 
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. It will not check for the existence of the needed amount of columns. More...
 
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. It will neither check for existence of the internal pointer nor for the existence of the needed amount of columns. Use this only, if real pre-allocation is possible. More...
 
void writeData (int _nLine, int _nCol, const std::string &sValue)
 Writes string data to the internal table. More...
 
void writeData (Indices &_idx, mu::value_type *_dData, unsigned int _nNum)
 This member function writes a whole array of data to the selected table range. The table is automatically enlarged, if necessary. More...
 
void writeData (Indices &_idx, const ValueVector &_values)
 This member function writes a whole array of values to the selected table range. The table is automatically enlarged, if necessary. More...
 
bool setHeadLineElement (size_t _i, const std::string &_sHead)
 Writes a new table column headline to the selected column. More...
 
void writeComment (const std::string &comment)
 Update the comment associated with this table. More...
 
void setMetaData (const NumeRe::TableMetaData &meta)
 Update the internal meta data with the passed one. More...
 
void markModified ()
 Mark this table as modified. More...
 
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. The type of the file is selected by the name of the file. More...
 
bool getSaveStatus () const
 Returns, whether the contents of the current table are already saved into either a usual file or into the cache file. More...
 
void setSaveStatus (bool _bIsSaved)
 This member function changes the saved state to the passed value. More...
 
long long int getLastSaved () const
 This member function returns the time- point, where the table was saved last time. More...
 
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 parameters and redirect the control to the corresponding sorting function. More...
 
void deleteEntry (int _nLine, int _nCol)
 This member function deletes a single entry from the memory table. More...
 
void deleteBulk (const VectorIndex &_vLine, const VectorIndex &_vCol)
 This member function deletes a whole range of entries from the memory table. More...
 
NumeRe::Table extractTable (const std::string &_sTable, const VectorIndex &lines, const VectorIndex &cols)
 Create a copy-efficient table object from the data contents. More...
 
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 internal storage before. More...
 
mu::value_type std (const VectorIndex &_vLine, const VectorIndex &_vCol) const
 Implementation for the STD multi argument function. More...
 
mu::value_type avg (const VectorIndex &_vLine, const VectorIndex &_vCol) const
 Implementation for the AVG multi argument function. More...
 
mu::value_type max (const VectorIndex &_vLine, const VectorIndex &_vCol) const
 Implementation for the MAX multi argument function. More...
 
mu::value_type min (const VectorIndex &_vLine, const VectorIndex &_vCol) const
 Implementation for the MIN multi argument function. More...
 
mu::value_type prd (const VectorIndex &_vLine, const VectorIndex &_vCol) const
 Implementation for the PRD multi argument function. More...
 
mu::value_type sum (const VectorIndex &_vLine, const VectorIndex &_vCol) const
 Implementation for the SUM multi argument function. More...
 
mu::value_type num (const VectorIndex &_vLine, const VectorIndex &_vCol) const
 Implementation for the NUM multi argument function. More...
 
mu::value_type and_func (const VectorIndex &_vLine, const VectorIndex &_vCol) const
 Implementation for the AND multi argument function. More...
 
mu::value_type or_func (const VectorIndex &_vLine, const VectorIndex &_vCol) const
 Implementation for the OR multi argument function. More...
 
mu::value_type xor_func (const VectorIndex &_vLine, const VectorIndex &_vCol) const
 Implementation for the XOR multi argument function. More...
 
mu::value_type cnt (const VectorIndex &_vLine, const VectorIndex &_vCol) const
 Implementation for the CNT multi argument function. More...
 
mu::value_type norm (const VectorIndex &_vLine, const VectorIndex &_vCol) const
 Implementation for the NORM multi argument function. More...
 
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. More...
 
mu::value_type med (const VectorIndex &_vLine, const VectorIndex &_vCol) const
 Implementation for the MED multi argument function. More...
 
mu::value_type pct (const VectorIndex &_vLine, const VectorIndex &_vCol, mu::value_type dPct=0.5) const
 Implementation for the PCT multi argument function. More...
 
std::vector< mu::value_typesize (const VectorIndex &_vIndex, int dir) const
 Implementation of the SIZE multi argument function. More...
 
std::vector< mu::value_typeminpos (const VectorIndex &_vIndex, int dir) const
 Implementation of the MINPOS multi argument function. More...
 
std::vector< mu::value_typemaxpos (const VectorIndex &_vIndex, int dir) const
 Implementation of the MAXPOS multi argument function. More...
 
std::vector< mu::value_typefindCols (const std::vector< std::string > &vColNames) const
 Finds the columns IDs, whose headlines match to the passed strings. Can return multiple column IDs per string. More...
 
std::vector< mu::value_typecountIfEqual (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 string values) and returns the corresponding sums. More...
 
std::vector< mu::value_typegetIndex (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 or string values), and returns them as an index. More...
 
AnovaResult getOneWayAnova (size_t colCategories, size_t colValues, const VectorIndex &_vIndex, double significance) const
 Calculates the simples form of a ANOVA F test. More...
 
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. More...
 
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 selected columns. More...
 
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 selected columns. More...
 
std::vector< mu::value_typegetRank (size_t col, const VectorIndex &_vIndex, RankingStrategy _strat) const
 Rank the selected column according the selected ranking strategy. More...
 
std::vector< mu::value_typegetZScore (size_t col, const VectorIndex &_vIndex) const
 Calculate the standardized values of the selected column. More...
 
std::vector< mu::value_typegetBins (size_t col, size_t nBins) const
 Calculate the number of elements per bin in the selected column. More...
 
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 FilterSettings to construct the corresponding filter. More...
 
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 functions. More...
 
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 nSamples. 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

bool Allocate (size_t _nNCols, bool shrink=false)
 This member function is the Memory class allocator. It will handle all memory allocations. More...
 
void createTableHeaders ()
 This member function creates the column headlines, if they are empty. More...
 
bool clear ()
 This member function frees the internally used memory block completely. More...
 
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 as boundary values for retouching the values. More...
 
bool retouch1D (const VectorIndex &_vLine, const VectorIndex &_vCol, AppDir Direction)
 This member function retouches single dimension data (along columns or rows). More...
 
bool retouch2D (const VectorIndex &_vLine, const VectorIndex &_vCol)
 This member function retouches two dimensional data (using a specialized filter class instance). More...
 
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 NaNs). More...
 
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 vector. More...
 
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, -1 if element i is smaller than element j and 1 otherwise. More...
 
virtual bool isValue (int line, int col) override
 Override for the virtual Sorter class member function. Returns true, if the selected element is a valid value. More...
 
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. More...
 
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. More...
 
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. More...
 

Private Attributes

TableColumnArray memArray
 
NumeRe::TableMetaData m_meta
 
int nCalcLines
 
bool bSaveMutex
 
bool bSortCaseInsensitive
 

Friends

class MemoryManager
 
class NumeRe::FileAdapter
 

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 single table in memory, or a - so to say - single memory page to be handled by the MemoryManager class instance.

Definition at line 67 of file memory.hpp.

Member Enumeration Documentation

◆ AppDir

Enumerator
ALL 
LINES 
COLS 
GRID 

Definition at line 70 of file memory.hpp.

◆ RankingStrategy

Enumerator
RANK_DENSE 
RANK_COMPETETIVE 
RANK_FRACTIONAL 

Definition at line 78 of file memory.hpp.

Constructor & Destructor Documentation

◆ Memory() [1/2]

Memory::Memory ( )

Default constructor.

Definition at line 48 of file memory.cpp.

References bSaveMutex, m_meta, nCalcLines, and NumeRe::TableMetaData::save().

Referenced by extractRange().

Here is the call graph for this function:

◆ Memory() [2/2]

Memory::Memory ( size_t  _nCols)

Specialized constructor to allocate a defined table size.

Parameters
_nColssize_t

Definition at line 63 of file memory.cpp.

References Allocate().

Here is the call graph for this function:

◆ ~Memory()

Memory::~Memory ( )

Memory class destructor, which will free the allocated memory.

Definition at line 73 of file memory.cpp.

References clear().

Here is the call graph for this function:

Member Function Documentation

◆ Allocate()

bool Memory::Allocate ( size_t  _nNCols,
bool  shrink = false 
)
private

This member function is the Memory class allocator. It will handle all memory allocations.

Parameters
_nNColssize_t
shrinkbool
Returns
bool

Definition at line 89 of file memory.cpp.

References SyntaxError::invalid_position, max, MAX_TABLE_COLS, memArray, shrink(), and SyntaxError::TOO_LARGE_CACHE.

Referenced by extractRange(), Memory(), and resizeMemory().

Here is the call graph for this function:

◆ and_func()

mu::value_type Memory::and_func ( const VectorIndex _vLine,
const VectorIndex _vCol 
) const

Implementation for the AND multi argument function.

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

Definition at line 2334 of file memory.cpp.

References getCols(), getElemsInColumn(), getLines(), VectorIndex::isExpanded(), mu::isnan(), VectorIndex::isOrdered(), memArray, VectorIndex::setOpenEndIndex(), and VectorIndex::size().

Here is the call graph for this function:

◆ avg()

mu::value_type Memory::avg ( const VectorIndex _vLine,
const VectorIndex _vCol 
) const

Implementation for the AVG multi argument function.

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

Definition at line 2132 of file memory.cpp.

References memArray, num(), and sum().

Referenced by getCovariance(), getOneWayAnova(), getZScore(), and std().

Here is the call graph for this function:

◆ calculateStats()

void Memory::calculateStats ( const VectorIndex _vLine,
const VectorIndex _vCol,
std::vector< StatsLogic > &  operation 
) const
private

Driver code for simplifying the calculation of various stats using OpenMP, if possible.

Parameters
_vLineconst VectorIndex&
_vColconst VectorIndex&
operationstd::vector<StatsLogic>&
Returns
void

Definition at line 2021 of file memory.cpp.

References getElemsInColumn(), VectorIndex::isExpanded(), VectorIndex::isOrdered(), readMem(), and VectorIndex::size().

Referenced by max(), min(), norm(), prd(), std(), and sum().

Here is the call graph for this function:

◆ clear()

bool Memory::clear ( )
private

This member function frees the internally used memory block completely.

Returns
bool

Definition at line 141 of file memory.cpp.

References bSaveMutex, m_meta, memArray, NumeRe::TableMetaData::modify(), and nCalcLines.

Referenced by operator=(), and ~Memory().

Here is the call graph for this function:

◆ cmp()

mu::value_type Memory::cmp ( const VectorIndex _vLine,
const VectorIndex _vCol,
mu::value_type  dRef = 0.0,
int  _nType = 0 
) const

Implementation for the CMP multi argument function.

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

Definition at line 2587 of file memory.cpp.

References getCols(), getElemsInColumn(), getLines(), intCast(), VectorIndex::isExpanded(), mu::isnan(), VectorIndex::isOrdered(), memArray, readMem(), VectorIndex::setOpenEndIndex(), and VectorIndex::size().

Referenced by maxpos(), and minpos().

Here is the call graph for this function:

◆ cnt()

mu::value_type Memory::cnt ( const VectorIndex _vLine,
const VectorIndex _vCol 
) const

Implementation for the CNT multi argument function.

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

Definition at line 2508 of file memory.cpp.

References getCols(), getElemsInColumn(), getLines(), memArray, VectorIndex::setOpenEndIndex(), and VectorIndex::size().

Referenced by onlyValidValues().

Here is the call graph for this function:

◆ compare()

int Memory::compare ( int  i,
int  j,
int  col 
)
overrideprivatevirtual

Override for the virtual Sorter class member function. Returns 0, if both elements are equal, -1 if element i is smaller than element j and 1 otherwise.

Parameters
iint
jint
colint
Returns
int

Implements Sorter.

Definition at line 1767 of file memory.cpp.

References bSortCaseInsensitive, and memArray.

◆ convert()

void Memory::convert ( )

This member function tries to convert all string columns to value columns, if it is possible.

Returns
void

Definition at line 888 of file memory.cpp.

References url::get(), memArray, and TableColumn::TYPE_STRING.

Referenced by importTable(), and NumeRe::FileAdapter::openFile().

Here is the call graph for this function:

◆ convertColumns()

bool Memory::convertColumns ( const VectorIndex _vCol,
const std::string &  _sType 
)

This member function tries to convert the selected columns to the target column type, if it is possible.

Parameters
_vColconst VectorIndex&
_sTypeconst std::string&
Returns
bool

Definition at line 916 of file memory.cpp.

References url::get(), m_meta, memArray, NumeRe::TableMetaData::modify(), VectorIndex::setOpenEndIndex(), VectorIndex::size(), TableColumn::stringToType(), and TableColumn::TYPE_NONE.

Here is the call graph for this function:

◆ copyElementsInto()

void Memory::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. This member function avoids copies of the vector instance by directly writing to the target instance.

Parameters
vTargetvector<mu::value_type>*
_vLineconst VectorIndex&
_vColconst VectorIndex&
Returns
void

Definition at line 768 of file memory.cpp.

References getElemsInColumn(), VectorIndex::isExpanded(), VectorIndex::isOrdered(), memArray, and VectorIndex::size().

Here is the call graph for this function:

◆ countIfEqual()

std::vector< mu::value_type > Memory::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 string values) and returns the corresponding sums.

Parameters
_vColsconst VectorIndex&
vValuesconst std::vector<mu::value_type>&
vStringValuesconst std::vector<std::string>&
Returns
std::vector<mu::value_type>

Definition at line 3172 of file memory.cpp.

References closeEnough(), memArray, and VectorIndex::size().

Here is the call graph for this function:

◆ createTableHeaders()

void Memory::createTableHeaders ( )
private

This member function creates the column headlines, if they are empty.

Returns
void

Definition at line 121 of file memory.cpp.

References DEFAULT_COL_TYPE, TableColumn::getDefaultColumnHead(), and memArray.

Referenced by NumeRe::FileAdapter::openFile().

Here is the call graph for this function:

◆ deleteBulk()

void Memory::deleteBulk ( const VectorIndex _vLine,
const VectorIndex _vCol 
)

This member function deletes a whole range of entries from the memory table.

Parameters
_vLineconst VectorIndex&
_vColconst VectorIndex&
Returns
void

Definition at line 1982 of file memory.cpp.

References getCols(), getLines(), m_meta, memArray, VectorIndex::min(), NumeRe::TableMetaData::modify(), nCalcLines, VectorIndex::setOpenEndIndex(), shrink(), and VectorIndex::size().

Referenced by importTable(), and resample().

Here is the call graph for this function:

◆ deleteEntry()

void Memory::deleteEntry ( int  _nLine,
int  _nCol 
)

This member function deletes a single entry from the memory table.

Parameters
_nLineint
_nColint
Returns
void

Definition at line 1952 of file memory.cpp.

References isValid(), m_meta, memArray, NumeRe::TableMetaData::modify(), nCalcLines, and size().

Here is the call graph for this function:

◆ extractRange()

Memory * 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.

Parameters
_vLineconst VectorIndex&
_vColconst VectorIndex&
Returns
Memory*
Remarks
The caller gets ownership of the returned Memory instance.

Definition at line 723 of file memory.cpp.

References Allocate(), getCols(), getLines(), m_meta, memArray, Memory(), VectorIndex::setOpenEndIndex(), and VectorIndex::size().

Referenced by copyDataToTemporaryTable(), extractRange(), and rotateTable().

Here is the call graph for this function:

◆ extractTable()

NumeRe::Table Memory::extractTable ( const std::string &  _sTable,
const VectorIndex lines,
const VectorIndex cols 
)

Create a copy-efficient table object from the data contents.

Parameters
_sTableconst string&
Returns
NumeRe::Table

Definition at line 1803 of file memory.cpp.

References getCols(), getLines(), m_meta, memArray, NumeRe::Table::setColumn(), NumeRe::Table::setMetaData(), NumeRe::Table::setName(), VectorIndex::setOpenEndIndex(), and VectorIndex::size().

Here is the call graph for this function:

◆ findCols()

std::vector< mu::value_type > Memory::findCols ( const std::vector< std::string > &  vColNames) const

Finds the columns IDs, whose headlines match to the passed strings. Can return multiple column IDs per string.

Parameters
vColNamesconst std::vector<std::string>&
Returns
std::vector<mu::value_type>

Definition at line 3140 of file memory.cpp.

References memArray.

◆ findValidBoundary()

Boundary Memory::findValidBoundary ( const VectorIndex _vLine,
const VectorIndex _vCol,
int  i,
int  j 
) const
private

This member function finds the smallest possible boundary around a set of invalid values to be used as boundary values for retouching the values.

Parameters
_vLineconst VectorIndex&
_vColconst VectorIndex&
iint
jint
Returns
RetouchBoundary

Definition at line 3949 of file memory.cpp.

References Boundary::ce(), Boundary::cf(), Boundary::cols, VectorIndex::front(), VectorIndex::last(), Boundary::m, Boundary::n, onlyValidValues(), Boundary::re(), Boundary::rf(), and Boundary::rows.

Referenced by retouch2D().

Here is the call graph for this function:

◆ getAppendedZeroes()

size_t Memory::getAppendedZeroes ( size_t  _i) const

Returns the number of empty cells at the end of the selected columns.

Parameters
_isize_t
Returns
size_t

Definition at line 1136 of file memory.cpp.

References getLines(), and memArray.

Here is the call graph for this function:

◆ getBins()

std::vector< mu::value_type > Memory::getBins ( size_t  col,
size_t  nBins 
) const

Calculate the number of elements per bin in the selected column.

Parameters
colsize_t
nBinssize_t
Returns
std::vector<mu::value_type>

Definition at line 3602 of file memory.cpp.

References mu::isnan(), max(), memArray, min, min(), num(), VectorIndex::OPEN_END, mu::real(), mu::rint(), CategoricalColumn::size(), size(), TableColumn::TYPE_CATEGORICAL, TableColumn::TYPE_LOGICAL, and TableColumn::TYPE_STRING.

Here is the call graph for this function:

◆ getCategoryList()

ValueVector Memory::getCategoryList ( const VectorIndex _vCol) const

Returns a key-value list containing the categories and their respective index.

Parameters
_vColconst VectorIndex&
Returns
ValueVector

Definition at line 685 of file memory.cpp.

References memArray, VectorIndex::size(), toString(), and TableColumn::TYPE_CATEGORICAL.

Here is the call graph for this function:

◆ getCols()

int Memory::getCols ( bool  _bFull = false) const

This member function will return the number of columns, which are currently available in this table.

Parameters
_bFullbool true, if the reserved number of columns is requested, false if only the non-empty ones are requested
Returns
int

Definition at line 241 of file memory.cpp.

References memArray.

Referenced by and_func(), cmp(), cnt(), deleteBulk(), extractRange(), extractRange(), extractTable(), MemoryManager::getColElements(), max(), maxpos(), med(), min(), minpos(), norm(), num(), or_func(), pct(), prd(), resample(), retouch(), rotateTable(), save(), size(), smooth(), sortElements(), std(), sum(), writeSingletonData(), and xor_func().

◆ getComment()

std::string Memory::getComment ( ) const

Return the comment associated with this table.

Returns
std::string

Definition at line 1189 of file memory.cpp.

References NumeRe::TableMetaData::comment, and m_meta.

◆ getCovariance()

mu::value_type Memory::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.

Parameters
col1size_t
_vIndex1const VectorIndex&
col2size_t
_vIndex2const VectorIndex&
Returns
mu::value_type

Definition at line 3380 of file memory.cpp.

References avg(), getElemsInColumn(), min, readMem(), VectorIndex::setOpenEndIndex(), VectorIndex::size(), and VectorIndex::subidx().

Referenced by getPearsonCorr().

Here is the call graph for this function:

◆ getElemsInColumn()

int Memory::getElemsInColumn ( size_t  col) const

Returns the number of elements in the selected column (but might contain invalid values).

Parameters
colsize_t
Returns
int

Definition at line 293 of file memory.cpp.

References memArray.

Referenced by and_func(), calculateStats(), cmp(), cnt(), copyElementsInto(), MemoryManager::getColElements(), getCovariance(), getOneWayAnova(), getPearsonCorr(), getRank(), getSpearmanCorr(), getZScore(), med(), num(), or_func(), pct(), readMem(), readMemAsString(), readMixedMem(), size(), and xor_func().

◆ getFilledElemsInColumn()

int Memory::getFilledElemsInColumn ( size_t  col) const

Returns the number of filled elements in the selected column without the trailing but with the internal invalid values.

Parameters
colsize_t
Returns
int

Definition at line 311 of file memory.cpp.

References memArray.

Referenced by size().

◆ getHeadlineCount()

size_t Memory::getHeadlineCount ( ) const

This member function returns the number of lines needed for the table column headline of the selected column.

Returns
size_t

Definition at line 1153 of file memory.cpp.

References memArray.

◆ getHeadLineElement() [1/2]

vector< string > Memory::getHeadLineElement ( const VectorIndex _vCol) const

Returns the table column headlines for the selected columns. Will return default headlines for empty or non-existing columns.

Parameters
_vColconst VectorIndex&
Returns
vector<string>

Definition at line 1043 of file memory.cpp.

References getHeadLineElement(), and VectorIndex::size().

Here is the call graph for this function:

◆ getHeadLineElement() [2/2]

std::string Memory::getHeadLineElement ( size_t  _i) const

Returns the table column headline for the selected column. Will return a default headline, if the column is empty or does not exist.

Parameters
_isize_t
Returns
std::string

Definition at line 1025 of file memory.cpp.

References TableColumn::getDefaultColumnHead(), and memArray.

Referenced by getHeadLineElement().

Here is the call graph for this function:

◆ getIndex()

std::vector< mu::value_type > Memory::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 or string values), and returns them as an index.

Parameters
colsize_t
vValuesconst std::vector<mu::value_type>&
vStringValuesconst std::vector<std::string>&
Returns
std::vector<mu::value_type>

Definition at line 3233 of file memory.cpp.

References closeEnough(), and memArray.

Referenced by getOneWayAnova().

Here is the call graph for this function:

◆ getLastSaved()

long long int Memory::getLastSaved ( ) const

This member function returns the time- point, where the table was saved last time.

Returns
long long int

Definition at line 1534 of file memory.cpp.

References NumeRe::TableMetaData::lastSavedTime, and m_meta.

◆ getLines()

int Memory::getLines ( bool  _bFull = false) const

This member function will return the number of lines, which are currently available in this table.

Parameters
_bFullbool true, if the reserved number of lines is requested, false if only the non-empty ones are requested
Returns
int

Definition at line 258 of file memory.cpp.

References memArray, and nCalcLines.

Referenced by and_func(), cmp(), cnt(), deleteBulk(), extractRange(), extractRange(), extractTable(), getAppendedZeroes(), getRank(), isValid(), max(), maxpos(), med(), min(), minpos(), norm(), num(), or_func(), pct(), prd(), resample(), retouch(), rotateTable(), save(), size(), smooth(), std(), sum(), writeSingletonData(), and xor_func().

◆ getMetaData()

NumeRe::TableMetaData Memory::getMetaData ( ) const

Return the internal meta data structure.

Returns
NumeRe::TableMetaData

Definition at line 1202 of file memory.cpp.

References m_meta.

Referenced by MemoryManager::melt().

◆ getOneWayAnova()

AnovaResult Memory::getOneWayAnova ( size_t  colCategories,
size_t  colValues,
const VectorIndex _vIndex,
double  significance 
) const

Calculates the simples form of a ANOVA F test.

Parameters
colCategoriessize_t
colValuessize_t
_vIndexconst VectorIndex&
significancedouble
Returns
AnovaResult

Definition at line 3288 of file memory.cpp.

References avg(), getElemsInColumn(), getIndex(), intPower(), mu::isnan(), AnovaResult::m_FRatio, AnovaResult::m_isSignificant, AnovaResult::m_numCategories, AnovaResult::m_significance, AnovaResult::m_significanceVal, memArray, num(), VectorIndex::OPEN_END, VectorIndex::setOpenEndIndex(), std(), and TableColumn::TYPE_CATEGORICAL.

Here is the call graph for this function:

◆ getPearsonCorr()

mu::value_type Memory::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 selected columns.

Parameters
col1size_t
_vIndex1const VectorIndex&
col2size_t
_vIndex2const VectorIndex&
Returns
mu::value_type

Definition at line 3413 of file memory.cpp.

References getCovariance(), getElemsInColumn(), min, VectorIndex::setOpenEndIndex(), VectorIndex::size(), std(), and VectorIndex::subidx().

Referenced by getSpearmanCorr().

Here is the call graph for this function:

◆ getRank()

std::vector< mu::value_type > Memory::getRank ( size_t  col,
const VectorIndex _vIndex,
Memory::RankingStrategy  _strat 
) const

Rank the selected column according the selected ranking strategy.

Parameters
colsize_t
_vIndexconst VectorIndex&
_stratMemory::RankingStrategy
Returns
std::vector<mu::value_type>

Definition at line 3501 of file memory.cpp.

References evaluateRankingStrategy(), getElemsInColumn(), getLines(), TableColumn::getValueAsInternalString(), mu::isnan(), memArray, readMem(), VectorIndex::setOpenEndIndex(), sortElements(), and TableColumn::TYPE_CATEGORICAL.

Referenced by getSpearmanCorr().

Here is the call graph for this function:

◆ getSaveStatus()

bool Memory::getSaveStatus ( ) const

Returns, whether the contents of the current table are already saved into either a usual file or into the cache file.

Returns
bool

Definition at line 1009 of file memory.cpp.

References NumeRe::TableMetaData::isSaved, and m_meta.

◆ getSize()

size_t Memory::getSize ( ) const

Returns the overall used number of bytes for this table.

Returns
size_t

Definition at line 327 of file memory.cpp.

References NumeRe::TableMetaData::comment, m_meta, and memArray.

◆ getSpearmanCorr()

mu::value_type Memory::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 selected columns.

Parameters
col1size_t
_vIndex1const VectorIndex&
col2size_t
_vIndex2const VectorIndex&
Returns
mu::value_type

Definition at line 3437 of file memory.cpp.

References getElemsInColumn(), getPearsonCorr(), getRank(), memArray, min, VectorIndex::OPEN_END, RANK_FRACTIONAL, VectorIndex::setOpenEndIndex(), VectorIndex::size(), and VectorIndex::subidx().

Here is the call graph for this function:

◆ getType()

TableColumn::ColumnType Memory::getType ( const VectorIndex _vCol) const

Returns the "common" type of the selected columns.

Parameters
_vColconst VectorIndex&
Returns
TableColumn::ColumnType

Definition at line 657 of file memory.cpp.

References memArray, VectorIndex::size(), TableColumn::STRINGLIKE, TableColumn::TYPE_MIXED, and TableColumn::TYPE_NONE.

Here is the call graph for this function:

◆ getZScore()

std::vector< mu::value_type > Memory::getZScore ( size_t  col,
const VectorIndex _vIndex 
) const

Calculate the standardized values of the selected column.

Parameters
colsize_t
_vIndexconst VectorIndex&
Returns
std::vector<mu::value_type>

Definition at line 3575 of file memory.cpp.

References avg(), getElemsInColumn(), readMem(), VectorIndex::setOpenEndIndex(), VectorIndex::size(), and std().

Here is the call graph for this function:

◆ importTable()

void Memory::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 internal storage before.

Parameters
_tableNumeRe::Table
Returns
void

Definition at line 1834 of file memory.cpp.

References convert(), deleteBulk(), VectorIndex::front(), NumeRe::Table::getCols(), NumeRe::Table::getColumn(), NumeRe::Table::getLines(), NumeRe::Table::getMetaData(), NumeReKernel::issueWarning(), m_meta, TableColumn::m_sHeadLine, TableColumn::m_type, VectorIndex::max(), memArray, NumeRe::TableMetaData::modify(), resizeMemory(), VectorIndex::setOpenEndIndex(), VectorIndex::size(), TableColumn::TYPE_CATEGORICAL, TableColumn::TYPE_DATETIME, TableColumn::TYPE_LOGICAL, TableColumn::TYPE_STRING, and TableColumn::TYPE_VALUE.

Here is the call graph for this function:

◆ isValid()

bool Memory::isValid ( ) const

Returns true, if at least a single valid value is available in this table.

Returns
bool

Definition at line 833 of file memory.cpp.

References getLines().

Referenced by NumeRe::FileAdapter::condenseDataSet(), deleteEntry(), and size().

Here is the call graph for this function:

◆ isValidElement()

bool Memory::isValidElement ( size_t  _nLine,
size_t  _nCol 
) const

Returns true, if the element at the selected positions is valid. Only checks internally, if the value is not a NaN value.

Parameters
_nLinesize_t
_nColsize_t
Returns
bool

Definition at line 817 of file memory.cpp.

References mu::isnan(), and memArray.

Here is the call graph for this function:

◆ isValue()

bool Memory::isValue ( int  line,
int  col 
)
overrideprivatevirtual

Override for the virtual Sorter class member function. Returns true, if the selected element is a valid value.

Parameters
lineint
colint
Returns
bool

Implements Sorter.

Definition at line 1786 of file memory.cpp.

References memArray.

◆ markModified()

void Memory::markModified ( )

Mark this table as modified.

Returns
void

Definition at line 1121 of file memory.cpp.

References m_meta, NumeRe::TableMetaData::modify(), and nCalcLines.

Referenced by performMatrixOperation(), readAudioFile(), readImage(), retouch1D(), rotateTable(), and seekInAudioFile().

Here is the call graph for this function:

◆ max()

mu::value_type Memory::max ( const VectorIndex _vLine,
const VectorIndex _vCol 
) const

Implementation for the MAX multi argument function.

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

Definition at line 2150 of file memory.cpp.

References calculateStats(), getCols(), getLines(), mu::isnan(), memArray, StatsLogic::OPERATION_MAX, VectorIndex::setOpenEndIndex(), and VectorIndex::size().

Referenced by getBins(), and maxpos().

Here is the call graph for this function:

◆ maxpos()

std::vector< mu::value_type > Memory::maxpos ( const VectorIndex _vIndex,
int  dir 
) const

Implementation of the MAXPOS multi argument function.

Parameters
_vIndexconst VectorIndex&
dirint
Returns
std::vector<mu::value_type>

Definition at line 3027 of file memory.cpp.

References ALL, cmp(), COLS, getCols(), getLines(), GRID, intCast(), mu::isnan(), max(), memArray, VectorIndex::OPEN_END, readMem(), VectorIndex::setOpenEndIndex(), VectorIndex::size(), and size().

Here is the call graph for this function:

◆ med()

mu::value_type Memory::med ( const VectorIndex _vLine,
const VectorIndex _vCol 
) const

Implementation for the MED multi argument function.

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

Definition at line 2736 of file memory.cpp.

References getCols(), getElemsInColumn(), getLines(), VectorIndex::isExpanded(), mu::isnan(), VectorIndex::isOrdered(), memArray, qSortDouble(), readMem(), VectorIndex::setOpenEndIndex(), and VectorIndex::size().

Referenced by matrixMed(), matrixMovMed(), parser_Med(), and retouch2D().

Here is the call graph for this function:

◆ min()

mu::value_type Memory::min ( const VectorIndex _vLine,
const VectorIndex _vCol 
) const

Implementation for the MIN multi argument function.

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

Definition at line 2185 of file memory.cpp.

References calculateStats(), getCols(), getLines(), mu::isnan(), memArray, StatsLogic::OPERATION_MIN, VectorIndex::setOpenEndIndex(), and VectorIndex::size().

Referenced by getBins(), and minpos().

Here is the call graph for this function:

◆ minpos()

std::vector< mu::value_type > Memory::minpos ( const VectorIndex _vIndex,
int  dir 
) const

Implementation of the MINPOS multi argument function.

Parameters
_vIndexconst VectorIndex&
dirint
Returns
std::vector<mu::value_type>

Definition at line 2946 of file memory.cpp.

References ALL, cmp(), COLS, getCols(), getLines(), GRID, intCast(), mu::isnan(), memArray, min(), VectorIndex::OPEN_END, readMem(), VectorIndex::setOpenEndIndex(), VectorIndex::size(), and size().

Here is the call graph for this function:

◆ norm()

mu::value_type Memory::norm ( const VectorIndex _vLine,
const VectorIndex _vCol 
) const

Implementation for the NORM multi argument function.

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

Definition at line 2551 of file memory.cpp.

References calculateStats(), getCols(), getLines(), memArray, StatsLogic::OPERATION_ADDSQ, VectorIndex::setOpenEndIndex(), and VectorIndex::size().

Here is the call graph for this function:

◆ num()

mu::value_type Memory::num ( const VectorIndex _vLine,
const VectorIndex _vCol 
) const

Implementation for the NUM multi argument function.

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

Definition at line 2288 of file memory.cpp.

References getCols(), getElemsInColumn(), getLines(), mu::isnan(), memArray, readMem(), VectorIndex::setOpenEndIndex(), and VectorIndex::size().

Referenced by avg(), getBins(), getOneWayAnova(), onlyValidValues(), and std().

Here is the call graph for this function:

◆ onlyValidValues()

bool Memory::onlyValidValues ( const VectorIndex _vLine,
const VectorIndex _vCol 
) const
private

This method is a wrapper for detecting, whether a row or column does only contain valid values (no NaNs).

Parameters
_vLineconst VectorIndex&
_vColconst VectorIndex&
Returns
bool

Definition at line 3930 of file memory.cpp.

References cnt(), and num().

Referenced by findValidBoundary().

Here is the call graph for this function:

◆ operator=()

Memory & Memory::operator= ( const Memory other)

Assignment operator.

Parameters
otherconst Memory&
Returns
Memory&

Definition at line 160 of file memory.cpp.

References clear(), m_meta, memArray, NumeRe::TableMetaData::modify(), nCalcLines, TableColumn::STRINGLIKE, TableColumn::TYPE_CATEGORICAL, TableColumn::TYPE_DATETIME, TableColumn::TYPE_LOGICAL, TableColumn::TYPE_MIXED, TableColumn::TYPE_NONE, TableColumn::TYPE_STRING, TableColumn::TYPE_VALUE, and TableColumn::VALUELIKE.

Here is the call graph for this function:

◆ or_func()

mu::value_type Memory::or_func ( const VectorIndex _vLine,
const VectorIndex _vCol 
) const

Implementation for the OR multi argument function.

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

Definition at line 2394 of file memory.cpp.

References getCols(), getElemsInColumn(), getLines(), VectorIndex::isExpanded(), VectorIndex::isOrdered(), memArray, VectorIndex::setOpenEndIndex(), and VectorIndex::size().

Here is the call graph for this function:

◆ pct()

mu::value_type Memory::pct ( const VectorIndex _vLine,
const VectorIndex _vCol,
mu::value_type  dPct = 0.5 
) const

Implementation for the PCT multi argument function.

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

Definition at line 2803 of file memory.cpp.

References getCols(), getElemsInColumn(), getLines(), VectorIndex::isExpanded(), mu::isnan(), VectorIndex::isOrdered(), memArray, qSortDouble(), readMem(), VectorIndex::setOpenEndIndex(), and VectorIndex::size().

Referenced by matrixPct(), and parser_Pct().

Here is the call graph for this function:

◆ prd()

mu::value_type Memory::prd ( const VectorIndex _vLine,
const VectorIndex _vCol 
) const

Implementation for the PRD multi argument function.

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

Definition at line 2220 of file memory.cpp.

References calculateStats(), getCols(), getLines(), memArray, StatsLogic::OPERATION_MULT, VectorIndex::setOpenEndIndex(), and VectorIndex::size().

Here is the call graph for this function:

◆ readMem() [1/2]

std::vector< mu::value_type > Memory::readMem ( const VectorIndex _vLine,
const VectorIndex _vCol 
) const

This member function returns the elements stored at the selected positions.

Parameters
_vLineconst VectorIndex&
_vColconst VectorIndex&
Returns
std::vector<mu::value_type>

Definition at line 444 of file memory.cpp.

References getElemsInColumn(), VectorIndex::isExpanded(), VectorIndex::isOrdered(), memArray, and VectorIndex::size().

Here is the call graph for this function:

◆ readMem() [2/2]

mu::value_type Memory::readMem ( size_t  _nLine,
size_t  _nCol 
) const

This member function returns the element stored at the selected position.

Parameters
_nLinesize_t
_nColsize_t
Returns
double

Definition at line 350 of file memory.cpp.

References memArray.

Referenced by calculateStats(), cmp(), getCovariance(), getRank(), getZScore(), maxpos(), med(), minpos(), num(), pct(), readMemInterpolated(), resample(), retouch1D(), retouch2D(), smoothingWindow1D(), and smoothingWindow2D().

◆ readMemAsMatrix()

Matrix Memory::readMemAsMatrix ( const VectorIndex _vLine,
const VectorIndex _vCol 
) const

This member function returns the elements stored at the selected positions as a Matrix.

Parameters
_vLineconst VectorIndex&
_vColconst VectorIndex&
Returns
Matrix

Definition at line 497 of file memory.cpp.

References memArray, and VectorIndex::size().

Referenced by evalMatOp().

Here is the call graph for this function:

◆ readMemAsString()

ValueVector Memory::readMemAsString ( const VectorIndex _vLine,
const VectorIndex _vCol 
) const

This member function returns the elements stored at the selected positions.

Parameters
_vLineconst VectorIndex&
_vColconst VectorIndex&
Returns
ValueVector

Definition at line 606 of file memory.cpp.

References getElemsInColumn(), VectorIndex::isExpanded(), VectorIndex::isOrdered(), memArray, and VectorIndex::size().

Here is the call graph for this function:

◆ readMemInterpolated()

mu::value_type Memory::readMemInterpolated ( double  _dLine,
double  _dCol 
) const

This member function returns a (bilinearily) interpolated element at the selected double positions.

Parameters
_dLinedouble
_dColdouble
Returns
mu::value_type

Definition at line 398 of file memory.cpp.

References intCast(), mu::isnan(), nanAvg(), and readMem().

Referenced by rotateTable().

Here is the call graph for this function:

◆ readMixedMem()

ValueVector Memory::readMixedMem ( const VectorIndex _vLine,
const VectorIndex _vCol 
) const

This member function returns the elements stored at the selected positions.

Parameters
_vLineconst VectorIndex&
_vColconst VectorIndex&
Returns
ValueVector

Definition at line 554 of file memory.cpp.

References getElemsInColumn(), VectorIndex::isExpanded(), VectorIndex::isOrdered(), memArray, and VectorIndex::size().

Here is the call graph for this function:

◆ reorderColumn()

void Memory::reorderColumn ( const VectorIndex vIndex,
int  i1,
int  i2,
int  j1 = 0 
)
private

This member function simply reorders the contents of the selected column using the passed index vector.

Parameters
vIndexconst VectorIndex&
i1int
i2int
j1int
Returns
void

Definition at line 1744 of file memory.cpp.

References memArray.

Referenced by sortElements().

◆ resample()

bool Memory::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 nSamples.

Parameters
_vLineVectorIndex
_vColVectorIndex
samplesstd::pair<size_t,size_t>
DirectionAppDir
sFilterstd::string sFilter
Returns
bool

Definition at line 4315 of file memory.cpp.

References ALL, Resampler::BOUNDARY_CLAMP, SyntaxError::CANNOT_RESAMPLE_CACHE, COLS, deleteBulk(), VectorIndex::front(), getCols(), getLines(), GRID, SyntaxError::INTERNAL_RESAMPLER_ERROR, SyntaxError::INVALID_INDEX, SyntaxError::invalid_position, VectorIndex::isOpenEnd(), VectorIndex::isValid(), VectorIndex::last(), VectorIndex::linearize(), LINES, m_meta, memArray, NumeRe::TableMetaData::modify(), nCalcLines, SyntaxError::NO_CACHED_DATA, readMem(), resample(), VectorIndex::setRange(), VectorIndex::size(), Resampler::STATUS_SCAN_BUFFER_FULL, VectorIndex::subidx(), VectorIndex::to_string(), and writeData().

Referenced by resample().

Here is the call graph for this function:

◆ resizeMemory()

bool Memory::resizeMemory ( size_t  _nLines,
size_t  _nCols 
)

This member function will handle all memory grow operations by doubling the base size, which shall be incremented, as long as it is smaller than the requested size.

Parameters
_nLinessize_t
_nColssize_t
Returns
bool

Definition at line 221 of file memory.cpp.

References Allocate().

Referenced by importTable(), MemoryManager::melt(), NumeRe::FileAdapter::openFile(), rotateTable(), setHeadLineElement(), and writeData().

Here is the call graph for this function:

◆ retouch()

bool Memory::retouch ( VectorIndex  _vLine,
VectorIndex  _vCol,
AppDir  Direction = ALL 
)

This method is the retouching main method. It will redirect the control into the specialized member functions.

Parameters
_vLineVectorIndex
_vColVectorIndex
DirectionAppDir
Returns
bool

Definition at line 3680 of file memory.cpp.

References ALL, COLS, getCols(), getLines(), GRID, VectorIndex::isOpenEnd(), VectorIndex::isValid(), VectorIndex::linearize(), LINES, memArray, retouch(), retouch1D(), retouch2D(), VectorIndex::setRange(), VectorIndex::size(), and VectorIndex::subidx().

Referenced by retouch(), and smooth().

Here is the call graph for this function:

◆ retouch1D()

bool Memory::retouch1D ( const VectorIndex _vLine,
const VectorIndex _vCol,
AppDir  Direction 
)
private

This member function retouches single dimension data (along columns or rows).

Parameters
_vLineconst VectorIndex&
_vColconst VectorIndex&
DirectionAppDir
Returns
bool

Definition at line 3744 of file memory.cpp.

References COLS, mu::isnan(), LINES, m_meta, markModified(), NumeRe::TableMetaData::modify(), readMem(), VectorIndex::size(), and writeData().

Referenced by retouch().

Here is the call graph for this function:

◆ retouch2D()

bool Memory::retouch2D ( const VectorIndex _vLine,
const VectorIndex _vCol 
)
private

This member function retouches two dimensional data (using a specialized filter class instance).

Parameters
_vLineconst VectorIndex&
_vColconst VectorIndex&
Returns
bool

Definition at line 3866 of file memory.cpp.

References Boundary::ce(), Boundary::cf(), Boundary::cols, findValidBoundary(), VectorIndex::front(), mu::isnan(), VectorIndex::last(), m_meta, med(), NumeRe::TableMetaData::modify(), Boundary::re(), readMem(), NumeRe::RetouchRegion::retouch(), Boundary::rf(), Boundary::rows, NumeRe::RetouchRegion::setBoundaries(), and writeData().

Referenced by retouch().

Here is the call graph for this function:

◆ save()

bool Memory::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. The type of the file is selected by the name of the file.

Parameters
_sFileNamestring
sTableNameconst string&
nPrecisionunsigned short
Returns
bool

Definition at line 1897 of file memory.cpp.

References SyntaxError::CANNOT_SAVE_FILE, NumeRe::TableMetaData::comment, getCols(), NumeRe::GenericFile::getExtension(), NumeRe::getFileByType(), getLines(), SyntaxError::invalid_position, m_meta, memArray, NumeRe::GenericFile::setData(), NumeRe::GenericFile::setDimensions(), NumeRe::GenericFile::setTableName(), NumeRe::GenericFile::setTextfilePrecision(), and NumeRe::GenericFile::write().

Here is the call graph for this function:

◆ setCategories()

bool Memory::setCategories ( const VectorIndex _vCol,
const std::vector< std::string > &  vCategories 
)

Updates the categories of a categorical column and switches the column type if necessary.

Parameters
_vColconst VectorIndex&
vCategoriesconst std::vector<std::string>&
Returns
bool

Definition at line 963 of file memory.cpp.

References url::get(), m_meta, memArray, NumeRe::TableMetaData::modify(), setCategories(), VectorIndex::setOpenEndIndex(), VectorIndex::size(), and TableColumn::TYPE_CATEGORICAL.

Referenced by setCategories().

Here is the call graph for this function:

◆ setHeadLineElement()

bool Memory::setHeadLineElement ( size_t  _i,
const std::string &  _sHead 
)

Writes a new table column headline to the selected column.

Parameters
_isize_t
_sHeadconst std::string&
Returns
bool

Definition at line 1068 of file memory.cpp.

References DEFAULT_COL_TYPE, m_meta, memArray, NumeRe::TableMetaData::modify(), and resizeMemory().

Referenced by readImage().

Here is the call graph for this function:

◆ setMetaData()

void Memory::setMetaData ( const NumeRe::TableMetaData meta)

Update the internal meta data with the passed one.

Parameters
metaconst NumeRe::TableMetaData&
Returns
void

Definition at line 1109 of file memory.cpp.

References m_meta.

Referenced by MemoryManager::melt(), and NumeRe::FileAdapter::openFile().

◆ setSaveStatus()

void Memory::setSaveStatus ( bool  _bIsSaved)

This member function changes the saved state to the passed value.

Parameters
_bIsSavedbool
Returns
void

Definition at line 1518 of file memory.cpp.

References m_meta, NumeRe::TableMetaData::modify(), and NumeRe::TableMetaData::save().

Referenced by MemoryManager::melt(), and NumeRe::FileAdapter::openFile().

Here is the call graph for this function:

◆ shrink()

bool Memory::shrink ( )

This member function shrinks the table memory to the smallest possible dimensions reachable in powers of two.

Returns
bool

Definition at line 847 of file memory.cpp.

References memArray, and nCalcLines.

Referenced by Allocate(), deleteBulk(), NumeRe::FileAdapter::openFile(), and rotateTable().

◆ size()

std::vector< mu::value_type > Memory::size ( const VectorIndex _vIndex,
int  dir 
) const

Implementation of the SIZE multi argument function.

Parameters
_vIndexconst VectorIndex&
dirint Bitcomposition of AppDir values
Returns
std::vector<mu::value_type>

Definition at line 2873 of file memory.cpp.

References ALL, COLS, getCols(), getElemsInColumn(), getFilledElemsInColumn(), getLines(), GRID, isValid(), LINES, memArray, VectorIndex::setOpenEndIndex(), and VectorIndex::size().

Referenced by deleteEntry(), getBins(), maxpos(), minpos(), and smoothingWindow2D().

Here is the call graph for this function:

◆ smooth()

bool Memory::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 FilterSettings to construct the corresponding filter.

Parameters
_vLineVectorIndex
_vColVectorIndex
_settingsNumeRe::FilterSettings
DirectionAppDir
Returns
bool

Definition at line 4138 of file memory.cpp.

References ALL, NumeRe::FilterSettings::alpha, VectorIndex::append(), SyntaxError::CANNOT_SMOOTH_CACHE, NumeRe::FilterSettings::col, COLS, NumeRe::createFilter(), VectorIndex::front(), getCols(), getLines(), VectorIndex::getVector(), GRID, SyntaxError::INVALID_INDEX, SyntaxError::invalid_position, mu::isnan(), VectorIndex::isOpenEnd(), VectorIndex::isValid(), VectorIndex::last(), LINES, m_meta, max, memArray, NumeRe::TableMetaData::modify(), SyntaxError::NO_CACHED_DATA, VectorIndex::prepend(), retouch(), NumeRe::FilterSettings::row, VectorIndex::setRange(), VectorIndex::size(), smooth(), smoothingWindow1D(), smoothingWindow2D(), VectorIndex::subidx(), and VectorIndex::to_string().

Referenced by smooth().

Here is the call graph for this function:

◆ smoothingWindow1D()

void Memory::smoothingWindow1D ( const VectorIndex _vLine,
const VectorIndex _vCol,
size_t  i,
size_t  j,
NumeRe::Filter _filter,
bool  smoothLines 
)
private

This private member function realizes the application of a smoothing window to 1D data sets.

Parameters
_vLineconst VectorIndex&
_vColconst VectorIndex&
isize_t
jsize_t
_filterNumeRe::Filter*
smoothLinesbool
Returns
void

Definition at line 4004 of file memory.cpp.

References NumeRe::Filter::apply(), VectorIndex::front(), NumeRe::Filter::getBuffer(), NumeRe::Filter::getWindowSize(), NumeRe::Filter::isConvolution(), readMem(), VectorIndex::size(), sum(), and writeData().

Referenced by smooth().

Here is the call graph for this function:

◆ smoothingWindow2D()

void Memory::smoothingWindow2D ( const VectorIndex _vLine,
const VectorIndex _vCol,
size_t  i,
size_t  j,
NumeRe::Filter _filter 
)
private

This private member function realizes the application of a smoothing window to 2D data sets.

Parameters
_vLineconst VectorIndex&
_vColconst VectorIndex&
isize_t
jsize_t
_filterNumeRe::Filter*
Returns
void

Definition at line 4069 of file memory.cpp.

References NumeRe::Filter::apply(), VectorIndex::front(), NumeRe::Filter::get2DBuffer(), NumeRe::Filter::getWindowSize(), NumeRe::Filter::isConvolution(), readMem(), VectorIndex::size(), size(), sum(), and writeData().

Referenced by smooth().

Here is the call graph for this function:

◆ sortElements()

vector< int > Memory::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 parameters and redirect the control to the corresponding sorting function.

Parameters
i1int
i2int
j1int
j2int
sSortingExpressionconst std::string&
Returns
vector<int>

Definition at line 1555 of file memory.cpp.

References bSortCaseInsensitive, SyntaxError::CANNOT_SORT_CACHE, Sorter::evaluateKeyList(), findParameter(), getArgAtPos(), getCols(), SyntaxError::invalid_position, m_meta, max, memArray, NumeRe::TableMetaData::modify(), nCalcLines, ColumnKeys::nKey, Sorter::qSort(), reorderColumn(), Sorter::sortSubList(), and ColumnKeys::subkeys.

Referenced by extractRange(), and getRank().

Here is the call graph for this function:

◆ std()

mu::value_type Memory::std ( const VectorIndex _vLine,
const VectorIndex _vCol 
) const

Implementation for the STD multi argument function.

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

Definition at line 2099 of file memory.cpp.

References avg(), calculateStats(), getCols(), getLines(), memArray, num(), StatsLogic::OPERATION_ADDSQSUB, VectorIndex::setOpenEndIndex(), and VectorIndex::size().

Referenced by getOneWayAnova(), getPearsonCorr(), and getZScore().

Here is the call graph for this function:

◆ sum()

mu::value_type Memory::sum ( const VectorIndex _vLine,
const VectorIndex _vCol 
) const

Implementation for the SUM multi argument function.

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

Definition at line 2254 of file memory.cpp.

References calculateStats(), getCols(), getLines(), memArray, StatsLogic::OPERATION_ADD, VectorIndex::setOpenEndIndex(), and VectorIndex::size().

Referenced by avg(), smoothingWindow1D(), and smoothingWindow2D().

Here is the call graph for this function:

◆ writeComment()

void Memory::writeComment ( const std::string &  comment)

Update the comment associated with this table.

Parameters
commentconst std::string&
Returns
void

Definition at line 1094 of file memory.cpp.

References NumeRe::TableMetaData::comment, m_meta, and NumeRe::TableMetaData::modify().

Here is the call graph for this function:

◆ writeData() [1/4]

void Memory::writeData ( Indices _idx,
const ValueVector _values 
)

This member function writes a whole array of values to the selected table range. The table is automatically enlarged, if necessary.

Parameters
_idxIndices&
_valuesconst ValueVector&
Returns
void

Definition at line 1431 of file memory.cpp.

References Indices::col, COLS, convert_for_overwrite(), VectorIndex::front(), VectorIndex::isOpenEnd(), LINES, memArray, Indices::row, VectorIndex::setOpenEndIndex(), VectorIndex::size(), TableColumn::TYPE_STRING, writeData(), and writeSingletonData().

Here is the call graph for this function:

◆ writeData() [2/4]

void Memory::writeData ( Indices _idx,
mu::value_type _dData,
unsigned int  _nNum 
)

This member function writes a whole array of data to the selected table range. The table is automatically enlarged, if necessary.

Parameters
_idxIndices&
_dDatamu::value_type*
_nNumunsigned int
Returns
void

Definition at line 1318 of file memory.cpp.

References Indices::col, COLS, convert_for_overwrite(), convert_if_empty(), VectorIndex::front(), mu::isnan(), VectorIndex::isOpenEnd(), mu::isreal(), LINES, m_meta, memArray, NumeRe::TableMetaData::modify(), nCalcLines, resizeMemory(), Indices::row, VectorIndex::setOpenEndIndex(), VectorIndex::size(), TableColumn::TYPE_DATETIME, TableColumn::TYPE_VALUE, and writeSingletonData().

Here is the call graph for this function:

◆ writeData() [3/4]

void Memory::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 enlarged, if necessary.

Parameters
_nLineint
_nColint
_dDataconst mu::value_type&
Returns
void

Definition at line 1219 of file memory.cpp.

References convert_if_empty(), mu::isnan(), m_meta, memArray, NumeRe::TableMetaData::modify(), nCalcLines, resizeMemory(), and TableColumn::TYPE_VALUE.

Referenced by matrixMed(), matrixMovMed(), matrixPct(), parser_Med(), parser_Pct(), performMatrixOperation(), readAudioFile(), readImage(), resample(), retouch1D(), retouch2D(), seekInAudioFile(), smoothingWindow1D(), smoothingWindow2D(), writeData(), and writeSingletonData().

Here is the call graph for this function:

◆ writeData() [4/4]

void Memory::writeData ( int  _nLine,
int  _nCol,
const std::string &  sValue 
)

Writes string data to the internal table.

Parameters
_nLineint
_nColint
sValueconst std::string&
Returns
void

Definition at line 1287 of file memory.cpp.

References convert_if_empty(), m_meta, memArray, NumeRe::TableMetaData::modify(), nCalcLines, resizeMemory(), and TableColumn::TYPE_STRING.

Here is the call graph for this function:

◆ writeDataDirect()

void Memory::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. It will not check for the existence of the needed amount of columns.

Parameters
_nLineint
_nColint
_dDataconst mu::value_type&
Returns
void

Definition at line 1249 of file memory.cpp.

References convert_if_empty(), memArray, and TableColumn::TYPE_VALUE.

Referenced by rotateTable().

Here is the call graph for this function:

◆ writeDataDirectUnsafe()

void Memory::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. It will neither check for existence of the internal pointer nor for the existence of the needed amount of columns. Use this only, if real pre-allocation is possible.

Parameters
_nLineint
_nColint
_dDataconst mu::value_type&
Returns
void

Definition at line 1271 of file memory.cpp.

References memArray.

Referenced by matrixMed(), matrixPct(), performMatrixOperation(), readAudioFile(), readImage(), and seekInAudioFile().

◆ writeSingletonData() [1/2]

void Memory::writeSingletonData ( Indices _idx,
const mu::value_type _dData 
)

This member function writes multiple copies of a single value to a range in the table. The table is automatically enlarged, if necessary.

Parameters
_idxIndices&
_dDataconst mu::value_type&
Returns
void

Definition at line 1394 of file memory.cpp.

References Indices::col, convert_for_overwrite(), VectorIndex::front(), getCols(), getLines(), VectorIndex::isOpenEnd(), max, memArray, Indices::row, VectorIndex::setOpenEndIndex(), VectorIndex::size(), TableColumn::TYPE_DATETIME, TableColumn::TYPE_VALUE, and writeData().

Referenced by writeData().

Here is the call graph for this function:

◆ writeSingletonData() [2/2]

void Memory::writeSingletonData ( Indices _idx,
const std::string &  _sValue 
)

This member function writes multiple copies of a single string to a range in the table. The table is automatically enlarged, if necessary.

Parameters
_idxIndices&
_sValueconst std::string&
Returns
void

Definition at line 1487 of file memory.cpp.

References Indices::col, convert_for_overwrite(), VectorIndex::front(), getCols(), getLines(), VectorIndex::isOpenEnd(), max, memArray, Indices::row, VectorIndex::setOpenEndIndex(), VectorIndex::size(), TableColumn::TYPE_STRING, and writeData().

Here is the call graph for this function:

◆ xor_func()

mu::value_type Memory::xor_func ( const VectorIndex _vLine,
const VectorIndex _vCol 
) const

Implementation for the XOR multi argument function.

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

Definition at line 2446 of file memory.cpp.

References getCols(), getElemsInColumn(), getLines(), VectorIndex::isExpanded(), VectorIndex::isOrdered(), memArray, VectorIndex::setOpenEndIndex(), and VectorIndex::size().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ MemoryManager

friend class MemoryManager
friend

Definition at line 86 of file memory.hpp.

◆ NumeRe::FileAdapter

friend class NumeRe::FileAdapter
friend

Definition at line 87 of file memory.hpp.

Member Data Documentation

◆ bSaveMutex

bool Memory::bSaveMutex
private

Definition at line 94 of file memory.hpp.

Referenced by clear(), and Memory().

◆ bSortCaseInsensitive

bool Memory::bSortCaseInsensitive
private

Definition at line 95 of file memory.hpp.

Referenced by compare(), and sortElements().

◆ m_meta

◆ memArray

◆ nCalcLines

int Memory::nCalcLines
mutableprivate

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