EXPERIMENTAL Shortcut for \(x \approx f(A) b \) solve via exploiting first a Krylov projection achieved by the M-CG method and a matrix function computation via Eigen-decomposition.
More...
|
| MCGFuncEigen () |
| Allocate nothing, Call construct method before usage. More...
|
|
| MCGFuncEigen (const Container ©able, unsigned max_iterations) |
| Construct MCGFuncEigen. More...
|
|
template<class ... Params> |
void | construct (Params &&...ps) |
| Perfect forward parameters to one of the constructors. More...
|
|
template<class MatrixType , class ContainerType0 , class ContainerType1 , class ContainerType2 , class UnaryOp > |
unsigned | operator() (ContainerType0 &x, UnaryOp f, MatrixType &&A, const ContainerType1 &b, const ContainerType2 &weights, value_type eps, value_type nrmb_correction, value_type res_fac) |
| Compute \(x \approx f(A)*b \) via M-CG method and Eigen decomposition. More...
|
|
template<class Container>
class dg::mat::MCGFuncEigen< Container >
EXPERIMENTAL Shortcut for \(x \approx f(A) b \) solve via exploiting first a Krylov projection achieved by the M-CG method and a matrix function computation via Eigen-decomposition.
- Attention
- This class has the exact same result as the corresponding UniversalLanczos class. Its use is for mere experimental purposes.
A is self-adjoint in the weights \( W\)
The approximation relies on Projection \(x = f(A) b \approx R f(\tilde T)^{-1} e_1\), where \(\tilde T\) and \(R\) are the tridiagonal and orthogonal matrix of the M-CG solve and \(e_1\) is the normalized unit vector. The vector \(f(\tilde T) e_1\) is computed via the Eigen decomposition and similarity transform of \( \tilde T\).
- Note
- Since MCG and Lanczos are equivalent the result of this class is the same within round-off errors as a Lanczos solve with the "residual" error norm
template<class Container >
template<class MatrixType , class ContainerType0 , class ContainerType1 , class ContainerType2 , class UnaryOp >
Compute \(x \approx f(A)*b \) via M-CG method and Eigen decomposition.
- Parameters
-
b | input vector |
x | output vector |
f | the matrix function (e.g. dg::SQRT<double> or dg::EXP<double>) |
A | self-adjoint and semi-positive definit matrix |
weights | weights |
eps | relative accuracy of M-CG method |
nrmb_correction | the absolute error C in units of eps to be respected |
res_fac | residual factor for stopping criterium of M-CG method |
- Returns
- number of iterations of M-CG routine