20#include <gsl/gsl_statistics.h>
21#include <gsl/gsl_sort.h>
22#include <gsl/gsl_cdf.h>
26#include "../../kernel.hpp"
27#include "../io/file.hpp"
28#include "../ui/error.hpp"
29#include "../settings.hpp"
30#include "../utils/tools.hpp"
31#include "../version.h"
32#include "../maths/resampler.h"
33#include "../maths/statslogic.hpp"
34#include "../maths/matdatastructures.hpp"
36#define MAX_TABLE_SIZE 1e8
37#define MAX_TABLE_COLS 1e4
38#define DEFAULT_COL_TYPE ValueColumn
123 for (
size_t j = 0; j <
memArray.size(); j++)
128 if (!
memArray[j]->m_sHeadLine.length())
166 #pragma omp parallel for
167 for (
size_t i = 0; i < other.
memArray.size(); i++)
269 if (col && col->size() > nReturn)
270 nReturn = col->size();
314 return memArray[col]->getNumFilledElements();
334 bytes += col->getBytes();
353 return memArray[_nCol]->getValue(_nLine);
404 int nBaseLine =
intCast(_dLine) + (_dLine < 0 ? -1 : 0);
405 int nBaseCol =
intCast(_dCol) + (_dCol < 0 ? -1 : 0);
408 double x = _dLine - nBaseLine;
409 double y = _dCol - nBaseCol;
431 return f00*(1.0-x)*(1.0-y) + f10*x*(1.0-y) + f01*(1.0-x)*y + f11*x*y;
446 std::vector<mu::value_type> vReturn;
449 vReturn.push_back(NAN);
452 vReturn.resize(_vLine.
size()*_vCol.
size(), NAN);
455 for (
size_t j = 0; j < _vCol.
size(); j++)
465 for (
size_t i = 0; i < _vLine.
size(); i++)
470 if (_vLine[i] >= elems)
478 vReturn[j + i * _vCol.
size()] =
memArray[_vCol[j]]->getValue(_vLine[i]);
504 #pragma omp parallel for
505 for (
size_t j = 0; j < _vCol.
size(); j++)
507 if (_vCol[j] < 0 || !
memArray[_vCol[j]])
512 std::vector<mu::value_type> vEntries =
memArray[_vCol[j]]->getValue(_vLine);
514 for (
size_t i = 0; i < vEntries.size(); i++)
516 mat(i, j) = vEntries[i];
559 vReturn.push_back(
"");
562 vReturn.resize(_vLine.
size()*_vCol.
size(),
"\"\"");
565 for (
size_t j = 0; j < _vCol.
size(); j++)
575 for (
size_t i = 0; i < _vLine.
size(); i++)
580 if (_vLine[i] >= elems)
588 vReturn[j + i * _vCol.
size()] =
memArray[_vCol[j]]->getValueAsString(_vLine[i]);
611 vReturn.push_back(
"");
614 vReturn.resize(_vLine.
size()*_vCol.
size(),
"\"\"");
617 for (
size_t j = 0; j < _vCol.
size(); j++)
627 for (
size_t i = 0; i < _vLine.
size(); i++)
632 if (_vLine[i] >= elems)
640 vReturn[j + i * _vCol.
size()] =
memArray[_vCol[j]]->getValueAsParserString(_vLine[i]);
661 for (
size_t i = 0; i < _vCol.
size(); i++)
667 else if (type !=
memArray[_vCol[i]]->m_type
689 for (
size_t i = 0; i < _vCol.
size(); i++)
695 const std::vector<std::string>& vCategories =
static_cast<CategoricalColumn*
>(
memArray[_vCol[i]].get())->getCategories();
697 for (
size_t c = 0; c < vCategories.size(); c++)
699 vRet.push_back(vCategories[c]);
732 if (_vCol.
size() * _vLine.
size() > 10000)
734 #pragma omp parallel for
735 for (
size_t j = 0; j < _vCol.
size(); j++)
743 for (
size_t j = 0; j < _vCol.
size(); j++)
771 vTarget->assign(1, NAN);
774 vTarget->assign(_vLine.
size()*_vCol.
size(), NAN);
777 for (
size_t j = 0; j < _vCol.
size(); j++)
787 for (
size_t i = 0; i < _vLine.
size(); i++)
792 if (_vLine[i] >= elems)
800 (*vTarget)[j + i * _vCol.
size()] =
memArray[_vCol[j]]->getValue(_vLine[i]);
858 if (col && !col->size())
865 for (
int i =
memArray.size()-1; i >= 0; i--)
890 #pragma omp parallel for
891 for (
size_t i = 0; i <
memArray.size(); i++)
927 for (
size_t i = 0; i < _vCol.
size(); i++)
929 if (_vCol[i] < 0 || _vCol[i] >= (
int)
memArray.size())
968 for (
size_t i = 0; i < _vCol.
size(); i++)
970 if (_vCol[i] < 0 || _vCol[i] >= (
int)
memArray.size())
1045 vector<string> vHeadLines;
1047 for (
unsigned int i = 0; i < _vCol.
size(); i++)
1079 memArray[_i]->m_sHeadLine = _sHead;
1155 size_t nHeadlineCount = 1;
1161 if (!col || col->m_sHeadLine.find(
'\n') == std::string::npos)
1164 size_t nLinebreak = 0;
1167 for (
size_t n = 0; n < col->m_sHeadLine.length() - 2; n++)
1169 if (col->m_sHeadLine[n] ==
'\n')
1174 if (nLinebreak + 1 > nHeadlineCount)
1175 nHeadlineCount = nLinebreak + 1;
1178 return nHeadlineCount;
1228 memArray[_nCol]->setValue(_nLine, _dData);
1252 memArray[_nCol]->setValue(_nLine, _dData);
1273 memArray[_nCol]->setValue(_nLine, _dData);
1289 if (!
memArray.size() && !sValue.length())
1296 memArray[_nCol]->setValue(_nLine, sValue);
1298 if (!sValue.length() || _nLine >=
nCalcLines)
1320 int nDirection =
LINES;
1328 bool rewriteColumn =
false;
1331 rewriteColumn =
true;
1341 for (
size_t i = 0; i < _idx.
row.
size(); i++)
1343 for (
size_t j = 0; j < _idx.
col.
size(); j++)
1351 if (nDirection ==
COLS)
1396 bool rewriteColumn =
false;
1399 rewriteColumn =
true;
1404 for (
size_t i = 0; i < _idx.
row.
size(); i++)
1406 for (
size_t j = 0; j < _idx.
col.
size(); j++)
1433 int nDirection =
LINES;
1435 if (_values.size() == 1)
1441 bool rewriteColumn =
false;
1444 rewriteColumn =
true;
1454 for (
size_t i = 0; i < _idx.
row.
size(); i++)
1456 for (
size_t j = 0; j < _idx.
col.
size(); j++)
1458 if (nDirection ==
COLS)
1460 if (!i && rewriteColumn && (
int)
memArray.size() > _idx.
col[j])
1463 if (_values.size() > i)
1468 if (_values.size() > j)
1489 bool rewriteColumn =
false;
1492 rewriteColumn =
true;
1497 for (
size_t i = 0; i < _idx.
row.
size(); i++)
1499 for (
size_t j = 0; j < _idx.
col.
size(); j++)
1501 if (!i && rewriteColumn && (
int)
memArray.size() > _idx.
col[j])
1558 return vector<int>();
1560 bool bError =
false;
1561 bool bReturnIndex =
false;
1581 for (
int i = i1; i <= i2; i++)
1582 vIndex.push_back(i);
1587 bReturnIndex =
true;
1594 std::vector<int> vPrivateIndex = vIndex;
1598 #pragma omp parallel for firstprivate(vPrivateIndex)
1599 for (
int i = j1; i <= j2; i++)
1602 if (i > j1 && bReturnIndex)
1606 if (!
qSort(&vPrivateIndex[0], i2 - i1 + 1, i, 0, i2 - i1, nSign))
1614 vIndex = vPrivateIndex;
1622 for (
int j = i1; j <= i2; j++)
1623 vPrivateIndex[j-i1] = j;
1640 while (sCols.length())
1650 if (keys->
nKey[1] == -1)
1654 for (
int j = keys->
nKey[0]; j < keys->nKey[1]; j++)
1658 if (!
qSort(&vIndex[0], i2 - i1 + 1, j + j1, 0, i2 - i1, nSign))
1688 if (subKeyList->
nKey[1] == -1)
1689 subKeyList->
nKey[1] = subKeyList->
nKey[0] + 1;
1692 for (
int _j = subKeyList->
nKey[0]; _j < subKeyList->nKey[1]; _j++)
1696 subKeyList = subKeyList->
subkeys;
1700 for (
int _j = i1; _j <= i2; _j++)
1719 for (
int i = 0; i <= i2 - i1; i++)
1725 if (bError || !bReturnIndex)
1726 return vector<int>();
1789 return memArray[col]->isValid(line);
1813 #pragma omp parallel for
1814 for (
size_t j = 0; j < cols.
size(); j++)
1845 #pragma omp parallel for
1846 for (
size_t j = 0; j < _table.
getCols(); j++)
1848 if (j >= cols.
size())
1875 memArray[cols[j]]->insert(lines, tabCol);
1897bool Memory::save(
string _sFileName,
const string& sTableName,
unsigned short nPrecision)
1990 bool bHasFirstLine = _vLine.
min() == 0;
1993 #pragma omp parallel for
1994 for (
size_t j = 0; j < _vCol.
size(); j++)
1996 if (_vCol[j] >= 0 && _vCol[j] < (
int)
memArray.size() &&
memArray[_vCol[j]])
1997 memArray[_vCol[j]]->deleteElements(_vLine);
2023 constexpr size_t MINTHREADCOUNT = 16;
2024 constexpr size_t MINELEMENTPERCOL = 1000;
2028 if (operation.size() >= MINTHREADCOUNT && _vLine.
size() >= MINELEMENTPERCOL)
2030 #pragma omp parallel for
2031 for (
size_t j = 0; j < _vCol.
size(); j++)
2041 for (
size_t i = 0; i < _vLine.
size(); i++)
2046 if (_vLine[i] >= elems)
2054 operation[j](
readMem(_vLine[i], _vCol[j]));
2060 for (
size_t j = 0; j < _vCol.
size(); j++)
2070 for (
size_t i = 0; i < _vLine.
size(); i++)
2075 if (_vLine[i] >= elems)
2083 operation[j](
readMem(_vLine[i], _vCol[j]));
2116 for (
const auto& val : vLogic)
2119 return sqrt(dStd / (
num(_vLine, _vCol) - 1.0));
2137 return sum(_vLine, _vCol) /
num(_vLine, _vCol);
2166 for (
const auto& val : vLogic)
2168 if (
isnan(dMax) || dMax < val.m_val.real())
2169 dMax = val.m_val.real();
2201 for (
const auto& val : vLogic)
2203 if (
isnan(dMin) || dMin > val.m_val.real())
2204 dMin = val.m_val.real();
2236 for (
const auto& val : vLogic)
2270 for (
const auto& val : vLogic)
2301 for (
unsigned int j = 0; j < _vCol.
size(); j++)
2310 nInvalid += _vLine.
size();
2314 for (
unsigned int i = 0; i < _vLine.
size(); i++)
2316 if (_vLine[i] < 0 || _vLine[i] >= elems ||
mu::isnan(
readMem(_vLine[i], _vCol[j])))
2321 return (_vLine.
size() * _vCol.
size()) - nInvalid;
2345 double dRetVal = NAN;
2347 for (
unsigned int j = 0; j < _vCol.
size(); j++)
2357 for (
unsigned int i = 0; i < _vLine.
size(); i++)
2362 if (_vLine[i] >= elems)
2405 for (
unsigned int j = 0; j < _vCol.
size(); j++)
2415 for (
unsigned int i = 0; i < _vLine.
size(); i++)
2420 if (_vLine[i] >= elems)
2457 bool isTrue =
false;
2459 for (
unsigned int j = 0; j < _vCol.
size(); j++)
2469 for (
unsigned int i = 0; i < _vLine.
size(); i++)
2474 if (_vLine[i] >= elems)
2521 for (
unsigned int j = 0; j < _vCol.
size(); j++)
2531 for (
unsigned int i = 0; i < _vLine.
size(); i++)
2533 if (_vLine[i] < 0 || _vLine[i] >= elems)
2538 return (_vLine.
size() * _vCol.
size()) - nInvalid;
2567 for (
const auto& val : vLogic)
2608 double dKeep = dRef.real();
2613 else if (_nType < 0)
2616 switch (
intCast(fabs(_nType)))
2619 nType |= RETURN_VALUE;
2622 nType |= RETURN_FIRST;
2625 nType |= RETURN_FIRST | RETURN_VALUE;
2629 for (
long long int j = 0; j < _vCol.
size(); j++)
2639 for (
long long int i = 0; i < _vLine.
size(); i++)
2644 if (_vLine[i] >= elems)
2659 if (nType & RETURN_VALUE)
2662 if (_vLine[0] == _vLine[_vLine.
size() - 1])
2663 return _vCol[j] + 1;
2665 return _vLine[i] + 1;
2667 else if (nType & RETURN_GE && val.real() > dRef.real())
2669 if (nType & RETURN_FIRST)
2671 if (nType & RETURN_VALUE)
2674 if (_vLine[0] == _vLine[_vLine.
size() - 1])
2675 return _vCol[j] + 1;
2677 return _vLine[i] + 1;
2680 if (nKeep == -1 || val.real() < dKeep)
2683 if (_vLine[0] == _vLine[_vLine.
size() - 1])
2691 else if (nType & RETURN_LE && val.real() < dRef.real())
2693 if (nType & RETURN_FIRST)
2695 if (nType & RETURN_VALUE)
2698 if (_vLine[0] == _vLine[_vLine.
size() - 1])
2699 return _vCol[j] + 1;
2701 return _vLine[i] + 1;
2704 if (nKeep == -1 || val.real() > dKeep)
2707 if (_vLine[0] == _vLine[_vLine.
size() - 1])
2720 else if (nType & RETURN_VALUE)
2747 vector<double> vData;
2749 vData.reserve(_vLine.
size()*_vCol.
size());
2751 for (
unsigned int j = 0; j < _vCol.
size(); j++)
2761 for (
unsigned int i = 0; i < _vLine.
size(); i++)
2766 if (_vLine[i] >= elems)
2777 vData.push_back(val.real());
2784 size_t nCount =
qSortDouble(&vData[0], vData.size());
2789 return gsl_stats_median_from_sorted_data(&vData[0], 1, nCount);
2814 vector<double> vData;
2816 vData.reserve(_vLine.
size()*_vCol.
size());
2818 if (dPct.real() >= 1 || dPct.real() <= 0)
2821 for (
unsigned int j = 0; j < _vCol.
size(); j++)
2831 for (
unsigned int i = 0; i < _vLine.
size(); i++)
2836 if (_vLine[i] >= elems)
2847 vData.push_back(val.real());
2855 size_t nCount =
qSortDouble(&vData[0], vData.size());
2860 return gsl_stats_quantile_from_sorted_data(&vData[0], 1, nCount, dPct.real());
2876 return std::vector<mu::value_type>(2, 0.0);
2882 int nGridOffset = 2*((dir &
GRID) != 0);
2886 return std::vector<mu::value_type>({lines, cols});
2887 else if (dir ==
GRID)
2889 else if (dir &
LINES)
2892 std::vector<mu::value_type> vSizes;
2894 for (
size_t i = 0; i < _vIndex.
size(); i++)
2896 if (_vIndex[i] < 0 || _vIndex[i] >= lines)
2899 for (
int j =
memArray.size()-1; j >= 0; j--)
2903 vSizes.push_back(j+1 - nGridOffset);
2910 vSizes.push_back(NAN);
2914 else if (dir &
COLS)
2917 std::vector<mu::value_type> vSizes;
2919 for (
size_t j = 0; j < _vIndex.
size(); j++)
2921 if (_vIndex[j] < nGridOffset || _vIndex[j] >= cols)
2928 vSizes.push_back(NAN);
2933 return std::vector<mu::value_type>(2, 0.0);
2949 return std::vector<mu::value_type>(1, NAN);
2955 int nGridOffset = 2*((dir &
GRID) != 0);
2962 lines = vSize.front().real();
2963 cols = vSize.back().real()+nGridOffset;
2970 std::vector<mu::value_type> vPos;
2972 for (
size_t j = 0; j < _vIndex.
size(); j++)
2974 if (_vIndex[j] < nGridOffset || _vIndex[j] >= cols)
2981 vPos.push_back(NAN);
2986 std::vector<mu::value_type> vPos;
2993 for (
size_t i = 0; i < _vIndex.
size(); i++)
2995 if (_vIndex[i] < 0 || _vIndex[i] >= lines)
3008 return std::vector<mu::value_type>(1, NAN);
3011 if (dir ==
ALL || dir ==
GRID)
3012 return std::vector<mu::value_type>({_vIndex[pos]+1, vPos[pos]});
3030 return std::vector<mu::value_type>(1, NAN);
3036 int nGridOffset = 2*((dir &
GRID) != 0);
3043 lines = vSize.front().real();
3044 cols = vSize.back().real()+nGridOffset;
3051 std::vector<mu::value_type> vPos;
3053 for (
size_t j = 0; j < _vIndex.
size(); j++)
3055 if (_vIndex[j] < nGridOffset || _vIndex[j] >= cols)
3062 vPos.push_back(NAN);
3067 std::vector<mu::value_type> vPos;
3074 for (
size_t i = 0; i < _vIndex.
size(); i++)
3076 if (_vIndex[i] < 0 || _vIndex[i] >= lines)
3089 return std::vector<mu::value_type>(1, NAN);
3092 if (dir ==
ALL || dir ==
GRID)
3093 return std::vector<mu::value_type>({_vIndex[pos]+1, vPos[pos]});
3142 std::vector<mu::value_type> vColIndices;
3144 for (
const auto& sName : vColNames)
3146 for (
size_t i = 0; i <
memArray.size(); i++)
3149 vColIndices.push_back(i+1.0);
3153 if (!vColIndices.size())
3154 vColIndices.push_back(NAN);
3173 const std::vector<std::string>& vStringValues)
const
3175 std::vector<mu::value_type> vCounted;
3177 for (
size_t j = 0; j < _vCols.
size(); j++)
3184 for (
const auto& val : vValues)
3188 for (
size_t i = 0; i <
memArray[_vCols[j]]->size(); i++)
3194 vCounted.push_back(count);
3199 for (
const auto& sVal : vStringValues)
3203 for (
size_t i = 0; i <
memArray[_vCols[j]]->size(); i++)
3205 if (
memArray[_vCols[j]]->getValueAsInternalString(i) == sVal)
3209 vCounted.push_back(count);
3214 if (!vCounted.size())
3215 vCounted.push_back(NAN);
3233std::vector<mu::value_type>
Memory::getIndex(
size_t col,
const std::vector<mu::value_type>& vValues,
3234 const std::vector<std::string>& vStringValues)
const
3236 std::vector<mu::value_type> vIndex;
3239 return std::vector<mu::value_type>(1, NAN);
3243 for (
const auto& val : vValues)
3246 vIndex.push_back(NAN);
3248 for (
size_t i = 0; i <
memArray[col]->size(); i++)
3251 vIndex.push_back(i+1);
3257 for (
const auto& sVal : vStringValues)
3260 vIndex.push_back(NAN);
3262 for (
size_t i = 0; i <
memArray[col]->size(); i++)
3264 if (
memArray[col]->getValueAsInternalString(i) == sVal)
3265 vIndex.push_back(i+1);
3271 vIndex.push_back(NAN);
3291 if (colCategories >
memArray.size()
3294 || significance >= 1.0
3295 || significance <= 0.0)
3310 for (
const auto& cat : vCategories)
3312 std::vector<mu::value_type> catIndex = _mem.
getIndex(0, std::vector<mu::value_type>(), std::vector<std::string>(1, cat));
3321 std::vector<mu::value_type> vAvg;
3322 std::vector<mu::value_type> vVar;
3323 std::vector<mu::value_type> vNum;
3326 for (
size_t j = 2; j < _mem.
memArray.size(); j++)
3340 for (
size_t i = 0; i < vAvg.size(); i++)
3342 overallVariance += vNum[i] *
intPower(vAvg[i]-overallAvg, 2);
3348 double overallDOF = vVar.size() - 1.0;
3349 double sumOfGroupDOFs = overallNum.real() - vVar.size();
3353 overallVariance /= overallDOF;
3358 res.
m_FRatio = overallVariance / avgGroupVariance;
3359 res.
m_significanceVal = gsl_cdf_fdist_Pinv(1.0 - significance, overallDOF, sumOfGroupDOFs);
3392 for (
size_t i = 0; i < minSize; i++)
3394 vCov += (
readMem(_vIndex1[i], col1) - vAvg1) * (
readMem(_vIndex2[i], col2) - vAvg2);
3470 vRank.insert(vRank.end(), nEqualRanks, vRank.back());
3471 vRank.push_back(vRank.back()+1.0);
3474 vRank.insert(vRank.end(), nEqualRanks, vRank.back());
3475 vRank.push_back(vRank.back()+(nEqualRanks+1.0));
3481 vRank.insert(vRank.end(), nEqualRanks+1, val+0.5*nEqualRanks);
3482 vRank.push_back(val+(nEqualRanks+1.0));
3509 std::vector<mu::value_type> vRank(1, 1.0);
3510 size_t nEqualRanks = 0;
3514 for (
size_t i = 1; i < vIndex.size(); i++)
3518 vRank.push_back(NAN);
3519 else if (_mem.
readMem(vIndex[i]-1, 0) != _mem.
readMem(vIndex[i-1]-1, 0))
3524 vRank.push_back(vRank.back()+1.0);
3534 for (
size_t i = 1; i < vIndex.size(); i++)
3542 vRank.push_back(vRank.back()+1.0);
3555 std::vector<mu::value_type> vRankReordered(vRank);
3557 for (
size_t i = 0; i < vIndex.size(); i++)
3559 vRankReordered[vIndex[i]-1] = vRank[i];
3562 return vRankReordered;
3579 std::vector<mu::value_type> vZScore;
3584 for (
size_t i = 0; i < _vIndex.
size(); i++)
3586 vZScore.push_back((
readMem(_vIndex[i], col) - avgVal) / stdVal);
3604 std::vector<mu::value_type> vBins;
3609 vBins.resize(!nBins || nBins >=
memArray[col]->
size() ? 1 : nBins, NAN);
3621 nBins = vCategories.
size();
3622 vBins.resize(nBins, 0.0);
3624 for (
size_t i = 0; i <
memArray[col]->size(); i++)
3626 if (
memArray[col]->getValue(i).real() > 0.0)
3627 vBins[
memArray[col]->getValue(i).real()-1] += 1.0;
3634 vBins.resize(nBins, 0.0);
3636 for (
size_t i = 0; i <
memArray[col]->size(); i++)
3638 if (
memArray[col]->getValue(i) == 1.0)
3640 else if (
memArray[col]->getValue(i) == 0.0)
3645 vBins.resize(!nBins || nBins >=
memArray[col]->
size() ? 1 : nBins, NAN);
3653 vBins.resize(nBins, 0.0);
3656 double dRange = dMax - dMin;
3658 for (
size_t i = 0; i <
memArray[col]->size(); i++)
3682 bool bUseAppendedZeroes =
false;
3692 bUseAppendedZeroes =
true;
3697 if ((Direction ==
ALL || Direction ==
GRID) && _vLine.
size() < 4)
3700 if ((Direction ==
ALL || Direction ==
GRID) && _vCol.
size() < 4)
3704 if (Direction ==
GRID)
3706 if (bUseAppendedZeroes)
3722 if (Direction ==
ALL || Direction ==
GRID)
3730 return retouch1D(_vLine, _vCol, Direction);
3748 if (Direction ==
LINES)
3750 for (
size_t i = 0; i < _vLine.
size(); i++)
3752 for (
size_t j = 0; j < _vCol.
size(); j++)
3756 for (
size_t _j = j; _j < _vCol.
size(); _j++)
3762 for (
size_t __j = j; __j < _j; __j++)
3766 (
readMem(_vLine[i], _vCol[_j]) -
readMem(_vLine[i], _vCol[j-1])) / (
double)(_j - j) * (
double)(__j - j + 1) +
readMem(_vLine[i], _vCol[j-1]));
3772 else if (_j+1 < _vCol.
size())
3774 for (
size_t __j = j; __j < _j; __j++)
3786 for (
size_t __j = j; __j < _vCol.
size(); __j++)
3798 else if (Direction ==
COLS)
3800 for (
size_t j = 0; j < _vCol.
size(); j++)
3802 for (
size_t i = 0; i < _vLine.
size(); i++)
3806 for (
size_t _i = i; _i < _vLine.
size(); _i++)
3812 for (
size_t __i = i; __i < _i; __i++)
3816 (
readMem(_vLine[_i], _vCol[j]) -
readMem(_vLine[i-1], _vCol[j])) / (
double)(_i - i) * (
double)(__i - i + 1) +
readMem(_vLine[i-1], _vCol[j]));
3822 else if (_i+1 < _vLine.
size())
3824 for (
size_t __i = i; __i < _i; __i++)
3836 for (
size_t __i = i; __i < _vLine.
size(); __i++)
3868 bool bMarkModified =
false;
3870 for (
long long int i = _vLine.
front(); i <= _vLine.
last(); i++)
3872 for (
long long int j = _vCol.
front(); j <= _vCol.
last(); j++)
3881 long long int l,r,t,b;
3886 l = _boundary.
cf() < _vCol.
front() ? _boundary.
ce() : _boundary.
cf();
3887 r = _boundary.
ce() > _vCol.
last() ? _boundary.
cf() : _boundary.
ce();
3888 t = _boundary.
rf() < _vLine.
front() ? _boundary.
re() : _boundary.
rf();
3889 b = _boundary.
re() > _vLine.
last() ? _boundary.
rf() : _boundary.
re();
3896 for (
long long int _n = _boundary.
rf()+1; _n < _boundary.
re(); _n++)
3898 for (
long long int _m = _boundary.
cf()+1; _m < _boundary.
ce(); _m++)
3901 _region.
retouch(_n - _boundary.
rf() - 1,
3902 _m - _boundary.
cf() - 1,
3908 bMarkModified =
true;
3932 return num(_vLine, _vCol) ==
cnt(_vLine, _vCol);
3951 Boundary _boundary(i-1, j-1, 2, 2);
3953 bool reEvaluateBoundaries =
true;
3955 while (reEvaluateBoundaries)
3957 reEvaluateBoundaries =
false;
3963 reEvaluateBoundaries =
true;
3969 reEvaluateBoundaries =
true;
3976 reEvaluateBoundaries =
true;
3982 reEvaluateBoundaries =
true;
4012 for (
size_t n = 0; n < sizes.first; n++)
4015 writeData(_vLine[i+n*(!smoothLines)], _vCol[j+n*smoothLines], _filter->
apply(n, 0,
readMem(_vLine[i+n*(!smoothLines)], _vCol[j+n*smoothLines])));
4017 sum += _filter->
apply(n, 0,
readMem(_vLine[i+n*(!smoothLines)], _vCol[j+n*smoothLines]));
4022 filterBuffer.push(
sum);
4026 if (filterBuffer.size() > sizes.first/2)
4035 if (smoothLines && _vCol.
size()-sizes.first-1 == j)
4037 while (!filterBuffer.empty())
4044 else if (!smoothLines && _vLine.
size()-sizes.first-1 == i)
4046 while (!filterBuffer.empty())
4077 for (
size_t n = 0; n < sizes.first; n++)
4079 for (
size_t m = 0; m < sizes.second; m++)
4092 filterBuffer.push(std::vector<mu::value_type>());
4094 filterBuffer.back().push_back(
sum);
4099 if (filterBuffer.size() > sizes.first/2+1)
4102 for (
size_t k = 0; k < filterBuffer.front().
size(); k++)
4103 writeData(_vLine[i-1], _vCol[k+sizes.second/2+1], filterBuffer.
front()[k]);
4110 if (_vLine.
size()-sizes.first-1 == i && _vCol.
size()-sizes.second-1 == j)
4112 while (!filterBuffer.empty())
4115 for (
size_t k = 0; k < filterBuffer.front().
size(); k++)
4116 writeData(_vLine[i], _vCol[k+sizes.second/2+1], filterBuffer.
front()[k]);
4140 bool bUseAppendedZeroes =
false;
4151 bUseAppendedZeroes =
true;
4158 if ((Direction ==
ALL || Direction ==
GRID) && _vLine.
size() < 4)
4161 if ((Direction ==
ALL || Direction ==
GRID) && _vCol.
size() < 4)
4171 if (Direction ==
GRID)
4174 if (bUseAppendedZeroes)
4190 if (Direction ==
ALL || Direction ==
GRID)
4200 if (_settings.
row == 1u && _settings.
col != 1u)
4201 _settings.
row = _settings.
col;
4202 else if (_settings.
row != 1u && _settings.
col == 1u)
4203 _settings.
col = _settings.
row;
4212 _settings.
alpha = 1.0;
4215 if (Direction ==
LINES)
4222 auto sizes = _filterPtr->getWindowSize();
4223 _settings.
row = sizes.first;
4230 for (
size_t i = 0; i < _vLine.
size(); i++)
4232 for (
size_t j = 1; j < _vCol.
size() - _settings.
row; j++)
4238 else if (Direction ==
COLS)
4245 auto sizes = _filterPtr->getWindowSize();
4246 _settings.
row = sizes.first;
4250 _vLine.
append(vector<int>(_settings.
row/2+1, _vLine.
last()));
4253 for (
size_t j = 0; j < _vCol.
size(); j++)
4255 for (
size_t i = 1; i < _vLine.
size() - _settings.
row; i++)
4261 else if ((Direction ==
ALL || Direction ==
GRID) && _vLine.
size() > 2 && _vCol.
size() > 2)
4268 auto sizes = _filterPtr.get()->getWindowSize();
4269 _settings.
row = sizes.first;
4270 _settings.
col = sizes.second;
4275 _vLine.
prepend(vector<int>(vMirror.rbegin(), vMirror.rend()));
4278 _vLine.
append(vector<int>(vMirror.rbegin(), vMirror.rend()));
4281 _vCol.
prepend(vector<int>(vMirror.rbegin(), vMirror.rend()));
4284 _vCol.
append(vector<int>(vMirror.rbegin(), vMirror.rend()));
4288 for (
size_t i = 1; i < _vLine.
size() - _settings.
row; i++)
4290 for (
size_t j = 1; j < _vCol.
size() - _settings.
col; j++)
4317 bool bUseAppendedZeroes =
false;
4319 int nLinesToInsert = 0;
4320 int nColsToInsert = 0;
4322 static std::vector<std::string> vFilters({
"box",
"tent",
"bell",
"bspline",
"mitchell",
"lanczos3",
"blackman",
4323 "lanczos4",
"lanczos6",
"lanczos12",
"kaiser",
"gaussian",
"catmullrom",
4324 "quadratic_interp",
"quadratic_approx",
"quadratic_mix"});
4326 if (std::find(vFilters.begin(), vFilters.end(), sFilter) == vFilters.end())
4327 sFilter =
"lanczos3";
4333 if (!samples.first || !samples.second)
4341 bUseAppendedZeroes =
true;
4348 if ((Direction ==
ALL || Direction ==
GRID) && _vLine.
size() < 4)
4351 if ((Direction ==
ALL || Direction ==
GRID) && _vCol.
size() < 4)
4356 if (Direction ==
GRID)
4358 if (_vCol.
size() - 2 != _vLine.
size() && !bUseAppendedZeroes)
4365 std::unique_ptr<Resampler> _resampler;
4370 if (Direction ==
ALL || Direction ==
GRID)
4372 if (Direction ==
GRID)
4384 if (samples.first > _vLine.
size())
4385 nLinesToInsert = samples.first - _vLine.
size();
4387 if (samples.second > _vCol.
size())
4388 nColsToInsert = samples.second - _vCol.
size();
4393 samples.second, samples.first,
4396 else if (Direction ==
COLS)
4402 _vCol.
size(), samples.first,
4406 if (samples.first > _vLine.
size())
4407 nLinesToInsert = samples.first - _vLine.
size();
4409 else if (Direction ==
LINES)
4413 samples.second, _vLine.
size(),
4417 if (samples.second > _vCol.
size())
4418 nColsToInsert = samples.second - _vCol.
size();
4428 for (
size_t j = 0; j < _vCol.
size(); j++)
4431 memArray[_vCol[j]]->insertElements(_vLine.
last()+1, nLinesToInsert);
4438 memArray.insert(
memArray.begin()+_vCol.
last()+1, std::make_move_iterator(arr.begin()), std::make_move_iterator(arr.end()));
4442 const double* dOutputSamples = 0;
4443 std::vector<double> dInputSamples(_vCol.
size());
4445 int _final_cols = 0;
4449 if (Direction ==
ALL || Direction ==
GRID || Direction ==
LINES)
4450 _final_cols = samples.second;
4452 _final_cols = _vCol.
size();
4456 for (
size_t i = 0; i < _vLine.
size(); i++)
4458 for (
size_t j = 0; j < _vCol.
size(); j++)
4460 dInputSamples[j] =
readMem(_vLine[i], _vCol[j]).real();
4465 if (!_resampler->put_line(&dInputSamples[0]))
4477 dOutputSamples = _resampler->get_line();
4481 if (!dOutputSamples)
4484 for (
int _fin = 0; _fin < _final_cols; _fin++)
4493 _resampler->put_line(&dInputSamples[0]);
4501 dOutputSamples = _resampler->get_line();
4505 if (!dOutputSamples)
4508 for (
int _fin = 0; _fin < _final_cols; _fin++)
4517 if (Direction !=
LINES && samples.first < _vLine.
size())
4521 if (Direction !=
COLS && samples.second < _vCol.
size())
A table column containing categorical values.
virtual size_t size() const override
Returns the number of elements in this column (will also count invalid ones).
A table column containing numerical values formatted as dates and times.
A table column containing logical values.
This class defines a dynamic size 2D matrix with a single 1D internal buffer. If the internal buffer ...
This class represents a single table in memory, or a - so to say - single memory page to be handled b...
void writeDataDirect(int _nLine, int _nCol, const mu::value_type &_dData)
This member function provides an unsafe but direct way of writing data to the table....
ValueVector readMixedMem(const VectorIndex &_vLine, const VectorIndex &_vCol) const
This member function returns the elements stored at the selected positions.
std::vector< mu::value_type > size(const VectorIndex &_vIndex, int dir) const
Implementation of the SIZE multi argument function.
size_t getHeadlineCount() const
This member function returns the number of lines needed for the table column headline of the selected...
~Memory()
Memory class destructor, which will free the allocated memory.
NumeRe::Table extractTable(const std::string &_sTable, const VectorIndex &lines, const VectorIndex &cols)
Create a copy-efficient table object from the data contents.
bool getSaveStatus() const
Returns, whether the contents of the current table are already saved into either a usual file or into...
bool retouch(VectorIndex _vLine, VectorIndex _vCol, AppDir Direction=ALL)
This method is the retouching main method. It will redirect the control into the specialized member f...
std::vector< mu::value_type > getBins(size_t col, size_t nBins) const
Calculate the number of elements per bin in the selected column.
std::vector< mu::value_type > countIfEqual(const VectorIndex &_vCols, const std::vector< mu::value_type > &vValues, const std::vector< std::string > &vStringValues) const
Counts all values in the selected columns, which match to the passed values (either numerically or st...
int getFilledElemsInColumn(size_t col) const
Returns the number of filled elements in the selected column without the trailing but with the intern...
mu::value_type num(const VectorIndex &_vLine, const VectorIndex &_vCol) const
Implementation for the NUM multi argument function.
bool retouch1D(const VectorIndex &_vLine, const VectorIndex &_vCol, AppDir Direction)
This member function retouches single dimension data (along columns or rows).
void writeComment(const std::string &comment)
Update the comment associated with this table.
mu::value_type readMemInterpolated(double _dLine, double _dCol) const
This member function returns a (bilinearily) interpolated element at the selected double positions.
std::string getComment() const
Return the comment associated with this table.
mu::value_type sum(const VectorIndex &_vLine, const VectorIndex &_vCol) const
Implementation for the SUM multi argument function.
int getLines(bool _bFull=false) const
This member function will return the number of lines, which are currently available in this table.
bool convertColumns(const VectorIndex &_vCol, const std::string &_sType)
This member function tries to convert the selected columns to the target column type,...
mu::value_type xor_func(const VectorIndex &_vLine, const VectorIndex &_vCol) const
Implementation for the XOR multi argument function.
NumeRe::TableMetaData getMetaData() const
Return the internal meta data structure.
mu::value_type std(const VectorIndex &_vLine, const VectorIndex &_vCol) const
Implementation for the STD multi argument function.
void markModified()
Mark this table as modified.
int getCols(bool _bFull=false) const
This member function will return the number of columns, which are currently available in this table.
TableColumnArray memArray
bool isValid() const
Returns true, if at least a single valid value is available in this table.
std::vector< mu::value_type > getZScore(size_t col, const VectorIndex &_vIndex) const
Calculate the standardized values of the selected column.
mu::value_type norm(const VectorIndex &_vLine, const VectorIndex &_vCol) const
Implementation for the NORM multi argument function.
mu::value_type min(const VectorIndex &_vLine, const VectorIndex &_vCol) const
Implementation for the MIN multi argument function.
mu::value_type cmp(const VectorIndex &_vLine, const VectorIndex &_vCol, mu::value_type dRef=0.0, int _nType=0) const
Implementation for the CMP multi argument function.
Memory()
Default constructor.
void writeData(int _nLine, int _nCol, const mu::value_type &_dData)
This member function writes the passed value to the selected position. The table is automatically enl...
mu::value_type pct(const VectorIndex &_vLine, const VectorIndex &_vCol, mu::value_type dPct=0.5) const
Implementation for the PCT multi argument function.
bool retouch2D(const VectorIndex &_vLine, const VectorIndex &_vCol)
This member function retouches two dimensional data (using a specialized filter class instance).
virtual bool isValue(int line, int col) override
Override for the virtual Sorter class member function. Returns true, if the selected element is a val...
size_t getSize() const
Returns the overall used number of bytes for this table.
mu::value_type prd(const VectorIndex &_vLine, const VectorIndex &_vCol) const
Implementation for the PRD multi argument function.
void importTable(NumeRe::Table _table, const VectorIndex &lines, const VectorIndex &cols)
Import data from a copy-efficient table object. Completely replaces the contents, which were in the i...
long long int getLastSaved() const
This member function returns the time- point, where the table was saved last time.
bool isValidElement(size_t _nLine, size_t _nCol) const
Returns true, if the element at the selected positions is valid. Only checks internally,...
void writeDataDirectUnsafe(int _nLine, int _nCol, const mu::value_type &_dData)
This member function provides an even more unsafe but direct way of writing data to the table....
void reorderColumn(const VectorIndex &vIndex, int i1, int i2, int j1=0)
This member function simply reorders the contents of the selected column using the passed index vecto...
bool clear()
This member function frees the internally used memory block completely.
mu::value_type readMem(size_t _nLine, size_t _nCol) const
This member function returns the element stored at the selected position.
Boundary findValidBoundary(const VectorIndex &_vLine, const VectorIndex &_vCol, int i, int j) const
This member function finds the smallest possible boundary around a set of invalid values to be used a...
mu::value_type avg(const VectorIndex &_vLine, const VectorIndex &_vCol) const
Implementation for the AVG multi argument function.
Matrix readMemAsMatrix(const VectorIndex &_vLine, const VectorIndex &_vCol) const
This member function returns the elements stored at the selected positions as a Matrix.
mu::value_type or_func(const VectorIndex &_vLine, const VectorIndex &_vCol) const
Implementation for the OR multi argument function.
std::vector< mu::value_type > minpos(const VectorIndex &_vIndex, int dir) const
Implementation of the MINPOS multi argument function.
void setSaveStatus(bool _bIsSaved)
This member function changes the saved state to the passed value.
mu::value_type getSpearmanCorr(size_t col1, const VectorIndex &_vIndex1, size_t col2, const VectorIndex &_vIndex2) const
Implements the scorr() table method and calculates the spearman correlation coefficient of the two se...
AnovaResult getOneWayAnova(size_t colCategories, size_t colValues, const VectorIndex &_vIndex, double significance) const
Calculates the simples form of a ANOVA F test.
bool smooth(VectorIndex _vLine, VectorIndex _vCol, NumeRe::FilterSettings _settings, AppDir Direction=ALL)
This member function smoothes the data described by the passed VectorIndex indices using the passed F...
mu::value_type getCovariance(size_t col1, const VectorIndex &_vIndex1, size_t col2, const VectorIndex &_vIndex2) const
Implements the cov() table method and calculates the covariance of the two selected columns.
bool onlyValidValues(const VectorIndex &_vLine, const VectorIndex &_vCol) const
This method is a wrapper for detecting, whether a row or column does only contain valid values (no Na...
void writeSingletonData(Indices &_idx, const mu::value_type &_dData)
This member function writes multiple copies of a single value to a range in the table....
std::vector< mu::value_type > maxpos(const VectorIndex &_vIndex, int dir) const
Implementation of the MAXPOS multi argument function.
std::vector< mu::value_type > getRank(size_t col, const VectorIndex &_vIndex, RankingStrategy _strat) const
Rank the selected column according the selected ranking strategy.
mu::value_type med(const VectorIndex &_vLine, const VectorIndex &_vCol) const
Implementation for the MED multi argument function.
mu::value_type getPearsonCorr(size_t col1, const VectorIndex &_vIndex1, size_t col2, const VectorIndex &_vIndex2) const
Implements the pcorr() table method and calculates the pearson correlation coefficient of the two sel...
mu::value_type cnt(const VectorIndex &_vLine, const VectorIndex &_vCol) const
Implementation for the CNT multi argument function.
void copyElementsInto(std::vector< mu::value_type > *vTarget, const VectorIndex &_vLine, const VectorIndex &_vCol) const
This member function will copy the selected elements into the passed vector instance....
int getElemsInColumn(size_t col) const
Returns the number of elements in the selected column (but might contain invalid values).
TableColumn::ColumnType getType(const VectorIndex &_vCol) const
Returns the "common" type of the selected columns.
Memory & operator=(const Memory &other)
Assignment operator.
bool resizeMemory(size_t _nLines, size_t _nCols)
This member function will handle all memory grow operations by doubling the base size,...
size_t getAppendedZeroes(size_t _i) const
Returns the number of empty cells at the end of the selected columns.
virtual int compare(int i, int j, int col) override
Override for the virtual Sorter class member function. Returns 0, if both elements are equal,...
bool Allocate(size_t _nNCols, bool shrink=false)
This member function is the Memory class allocator. It will handle all memory allocations.
ValueVector getCategoryList(const VectorIndex &_vCol) const
Returns a key-value list containing the categories and their respective index.
void deleteEntry(int _nLine, int _nCol)
This member function deletes a single entry from the memory table.
std::vector< int > sortElements(int i1, int i2, int j1=0, int j2=0, const std::string &sSortingExpression="")
This member function is the interface function for the Sorter class. It will pre- evaluate the passed...
void smoothingWindow2D(const VectorIndex &_vLine, const VectorIndex &_vCol, size_t i, size_t j, NumeRe::Filter *_filter)
This private member function realizes the application of a smoothing window to 2D data sets.
mu::value_type max(const VectorIndex &_vLine, const VectorIndex &_vCol) const
Implementation for the MAX multi argument function.
mu::value_type and_func(const VectorIndex &_vLine, const VectorIndex &_vCol) const
Implementation for the AND multi argument function.
bool setCategories(const VectorIndex &_vCol, const std::vector< std::string > &vCategories)
Updates the categories of a categorical column and switches the column type if necessary.
void calculateStats(const VectorIndex &_vLine, const VectorIndex &_vCol, std::vector< StatsLogic > &operation) const
Driver code for simplifying the calculation of various stats using OpenMP, if possible.
bool shrink()
This member function shrinks the table memory to the smallest possible dimensions reachable in powers...
void setMetaData(const NumeRe::TableMetaData &meta)
Update the internal meta data with the passed one.
std::vector< mu::value_type > findCols(const std::vector< std::string > &vColNames) const
Finds the columns IDs, whose headlines match to the passed strings. Can return multiple column IDs pe...
Memory * extractRange(const VectorIndex &_vLine, const VectorIndex &_vCol) const
This member function extracts a range of this table and returns it as a new Memory instance.
ValueVector readMemAsString(const VectorIndex &_vLine, const VectorIndex &_vCol) const
This member function returns the elements stored at the selected positions.
NumeRe::TableMetaData m_meta
bool save(std::string _sFileName, const std::string &sTableName, unsigned short nPrecision)
This member function is used for saving the contents of this memory page into a file....
void createTableHeaders()
This member function creates the column headlines, if they are empty.
bool setHeadLineElement(size_t _i, const std::string &_sHead)
Writes a new table column headline to the selected column.
void convert()
This member function tries to convert all string columns to value columns, if it is possible.
bool bSortCaseInsensitive
bool resample(VectorIndex _vLine, VectorIndex _vCol, std::pair< size_t, size_t > samples, AppDir Direction=ALL, std::string sFilter="lanczos3")
This member function resamples the data described by the passed coordinates using the new samples nSa...
void smoothingWindow1D(const VectorIndex &_vLine, const VectorIndex &_vCol, size_t i, size_t j, NumeRe::Filter *_filter, bool smoothLines)
This private member function realizes the application of a smoothing window to 1D data sets.
std::vector< mu::value_type > getIndex(size_t col, const std::vector< mu::value_type > &vValues, const std::vector< std::string > &vStringValues) const
Determines the positions of all elements, which correspond to the passed values (either numerically o...
void deleteBulk(const VectorIndex &_vLine, const VectorIndex &_vCol)
This member function deletes a whole range of entries from the memory table.
std::string getHeadLineElement(size_t _i) const
Returns the table column headline for the selected column. Will return a default headline,...
This is an abstract base class for any type of a data filter. Requires some methods to be implemented...
virtual mu::value_type apply(size_t i, size_t j, const mu::value_type &val) const =0
Virtual method for applying the filter to a distinct value. Has to be implemented in all child classe...
FilterBuffer2D & get2DBuffer()
This method returns the internal filtering buffer queue for 2D data to store already smoothed points ...
bool isConvolution() const
This method returns, whether the current filter is a convolution, ie. whether the returned value may ...
FilterBuffer & getBuffer()
This method returns the internal filtering buffer queue to store already smoothed points avoiding lea...
std::pair< size_t, size_t > getWindowSize() const
This method returns the window size of the current filter as a std::pair in the order (row,...
Template class representing a generic file. This class may be specified for the main data type contai...
void setTextfilePrecision(unsigned short nPrecision)
Set the precision, which shall be used to convert the floating point numbers into strings.
void setTableName(const std::string &name)
Set the table's name.
void setData(TableColumnArray *data, long long int rows, long long int cols)
This method refernces the passed external data internally. The data is not copied and must exist as l...
virtual bool write()=0
Pure virtual declaration of the write access method. Has to be implemented in all derived classes and...
void setDimensions(long long int rows, long long int cols)
Sets the dimensions of the data table, which will be used in the future. Clears the internal memory i...
std::string getExtension()
Returns the file extension.
This class resembles the binary NumeRe data file format. The data is red and written in binary mode u...
This class is a specialized WeightedLinearFilter used to retouch missing data values.
mu::value_type retouch(size_t i, size_t j, const mu::value_type &val, const mu::value_type &med)
This method is a wrapper to retouch only invalid values. The default value of invalid values is the m...
void setBoundaries(const std::vector< mu::value_type > &left, const std::vector< mu::value_type > &right, const std::vector< mu::value_type > &top=std::vector< mu::value_type >(), const std::vector< mu::value_type > &bottom=std::vector< mu::value_type >())
This method is used to update the internal filter boundaries.
This data container is a copy- efficient table to interchange data between Kernel and GUI.
void setName(const std::string &_sName)
Setter function for the table name.
void setColumn(size_t j, TableColumn *column)
Assigns a whole column to the internal array.
size_t getCols() const
Get the number of columns.
TableMetaData getMetaData() const
Getter function for the table meta data.
void setMetaData(const TableMetaData &meta)
Setter function for the table meta data.
size_t getLines() const
Get the number of lines.
TableColumn * getColumn(size_t j) const
Returns a copy of the internal column array or a nullptr, if the column does not exist or is empty.
static void issueWarning(std::string sWarningMessage)
This static function may be used to issue a warning to the user. The warning will be printed by the t...
@ STATUS_SCAN_BUFFER_FULL
ColumnKeys * evaluateKeyList(std::string &sKeyList, long long int nColumnCount)
This public member function creates a ColumnKeys object from a string containing the hierarchical sor...
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 ...
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....
A table column containing only strings as values.
Common exception class for all exceptions thrown in NumeRe.
@ INTERNAL_RESAMPLER_ERROR
static size_t invalid_position
A table column containing only numerical values.
This class abstracts all the index logics, i.e. the logical differences between single indices and in...
bool isValid() const
This member function determines, whether the internal index set is valid.
void linearize()
This member function linearizes the contents of a vector-described index set. The vectorial informati...
VectorIndex subidx(size_t pos, size_t nLen=std::string::npos) const
This member function returns a subset of the internal stored index just like the std::string::substr(...
void setOpenEndIndex(int nLast) const
This member function can be used to replace the open end state with a defined index value although th...
void prepend(const std::vector< int > &vVector)
This function will prepend the passed vector before the beginning of the index vector....
int last() const
This member function returns the last index value, which can be reached by the values stored internal...
int max() const
This function calculates the maximal index value obtained from the values stored internally.
size_t size() const
This member function returns the size of the indices stored in this class.
bool isOpenEnd() const
This member function determines, whether the internal index set has an open end.
void setRange(int nMin, int nMax)
This member function can be used to force the indices stored internally to be in a defined interval....
void append(const std::vector< int > &vVector)
This function will append the passed vector to the end of the index vector. The internal storage is e...
std::string to_string() const
This member function converts the vector indexes contents into a human-readable string representation...
bool isOrdered() const
This member function determines, whether the single indices are in the correct order.
bool isExpanded() const
This member function determines, whether the indices are calculated or actual vectorial indices.
std::vector< int > getVector() const
This member function returns a STL vector, which will resemble the indices stored internally....
int min() const
This member function calculates the minimal index value obtained from the values stored internally.
int & front()
This member function returns a reference to the first index value stored internally.
static void evaluateRankingStrategy(std::vector< mu::value_type > &vRank, size_t &nEqualRanks, Memory::RankingStrategy _strat)
Evaluate the identical ranked values according the selected ranking strategy.
static bool closeEnough(double d1, double d2)
Static helper function to ensure that two doubles are actually close enough to be considered equal.
static mu::value_type nanAvg(const std::vector< mu::value_type > &values)
This static helper function calculates the average value respecting NaNs.
std::vector< std::string > ValueVector
This type defines a generic value vector.
std::complex< double > intPower(const std::complex< double > &, int)
This function calculates the power of a value with the specialization that the exponent is an integer...
GenericFile * getFileByType(const string &filename)
This function determines the correct class to be used for the filename passed to this function....
std::queue< mu::value_type > FilterBuffer
Typedef for simplifying the usage of the buffer.
std::queue< std::vector< mu::value_type > > FilterBuffer2D
Filter * createFilter(const FilterSettings &_settings)
This function creates an instance of the filter specified by the passed FilterSettings structure.
CONSTCD11 std::chrono::duration< Rep, Period > abs(std::chrono::duration< Rep, Period > d)
MUP_BASETYPE value_type
The numeric datatype used by the parser.
bool isnan(const value_type &v)
std::vector< double > real(const std::vector< value_type > &vVec)
value_type rint(value_type v)
bool isreal(value_type *v, int nElem)
std::string get(const std::string &sUrl, const std::string &sUserName, const std::string &sPassWord)
Get the contents of a URL.
int findParameter(const std::string &sCmd, const std::string &sParam, const char cFollowing)
This function searches the passed parameter in the passed command string. If something is found,...
Contains the relevant results of the ANOVA F test.
mu::value_type m_significance
mu::value_type m_significanceVal
This structure contains the information of a two-dimensional boundary.
Structure for the sorting functionality: used for the recursive definition of the index columns for s...
This structure is central for managing the indices of a table or cluster read or write data access....
This structure contains the necessary information to create an instance of one of the following filte...
Simplify the creation of some statistics by externalizing the operation code and unifying the driver ...
Abstract table column, which allows using it to compose the data table in each Memory instance.
std::vector< std::string > getValueAsInternalString(const VectorIndex &idx) const
Returns the table column's contents as a vector containing internal strings.
static ColumnType stringToType(const std::string &sType)
Converts the passed string representation to a ColumnType value.
static std::string getDefaultColumnHead(size_t colNo)
Creates a default column headline for a column, which can be used without an instance of this class.
long long int intCast(const std::complex< double > &)
Casts the real part of the complex number to an integer and avoids rounding errors.
std::string toString(int)
Converts an integer to a string without the Settings bloat.
std::unique_ptr< TableColumn > TblColPtr
Typedef for simplifying the usage of a smart pointer in combination with a TableColumn instance.
std::vector< TblColPtr > TableColumnArray
This typedef represents the actual table, which is implemented using a std::vector.
void convert_for_overwrite(TblColPtr &col, size_t colNo, TableColumn::ColumnType type)
This function deletes the contents of a column, if necessary, and creates a new column with the corre...
void convert_if_empty(TblColPtr &col, size_t colNo, TableColumn::ColumnType type)
Tries to convert a column if the column does not contain any data (with the exception of the header).