40 #ifndef ERGO_MAT_ACC_EXTRAPOLATE_HEADER 41 #define ERGO_MAT_ACC_EXTRAPOLATE_HEADER 51 template<
class Treal,
class Tworker>
56 void Scan(
const Tworker & worker,
61 Treal* errorList_frob_,
62 Treal* errorList_eucl_,
63 Treal* errorList_maxe_,
77 template<
class Treal,
class Tworker>
79 : matrix_size_block_info(matrix_size_block_info_)
83 template<
class Treal,
class Tworker>
91 baseThresh = firstParam;
92 threshList.resize(nSteps);
93 errorList_frob.resize(nSteps);
94 errorList_eucl.resize(nSteps);
95 errorList_maxe.resize(nSteps);
96 timeList.resize(nSteps);
101 matrix_size_block_info);
104 matrix_size_block_info);
107 matrix_size_block_info);
110 worker.ComputeMatrix(firstParam, accurateMatrix);
112 Treal currParam = firstParam;
113 for(
int i = 0; i < nSteps; i++)
115 currParam *= stepFactor;
116 time_t startTime, endTime;
118 worker.ComputeMatrix(currParam, otherMatrix);
120 timeList[i] = endTime - startTime;
121 threshList[i] = currParam;
123 errorMatrix = otherMatrix;
124 errorMatrix += (
ergo_real)(-1) * accurateMatrix;
127 errorList_frob[i] = errorMatrix.
frob();
129 Treal euclAcc = 1e-11;
130 errorList_eucl[i] = errorMatrix.
eucl(euclAcc);
138 template<
class Treal,
class Tworker>
141 Treal* errorList_frob_,
142 Treal* errorList_eucl_,
143 Treal* errorList_maxe_,
146 for(
int i = 0; i < nScanSteps; i++)
148 threshList_[i] = threshList[i];
149 errorList_frob_[i] = errorList_frob[i];
150 errorList_eucl_[i] = errorList_eucl[i];
151 errorList_maxe_[i] = errorList_maxe[i];
152 timeList_ [i] = timeList [i];
double ergo_real
Definition: realtype.h:69
std::vector< Treal > timeList
Definition: mat_acc_extrapolate.h:73
Utilities related to the hierarchical matrix library (HML), including functions for setting up permut...
Describes dimensions of matrix and its blocks on all levels.
Definition: SizesAndBlocks.h:45
Definition: mat_acc_extrapolate.h:52
ergo_real compute_maxabs_sparse(const Tmatrix &M)
Definition: matrix_utilities.h:97
MatAccInvestigator(mat::SizesAndBlocks const &matrix_size_block_info_)
Definition: mat_acc_extrapolate.h:78
void resetSizesAndBlocks(SizesAndBlocks const &newRows, SizesAndBlocks const &newCols)
Definition: MatrixBase.h:76
std::vector< Treal > errorList_eucl
Definition: mat_acc_extrapolate.h:71
std::vector< Treal > threshList
Definition: mat_acc_extrapolate.h:69
std::vector< Treal > errorList_frob
Definition: mat_acc_extrapolate.h:70
void Scan(const Tworker &worker, Treal firstParam, Treal stepFactor, int nSteps)
Definition: mat_acc_extrapolate.h:85
Treal eucl(Treal const requestedAccuracy, int maxIter=-1) const
Definition: MatrixSymmetric.h:667
Treal frob() const
Definition: MatrixSymmetric.h:354
int nScanSteps
Definition: mat_acc_extrapolate.h:67
Symmetric matrix.
Definition: MatrixBase.h:51
void GetScanResult(Treal *threshList_, Treal *errorList_frob_, Treal *errorList_eucl_, Treal *errorList_maxe_, Treal *timeList_)
Definition: mat_acc_extrapolate.h:140
mat::SizesAndBlocks matrix_size_block_info
Definition: mat_acc_extrapolate.h:66
Treal baseThresh
Definition: mat_acc_extrapolate.h:68
std::vector< Treal > errorList_maxe
Definition: mat_acc_extrapolate.h:72