Computation of \( \vec x = f(A,\vec d)\vec b\) and \( \vec x = f(\vec d, A)\vec b\) where \( A \) is a positive definite matrix self-adjoint in the weights \( W\) .
More...
|
| | ProductMatrixFunction ()=default |
| | Construct empty.
|
| |
| | ProductMatrixFunction (const ContainerType ©able, unsigned max_iterations) |
| | Allocate memory for the method.
|
| |
| template<class ... Params> |
| void | construct (Params &&...ps) |
| | Perfect forward parameters to one of the constructors.
|
| |
| void | set_benchmark (bool benchmark, std::string message="ProductFunction") |
| | Set or unset performance timings during iterations.
|
| |
| template<class ContainerType0 , class BinaryOp , class ContainerType1 , class MatrixType , class ContainerType2 , class ContainerType3 > |
| unsigned | apply (ContainerType0 &x, BinaryOp op, const ContainerType1 &diag, MatrixType &&A, const ContainerType2 &b, const ContainerType3 &weights, value_type eps, value_type nrmb_correction=1.) |
| | Compute \( \vec x = f(\vec d, A) \vec b = (E_{A} \odot F ) E^T_{A}M^T b\).
|
| |
| template<class ContainerType0 , class BinaryOp , class MatrixType , class ContainerType1 , class ContainerType2 , class ContainerType3 > |
| unsigned | apply_adjoint (ContainerType0 &x, BinaryOp op, MatrixType &&A, const ContainerType1 &diag, const ContainerType2 &b, const ContainerType3 &weights, value_type eps, value_type nrmb_correction=1.) |
| | Compute \( \vec x = f(A, \vec d) \vec b = E_{A} (F^T \odot E^T_{A}M^T) b\).
|
| |
| template<class BinaryOp , class ContainerType0 , class MatrixType , class ContainerType1 , class ContainerType2 > |
| void | compute_vlcl (BinaryOp op, const ContainerType0 &diag, MatrixType &&A, const TriDiagonal< thrust::host_vector< value_type > > &T, ContainerType1 &x, const ContainerType2 &b, value_type bnorm) |
| | Compute \( \vec x = f(\vec d, A) \vec b = (E_{A} \odot F ) E^T_{A}M^T b\).
|
| |
| template<class BinaryOp , class MatrixType , class ContainerType0 , class ContainerType1 , class ContainerType2 , class ContainerType3 > |
| void | compute_vlcl_adjoint (BinaryOp op, MatrixType &&A, const ContainerType0 &diag, const TriDiagonal< thrust::host_vector< value_type > > &T, ContainerType1 &x, const ContainerType2 &b, const ContainerType3 &weights, value_type bnorm) |
| | Compute \( \vec x = f(A, \vec d) \vec b = E_{A} (F^T \odot E^T_{A}M^T) b\).
|
| |
| UniversalLanczos< ContainerType > & | lanczos () |
| | Access the Lanczos class that is constructed with the constructor parameters.
|
| |
template<class ContainerType>
struct dg::mat::ProductMatrixFunction< ContainerType >
Computation of \( \vec x = f(A,\vec d)\vec b\) and \( \vec x = f(\vec d, A)\vec b\) where \( A \) is a positive definite matrix self-adjoint in the weights \( W\) .
The first identity is computed via \( \vec x = f(\vec d, A) \vec b = (E_{A} \odot F ) E^T_{A}M^T b\) where \( E_A := V_A E_T \) and \( F_{ai} := f( d_a, \lambda_i)\) and \( T\) and \( V_A\) are the tridiagonal matrix and vectors that come out of a Lanczos iteration on \( A\), \( W\), \( \vec b\); \( \vec d\) is a vector.
The second identity is computed via \( \vec x = f(A, \vec d) \vec b = E_{A} (F^T \odot E^T_{A}M^T) b\) where \( E_A := V_A E_T \) and \( F_{ai} := f( d_a, \lambda_i)\) and \( T\) and \( V_A\) are the tridiagonal matrix and vectors that come out of a Lanczos iteration on \( A\), \( W\), \( \vec b\); \( \vec d\) is a vector
- Attention
- Just as in the Lanczos or PCG methods the matrix \( A\) needs to be positive-definite (i.e. it won't work for negative definite)
- Note
- The
apply and apply_adjoint methods are just abbreviations. If one wants full control, e.g. to reuse a tridiagonalisation one has to manually code:
auto T = prod.lanczos().tridiag( func, A,
b, weights, eps, nrmb_correction,
"universal", 1.0, 1);
prod.compute_vlcl( op, diag, A, T, x, b, prod.lanczos().get_bnorm());
prod.compute_vlcl_adjoint( op, A, diag, T, x, b,
weights, prod.lanczos().get_bnorm());
OutputType reduce(const ContainerType &x, OutputType zero, BinaryOp binary_op, UnaryOp unary_op=UnaryOp())
auto make_FuncEigen_Te1(UnaryOp f)
Create a functor that uses Eigenvalue decomposition to compute for symmetric tridiagonal T.
Definition matrixfunction.h:29
Computation of and where is a positive definite matrix self-adjoint in the weights .
Definition matrixprod.h:48
dg::get_value_type< ContainerType > value_type
Definition matrixprod.h:50
- Attention
- The adjoint methods unfortunately do not converge so use cautiously!
- See also
- dg::mat::UniversalLanczos dg::mat::CauchyMatrixProduct
template<class ContainerType >
template<class BinaryOp , class ContainerType0 , class MatrixType , class ContainerType1 , class ContainerType2 >
Compute \( \vec x = f(\vec d, A) \vec b = (E_{A} \odot F ) E^T_{A}M^T b\).
where \( E_A := V_A E_T \) and \( F_{ai} := f( d_a, \lambda_i)\) and \( T\) and \( V_A\) are the tridiagonal matrix and vectors that come out of a Lanczos iteration on \( A\), \( W\), \( \vec b\); \( \vec d\) is a vector.
This function takes a previously computed tridiagonalisation of A, called T and computes the Eigendecomposition of T and then re-creates the Eigenvectors in V to compute the above result.
- Note
- the Tridiagonalisation
T can thus be reused to compute various matrix functions of the same right hand side. It can be computed using
auto T = prod.lanczos().tridiag( func, A,
b, weights, eps, nrmb_correction,
"universal", 1.0, 1);
prod.compute_vlcl( op, diag, A, T, x, b, prod.lanczos().get_bnorm());
prod.compute_vlcl_adjoint( op, A, diag, T, x, b,
weights, prod.lanczos().get_bnorm());
- Parameters
-
| op | a binary Operator representing the product matrix function |
| diag | the diagonal vector |
| A | A self-adjoint, positive definit matrix |
| T | The tridiagonalisation of A |
| x | output-vector, contains result on output, ignored on input |
| b | The initial vector that starts orthogonalization |
| bnorm | the norm of b |
template<class ContainerType >
template<class BinaryOp , class MatrixType , class ContainerType0 , class ContainerType1 , class ContainerType2 , class ContainerType3 >
Compute \( \vec x = f(A, \vec d) \vec b = E_{A} (F^T \odot E^T_{A}M^T) b\).
where \( E_A := V_A E_T \) and \( F_{ai} := f( d_a, \lambda_i)\) and \( T\) and \( V_A\) are the tridiagonal matrix and vectors that come out of a Lanczos iteration on \( A\), \( W\), \( \vec b\); \( \vec d\) is a vector
- Attention
- The adjoint methods unfortunately do not converge so use cautiously!
This function takes a previously computed tridiagonalisation of A, called T and computes the Eigendecomposition of T and then re-creates the Eigenvectors in V to compute the above result.
- Note
- \( f(A, \vec d)\) is the adjoint operation to \( f( \vec d, A)\) since both \( \vec d\) and \( A\) are self-adjoint.
- Parameters
-
| op | a binary Operator representing the product matrix function |
| A | A self-adjoint, positive definit matrix |
| diag | the diagonal vector |
- Attention
- The order of
A and diag is reversed compared to the apply method
- Parameters
-
| T | The tridiagonalisation of A |
| x | output-vector, contains result on output, ignored on input |
| b | The initial vector that starts orthogonalization |
| weights | Weights that define the scalar product in which A is self-adjoint and in which the error norm is computed. |
| bnorm | the norm of b |