NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
|
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>
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... | |
Memory & | operator= (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_type > | readMem (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... | |
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. 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_type > | size (const VectorIndex &_vIndex, int dir) const |
Implementation of the SIZE multi argument function. More... | |
std::vector< mu::value_type > | minpos (const VectorIndex &_vIndex, int dir) const |
Implementation of the MINPOS multi argument function. More... | |
std::vector< mu::value_type > | maxpos (const VectorIndex &_vIndex, int dir) const |
Implementation of the MAXPOS multi argument function. More... | |
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 per string. More... | |
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 string values) and returns the corresponding sums. More... | |
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 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_type > | getRank (size_t col, const VectorIndex &_vIndex, RankingStrategy _strat) const |
Rank the selected column according the selected ranking strategy. More... | |
std::vector< mu::value_type > | getZScore (size_t col, const VectorIndex &_vIndex) const |
Calculate the standardized values of the selected column. More... | |
std::vector< mu::value_type > | getBins (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... | |
ColumnKeys * | evaluateKeyList (std::string &sKeyList, long long int nColumnCount) |
This public member function creates a ColumnKeys object from a string containing the hierarchical sorting order for the current sorting process. More... | |
Private Member Functions | |
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 |
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.
enum Memory::AppDir |
Enumerator | |
---|---|
ALL | |
LINES | |
COLS | |
GRID |
Definition at line 70 of file memory.hpp.
Enumerator | |
---|---|
RANK_DENSE | |
RANK_COMPETETIVE | |
RANK_FRACTIONAL |
Definition at line 78 of file memory.hpp.
Memory::Memory | ( | ) |
Default constructor.
Definition at line 48 of file memory.cpp.
References bSaveMutex, m_meta, nCalcLines, and NumeRe::TableMetaData::save().
Referenced by extractRange().
Memory::Memory | ( | size_t | _nCols | ) |
Specialized constructor to allocate a defined table size.
_nCols | size_t |
Definition at line 63 of file memory.cpp.
References Allocate().
Memory::~Memory | ( | ) |
Memory class destructor, which will free the allocated memory.
Definition at line 73 of file memory.cpp.
References clear().
|
private |
This member function is the Memory class allocator. It will handle all memory allocations.
_nNCols | size_t |
shrink | 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().
mu::value_type Memory::and_func | ( | const VectorIndex & | _vLine, |
const VectorIndex & | _vCol | ||
) | const |
Implementation for the AND multi argument function.
_vLine | const VectorIndex& |
_vCol | const VectorIndex& |
Definition at line 2334 of file memory.cpp.
References getCols(), getElemsInColumn(), getLines(), VectorIndex::isExpanded(), mu::isnan(), VectorIndex::isOrdered(), memArray, VectorIndex::setOpenEndIndex(), and VectorIndex::size().
mu::value_type Memory::avg | ( | const VectorIndex & | _vLine, |
const VectorIndex & | _vCol | ||
) | const |
Implementation for the AVG multi argument function.
_vLine | const VectorIndex& |
_vCol | const VectorIndex& |
Definition at line 2132 of file memory.cpp.
References memArray, num(), and sum().
Referenced by getCovariance(), getOneWayAnova(), getZScore(), and std().
|
private |
Driver code for simplifying the calculation of various stats using OpenMP, if possible.
_vLine | const VectorIndex& |
_vCol | const VectorIndex& |
operation | std::vector<StatsLogic>& |
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().
|
private |
This member function frees the internally used memory block completely.
Definition at line 141 of file memory.cpp.
References bSaveMutex, m_meta, memArray, NumeRe::TableMetaData::modify(), and nCalcLines.
Referenced by operator=(), and ~Memory().
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.
_vLine | const VectorIndex& |
_vCol | const VectorIndex& |
dRef | mu::value_type |
_nType | int |
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().
mu::value_type Memory::cnt | ( | const VectorIndex & | _vLine, |
const VectorIndex & | _vCol | ||
) | const |
Implementation for the CNT multi argument function.
_vLine | const VectorIndex& |
_vCol | const VectorIndex& |
Definition at line 2508 of file memory.cpp.
References getCols(), getElemsInColumn(), getLines(), memArray, VectorIndex::setOpenEndIndex(), and VectorIndex::size().
Referenced by onlyValidValues().
|
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.
i | int |
j | int |
col | int |
Implements Sorter.
Definition at line 1767 of file memory.cpp.
References bSortCaseInsensitive, and memArray.
void Memory::convert | ( | ) |
This member function tries to convert all string columns to value columns, if it is possible.
Definition at line 888 of file memory.cpp.
References url::get(), memArray, and TableColumn::TYPE_STRING.
Referenced by importTable(), and NumeRe::FileAdapter::openFile().
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.
_vCol | const VectorIndex& |
_sType | const std::string& |
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.
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.
vTarget | vector<mu::value_type>* |
_vLine | const VectorIndex& |
_vCol | const VectorIndex& |
Definition at line 768 of file memory.cpp.
References getElemsInColumn(), VectorIndex::isExpanded(), VectorIndex::isOrdered(), memArray, and VectorIndex::size().
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.
_vCols | const VectorIndex& |
vValues | const std::vector<mu::value_type>& |
vStringValues | const std::vector<std::string>& |
Definition at line 3172 of file memory.cpp.
References closeEnough(), memArray, and VectorIndex::size().
|
private |
This member function creates the column headlines, if they are empty.
Definition at line 121 of file memory.cpp.
References DEFAULT_COL_TYPE, TableColumn::getDefaultColumnHead(), and memArray.
Referenced by NumeRe::FileAdapter::openFile().
void Memory::deleteBulk | ( | const VectorIndex & | _vLine, |
const VectorIndex & | _vCol | ||
) |
This member function deletes a whole range of entries from the memory table.
_vLine | const VectorIndex& |
_vCol | const VectorIndex& |
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().
void Memory::deleteEntry | ( | int | _nLine, |
int | _nCol | ||
) |
This member function deletes a single entry from the memory table.
_nLine | int |
_nCol | int |
Definition at line 1952 of file memory.cpp.
References isValid(), m_meta, memArray, NumeRe::TableMetaData::modify(), nCalcLines, and size().
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.
_vLine | const VectorIndex& |
_vCol | const VectorIndex& |
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().
NumeRe::Table Memory::extractTable | ( | const std::string & | _sTable, |
const VectorIndex & | lines, | ||
const VectorIndex & | cols | ||
) |
Create a copy-efficient table object from the data contents.
_sTable | const string& |
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().
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.
vColNames | const std::vector<std::string>& |
Definition at line 3140 of file memory.cpp.
References memArray.
|
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.
_vLine | const VectorIndex& |
_vCol | const VectorIndex& |
i | int |
j | int |
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().
size_t Memory::getAppendedZeroes | ( | size_t | _i | ) | const |
Returns the number of empty cells at the end of the selected columns.
_i | size_t |
Definition at line 1136 of file memory.cpp.
References getLines(), and memArray.
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.
col | size_t |
nBins | size_t |
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.
ValueVector Memory::getCategoryList | ( | const VectorIndex & | _vCol | ) | const |
Returns a key-value list containing the categories and their respective index.
_vCol | const VectorIndex& |
Definition at line 685 of file memory.cpp.
References memArray, VectorIndex::size(), toString(), and TableColumn::TYPE_CATEGORICAL.
int Memory::getCols | ( | bool | _bFull = false | ) | const |
This member function will return the number of columns, which are currently available in this table.
_bFull | bool true, if the reserved number of columns is requested, false if only the non-empty ones are requested |
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().
std::string Memory::getComment | ( | ) | const |
Return the comment associated with this table.
Definition at line 1189 of file memory.cpp.
References NumeRe::TableMetaData::comment, and m_meta.
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.
col1 | size_t |
_vIndex1 | const VectorIndex& |
col2 | size_t |
_vIndex2 | const VectorIndex& |
Definition at line 3380 of file memory.cpp.
References avg(), getElemsInColumn(), min, readMem(), VectorIndex::setOpenEndIndex(), VectorIndex::size(), and VectorIndex::subidx().
Referenced by getPearsonCorr().
int Memory::getElemsInColumn | ( | size_t | col | ) | const |
Returns the number of elements in the selected column (but might contain invalid values).
col | size_t |
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().
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.
col | size_t |
Definition at line 311 of file memory.cpp.
References memArray.
Referenced by size().
size_t Memory::getHeadlineCount | ( | ) | const |
This member function returns the number of lines needed for the table column headline of the selected column.
Definition at line 1153 of file memory.cpp.
References memArray.
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.
_vCol | const VectorIndex& |
Definition at line 1043 of file memory.cpp.
References getHeadLineElement(), and VectorIndex::size().
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.
_i | size_t |
Definition at line 1025 of file memory.cpp.
References TableColumn::getDefaultColumnHead(), and memArray.
Referenced by getHeadLineElement().
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.
col | size_t |
vValues | const std::vector<mu::value_type>& |
vStringValues | const std::vector<std::string>& |
Definition at line 3233 of file memory.cpp.
References closeEnough(), and memArray.
Referenced by getOneWayAnova().
long long int Memory::getLastSaved | ( | ) | const |
This member function returns the time- point, where the table was saved last time.
Definition at line 1534 of file memory.cpp.
References NumeRe::TableMetaData::lastSavedTime, and m_meta.
int Memory::getLines | ( | bool | _bFull = false | ) | const |
This member function will return the number of lines, which are currently available in this table.
_bFull | bool true, if the reserved number of lines is requested, false if only the non-empty ones are requested |
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().
NumeRe::TableMetaData Memory::getMetaData | ( | ) | const |
Return the internal meta data structure.
Definition at line 1202 of file memory.cpp.
References m_meta.
Referenced by MemoryManager::melt().
AnovaResult Memory::getOneWayAnova | ( | size_t | colCategories, |
size_t | colValues, | ||
const VectorIndex & | _vIndex, | ||
double | significance | ||
) | const |
Calculates the simples form of a ANOVA F test.
colCategories | size_t |
colValues | size_t |
_vIndex | const VectorIndex& |
significance | double |
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.
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.
col1 | size_t |
_vIndex1 | const VectorIndex& |
col2 | size_t |
_vIndex2 | const VectorIndex& |
Definition at line 3413 of file memory.cpp.
References getCovariance(), getElemsInColumn(), min, VectorIndex::setOpenEndIndex(), VectorIndex::size(), std(), and VectorIndex::subidx().
Referenced by getSpearmanCorr().
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.
col | size_t |
_vIndex | const VectorIndex& |
_strat | Memory::RankingStrategy |
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().
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.
Definition at line 1009 of file memory.cpp.
References NumeRe::TableMetaData::isSaved, and m_meta.
size_t Memory::getSize | ( | ) | const |
Returns the overall used number of bytes for this table.
Definition at line 327 of file memory.cpp.
References NumeRe::TableMetaData::comment, m_meta, and memArray.
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.
col1 | size_t |
_vIndex1 | const VectorIndex& |
col2 | size_t |
_vIndex2 | const VectorIndex& |
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().
TableColumn::ColumnType Memory::getType | ( | const VectorIndex & | _vCol | ) | const |
Returns the "common" type of the selected columns.
_vCol | const VectorIndex& |
Definition at line 657 of file memory.cpp.
References memArray, VectorIndex::size(), TableColumn::STRINGLIKE, TableColumn::TYPE_MIXED, and TableColumn::TYPE_NONE.
std::vector< mu::value_type > Memory::getZScore | ( | size_t | col, |
const VectorIndex & | _vIndex | ||
) | const |
Calculate the standardized values of the selected column.
col | size_t |
_vIndex | const VectorIndex& |
Definition at line 3575 of file memory.cpp.
References avg(), getElemsInColumn(), readMem(), VectorIndex::setOpenEndIndex(), VectorIndex::size(), and std().
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.
_table | NumeRe::Table |
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.
bool Memory::isValid | ( | ) | const |
Returns true, if at least a single valid value is available in this table.
Definition at line 833 of file memory.cpp.
References getLines().
Referenced by NumeRe::FileAdapter::condenseDataSet(), deleteEntry(), and size().
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.
_nLine | size_t |
_nCol | size_t |
Definition at line 817 of file memory.cpp.
References mu::isnan(), and memArray.
|
overrideprivatevirtual |
Override for the virtual Sorter class member function. Returns true, if the selected element is a valid value.
line | int |
col | int |
Implements Sorter.
Definition at line 1786 of file memory.cpp.
References memArray.
void Memory::markModified | ( | ) |
Mark this table as modified.
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().
mu::value_type Memory::max | ( | const VectorIndex & | _vLine, |
const VectorIndex & | _vCol | ||
) | const |
Implementation for the MAX multi argument function.
_vLine | const VectorIndex& |
_vCol | const VectorIndex& |
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().
std::vector< mu::value_type > Memory::maxpos | ( | const VectorIndex & | _vIndex, |
int | dir | ||
) | const |
Implementation of the MAXPOS multi argument function.
_vIndex | const VectorIndex& |
dir | int |
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().
mu::value_type Memory::med | ( | const VectorIndex & | _vLine, |
const VectorIndex & | _vCol | ||
) | const |
Implementation for the MED multi argument function.
_vLine | const VectorIndex& |
_vCol | const VectorIndex& |
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().
mu::value_type Memory::min | ( | const VectorIndex & | _vLine, |
const VectorIndex & | _vCol | ||
) | const |
Implementation for the MIN multi argument function.
_vLine | const VectorIndex& |
_vCol | const VectorIndex& |
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().
std::vector< mu::value_type > Memory::minpos | ( | const VectorIndex & | _vIndex, |
int | dir | ||
) | const |
Implementation of the MINPOS multi argument function.
_vIndex | const VectorIndex& |
dir | int |
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().
mu::value_type Memory::norm | ( | const VectorIndex & | _vLine, |
const VectorIndex & | _vCol | ||
) | const |
Implementation for the NORM multi argument function.
_vLine | const VectorIndex& |
_vCol | const VectorIndex& |
Definition at line 2551 of file memory.cpp.
References calculateStats(), getCols(), getLines(), memArray, StatsLogic::OPERATION_ADDSQ, VectorIndex::setOpenEndIndex(), and VectorIndex::size().
mu::value_type Memory::num | ( | const VectorIndex & | _vLine, |
const VectorIndex & | _vCol | ||
) | const |
Implementation for the NUM multi argument function.
_vLine | const VectorIndex& |
_vCol | const VectorIndex& |
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().
|
private |
This method is a wrapper for detecting, whether a row or column does only contain valid values (no NaNs).
_vLine | const VectorIndex& |
_vCol | const VectorIndex& |
Definition at line 3930 of file memory.cpp.
Referenced by findValidBoundary().
Assignment operator.
other | const 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.
mu::value_type Memory::or_func | ( | const VectorIndex & | _vLine, |
const VectorIndex & | _vCol | ||
) | const |
Implementation for the OR multi argument function.
_vLine | const VectorIndex& |
_vCol | const VectorIndex& |
Definition at line 2394 of file memory.cpp.
References getCols(), getElemsInColumn(), getLines(), VectorIndex::isExpanded(), VectorIndex::isOrdered(), memArray, VectorIndex::setOpenEndIndex(), and VectorIndex::size().
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.
_vLine | const VectorIndex& |
_vCol | const VectorIndex& |
dPct | 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().
mu::value_type Memory::prd | ( | const VectorIndex & | _vLine, |
const VectorIndex & | _vCol | ||
) | const |
Implementation for the PRD multi argument function.
_vLine | const VectorIndex& |
_vCol | const VectorIndex& |
Definition at line 2220 of file memory.cpp.
References calculateStats(), getCols(), getLines(), memArray, StatsLogic::OPERATION_MULT, VectorIndex::setOpenEndIndex(), and VectorIndex::size().
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.
_vLine | const VectorIndex& |
_vCol | const VectorIndex& |
Definition at line 444 of file memory.cpp.
References getElemsInColumn(), VectorIndex::isExpanded(), VectorIndex::isOrdered(), memArray, and VectorIndex::size().
mu::value_type Memory::readMem | ( | size_t | _nLine, |
size_t | _nCol | ||
) | const |
This member function returns the element stored at the selected position.
_nLine | size_t |
_nCol | size_t |
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().
Matrix Memory::readMemAsMatrix | ( | const VectorIndex & | _vLine, |
const VectorIndex & | _vCol | ||
) | const |
This member function returns the elements stored at the selected positions as a Matrix.
_vLine | const VectorIndex& |
_vCol | const VectorIndex& |
Definition at line 497 of file memory.cpp.
References memArray, and VectorIndex::size().
Referenced by evalMatOp().
ValueVector Memory::readMemAsString | ( | const VectorIndex & | _vLine, |
const VectorIndex & | _vCol | ||
) | const |
This member function returns the elements stored at the selected positions.
_vLine | const VectorIndex& |
_vCol | const VectorIndex& |
Definition at line 606 of file memory.cpp.
References getElemsInColumn(), VectorIndex::isExpanded(), VectorIndex::isOrdered(), memArray, and VectorIndex::size().
mu::value_type Memory::readMemInterpolated | ( | double | _dLine, |
double | _dCol | ||
) | const |
This member function returns a (bilinearily) interpolated element at the selected double
positions.
_dLine | double |
_dCol | double |
Definition at line 398 of file memory.cpp.
References intCast(), mu::isnan(), nanAvg(), and readMem().
Referenced by rotateTable().
ValueVector Memory::readMixedMem | ( | const VectorIndex & | _vLine, |
const VectorIndex & | _vCol | ||
) | const |
This member function returns the elements stored at the selected positions.
_vLine | const VectorIndex& |
_vCol | const VectorIndex& |
Definition at line 554 of file memory.cpp.
References getElemsInColumn(), VectorIndex::isExpanded(), VectorIndex::isOrdered(), memArray, and VectorIndex::size().
|
private |
This member function simply reorders the contents of the selected column using the passed index vector.
vIndex | const VectorIndex& |
i1 | int |
i2 | int |
j1 | int |
Definition at line 1744 of file memory.cpp.
References memArray.
Referenced by sortElements().
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.
_vLine | VectorIndex |
_vCol | VectorIndex |
samples | std::pair<size_t,size_t> |
Direction | AppDir |
sFilter | std::string sFilter |
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().
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.
_nLines | size_t |
_nCols | size_t |
Definition at line 221 of file memory.cpp.
References Allocate().
Referenced by importTable(), MemoryManager::melt(), NumeRe::FileAdapter::openFile(), rotateTable(), setHeadLineElement(), and writeData().
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.
_vLine | VectorIndex |
_vCol | VectorIndex |
Direction | AppDir |
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().
|
private |
This member function retouches single dimension data (along columns or rows).
_vLine | const VectorIndex& |
_vCol | const VectorIndex& |
Direction | AppDir |
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().
|
private |
This member function retouches two dimensional data (using a specialized filter class instance).
_vLine | const VectorIndex& |
_vCol | const VectorIndex& |
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().
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.
_sFileName | string |
sTableName | const string& |
nPrecision | unsigned short |
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().
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.
_vCol | const VectorIndex& |
vCategories | const std::vector<std::string>& |
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().
bool Memory::setHeadLineElement | ( | size_t | _i, |
const std::string & | _sHead | ||
) |
Writes a new table column headline to the selected column.
_i | size_t |
_sHead | const std::string& |
Definition at line 1068 of file memory.cpp.
References DEFAULT_COL_TYPE, m_meta, memArray, NumeRe::TableMetaData::modify(), and resizeMemory().
Referenced by readImage().
void Memory::setMetaData | ( | const NumeRe::TableMetaData & | meta | ) |
Update the internal meta data with the passed one.
meta | const NumeRe::TableMetaData& |
Definition at line 1109 of file memory.cpp.
References m_meta.
Referenced by MemoryManager::melt(), and NumeRe::FileAdapter::openFile().
void Memory::setSaveStatus | ( | bool | _bIsSaved | ) |
This member function changes the saved state to the passed value.
_bIsSaved | bool |
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().
bool Memory::shrink | ( | ) |
This member function shrinks the table memory to the smallest possible dimensions reachable in powers of two.
Definition at line 847 of file memory.cpp.
References memArray, and nCalcLines.
Referenced by Allocate(), deleteBulk(), NumeRe::FileAdapter::openFile(), and rotateTable().
std::vector< mu::value_type > Memory::size | ( | const VectorIndex & | _vIndex, |
int | dir | ||
) | const |
Implementation of the SIZE multi argument function.
_vIndex | const VectorIndex& |
dir | int Bitcomposition of AppDir values |
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().
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.
_vLine | VectorIndex |
_vCol | VectorIndex |
_settings | NumeRe::FilterSettings |
Direction | AppDir |
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().
|
private |
This private member function realizes the application of a smoothing window to 1D data sets.
_vLine | const VectorIndex& |
_vCol | const VectorIndex& |
i | size_t |
j | size_t |
_filter | NumeRe::Filter* |
smoothLines | bool |
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().
|
private |
This private member function realizes the application of a smoothing window to 2D data sets.
_vLine | const VectorIndex& |
_vCol | const VectorIndex& |
i | size_t |
j | size_t |
_filter | NumeRe::Filter* |
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().
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.
i1 | int |
i2 | int |
j1 | int |
j2 | int |
sSortingExpression | const std::string& |
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().
mu::value_type Memory::std | ( | const VectorIndex & | _vLine, |
const VectorIndex & | _vCol | ||
) | const |
Implementation for the STD multi argument function.
_vLine | const VectorIndex& |
_vCol | const VectorIndex& |
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().
mu::value_type Memory::sum | ( | const VectorIndex & | _vLine, |
const VectorIndex & | _vCol | ||
) | const |
Implementation for the SUM multi argument function.
_vLine | const VectorIndex& |
_vCol | const VectorIndex& |
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().
void Memory::writeComment | ( | const std::string & | comment | ) |
Update the comment associated with this table.
comment | const std::string& |
Definition at line 1094 of file memory.cpp.
References NumeRe::TableMetaData::comment, m_meta, and NumeRe::TableMetaData::modify().
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.
_idx | Indices& |
_values | const ValueVector& |
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().
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.
_idx | Indices& |
_dData | mu::value_type* |
_nNum | unsigned int |
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().
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.
_nLine | int |
_nCol | int |
_dData | const mu::value_type& |
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().
void Memory::writeData | ( | int | _nLine, |
int | _nCol, | ||
const std::string & | sValue | ||
) |
Writes string data to the internal table.
_nLine | int |
_nCol | int |
sValue | const std::string& |
Definition at line 1287 of file memory.cpp.
References convert_if_empty(), m_meta, memArray, NumeRe::TableMetaData::modify(), nCalcLines, resizeMemory(), and TableColumn::TYPE_STRING.
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.
_nLine | int |
_nCol | int |
_dData | const mu::value_type& |
Definition at line 1249 of file memory.cpp.
References convert_if_empty(), memArray, and TableColumn::TYPE_VALUE.
Referenced by rotateTable().
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.
_nLine | int |
_nCol | int |
_dData | const mu::value_type& |
Definition at line 1271 of file memory.cpp.
References memArray.
Referenced by matrixMed(), matrixPct(), performMatrixOperation(), readAudioFile(), readImage(), and seekInAudioFile().
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.
_idx | Indices& |
_dData | const mu::value_type& |
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().
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.
_idx | Indices& |
_sValue | const std::string& |
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().
mu::value_type Memory::xor_func | ( | const VectorIndex & | _vLine, |
const VectorIndex & | _vCol | ||
) | const |
Implementation for the XOR multi argument function.
_vLine | const VectorIndex& |
_vCol | const VectorIndex& |
Definition at line 2446 of file memory.cpp.
References getCols(), getElemsInColumn(), getLines(), VectorIndex::isExpanded(), VectorIndex::isOrdered(), memArray, VectorIndex::setOpenEndIndex(), and VectorIndex::size().
|
friend |
Definition at line 86 of file memory.hpp.
|
friend |
Definition at line 87 of file memory.hpp.
|
private |
Definition at line 94 of file memory.hpp.
|
private |
Definition at line 95 of file memory.hpp.
Referenced by compare(), and sortElements().
|
private |
Definition at line 90 of file memory.hpp.
Referenced by clear(), convertColumns(), deleteBulk(), deleteEntry(), extractRange(), extractTable(), getComment(), getLastSaved(), getMetaData(), getSaveStatus(), getSize(), importTable(), markModified(), Memory(), operator=(), resample(), retouch1D(), retouch2D(), save(), setCategories(), setHeadLineElement(), setMetaData(), setSaveStatus(), smooth(), sortElements(), writeComment(), and writeData().
|
private |
Definition at line 89 of file memory.hpp.
Referenced by Allocate(), and_func(), avg(), clear(), cmp(), cnt(), compare(), NumeRe::FileAdapter::condenseDataSet(), convert(), convertColumns(), copyElementsInto(), countIfEqual(), createTableHeaders(), deleteBulk(), deleteEntry(), extractRange(), extractTable(), findCols(), getAppendedZeroes(), getBins(), getCategoryList(), getCols(), getElemsInColumn(), getFilledElemsInColumn(), getHeadlineCount(), getHeadLineElement(), getIndex(), getLines(), getOneWayAnova(), getRank(), getSize(), getSpearmanCorr(), getType(), importTable(), isValidElement(), isValue(), max(), maxpos(), med(), MemoryManager::melt(), min(), minpos(), norm(), num(), NumeRe::FileAdapter::openFile(), operator=(), or_func(), pct(), prd(), readMem(), readMemAsMatrix(), readMemAsString(), readMixedMem(), reorderColumn(), resample(), retouch(), save(), setCategories(), setHeadLineElement(), shrink(), size(), smooth(), sortElements(), std(), sum(), writeData(), writeDataDirect(), writeDataDirectUnsafe(), writeSingletonData(), and xor_func().
|
mutableprivate |
Definition at line 92 of file memory.hpp.
Referenced by clear(), deleteBulk(), deleteEntry(), getLines(), markModified(), MemoryManager::melt(), Memory(), operator=(), resample(), shrink(), sortElements(), and writeData().