Discontinuous Galerkin Library
#include "dg/algorithm.h"
|
Classes | |
struct | dg::ClonePtr< Cloneable > |
Manager class that invokes the clone() method on the managed ptr when copied. More... | |
Functions | |
template<class T > | |
SquareMatrix< T > | dg::tensorproduct (const SquareMatrix< T > &op1, const SquareMatrix< T > &op2) |
Form the tensor product between two operators. | |
template<class T > | |
dg::SparseMatrix< int, T, thrust::host_vector > | dg::tensorproduct (unsigned N, const SquareMatrix< T > &op) |
Tensor product between Identity matrix and an operator. | |
template<class T > | |
dg::SparseMatrix< int, T, thrust::host_vector > | dg::sandwich (const SquareMatrix< T > &left, const dg::SparseMatrix< int, T, thrust::host_vector > &m, const SquareMatrix< T > &right) |
Multiply 1d matrices by diagonal block matrices from left and right. | |
template<class T > | |
dg::SparseMatrix< int, T, thrust::host_vector > | dg::tensorproduct (const dg::SparseMatrix< int, T, thrust::host_vector > &lhs, const dg::SparseMatrix< int, T, thrust::host_vector > &rhs) |
\( L\otimes R\) Form the tensor (Kronecker) product between two matrices | |
template<class T > | |
dg::SparseMatrix< int, T, thrust::host_vector > | dg::tensorproduct_cols (const dg::SparseMatrix< int, T, thrust::host_vector > &lhs, const dg::SparseMatrix< int, T, thrust::host_vector > &rhs) |
\( L\otimes R\) Form the tensor (Kronecker) product between two matrices in the column index | |
dg::SparseMatrix< int, T, thrust::host_vector > dg::sandwich | ( | const SquareMatrix< T > & | left, |
const dg::SparseMatrix< int, T, thrust::host_vector > & | m, | ||
const SquareMatrix< T > & | right ) |
Multiply 1d matrices by diagonal block matrices from left and right.
computes (1xleft)m(1xright)
T | value type |
left | The left hand side |
m | The matrix |
right | The right hand side |
dg::SparseMatrix< int, T, thrust::host_vector > dg::tensorproduct | ( | const dg::SparseMatrix< int, T, thrust::host_vector > & | lhs, |
const dg::SparseMatrix< int, T, thrust::host_vector > & | rhs ) |
\( L\otimes R\) Form the tensor (Kronecker) product between two matrices
The Kronecker product is formed by the triplets \(I = k n_r+l\), \( J = i N_r +j \), \( M_{IJ} = L_{ki}R_{lj}\)
T | value type |
lhs | The left hand side matrix (duplicate entries lead to duplicate entries in result) |
rhs | The right hand side matrix (duplicate entries lead to duplicate entries in result) |
SquareMatrix< T > dg::tensorproduct | ( | const SquareMatrix< T > & | op1, |
const SquareMatrix< T > & | op2 ) |
Form the tensor product between two operators.
Computes C_{ijkl} = op1_{ij}op2_{kl}
T | The value type |
op1 | The left hand side |
op2 | The right hand side |
dg::SparseMatrix< int, T, thrust::host_vector > dg::tensorproduct | ( | unsigned | N, |
const SquareMatrix< T > & | op ) |
Tensor product between Identity matrix and an operator.
\[ M = \begin{pmatrix} op & & & & & \\ & op & & & & \\ & & op & & & \\ & & & op & & \\ & & &...& & \end{pmatrix} \]
Can be used to create tensors that operate on each dg-vector entry
T | value type |
N | Size of the identity (=number of times op is repeated in the matrix) |
op | The SquareMatrix |
N*op.size()
) dg::SparseMatrix< int, T, thrust::host_vector > dg::tensorproduct_cols | ( | const dg::SparseMatrix< int, T, thrust::host_vector > & | lhs, |
const dg::SparseMatrix< int, T, thrust::host_vector > & | rhs ) |
\( L\otimes R\) Form the tensor (Kronecker) product between two matrices in the column index
The Kronecker product in the columns is formed by the triplets \( J = i N_r +j \), \( M_{kJ} = L_{ki}R_{kj}\)
T | value type |
lhs | The left hand side matrix (duplicate entries lead to duplicate entries in result) |
rhs | The right hand side matrix (duplicate entries lead to duplicate entries in result) |