![]() |
Dune-Fufem 2.11-git
|
A class implementing a symmetric matrix with compile-time size. More...
#include <dune/fufem/symmetricmatrix.hh>
Public Types | |
| using | field_type = T |
| The type used for scalars. | |
| using | Data = Dune::FieldVector< T, N *(N+1)/2 > |
Public Member Functions | |
| SymmetricMatrix () | |
| Default constructor, creates uninitialized matrix. | |
| template<class Iterator > | |
| SymmetricMatrix (Iterator it) | |
| Construct from raw memory. | |
| SymmetricMatrix< T, N > & | operator= (const T &s) |
| SymmetricMatrix< T, N > & | operator*= (const T &s) |
| void | setEntry (int i, int j, const T &entry) |
| Random write access to components. | |
| T | operator() (int i, int j) const |
| Matrix style random read access to components. | |
| T | energyScalarProduct (const FieldVector< T, N > &v1, const FieldVector< T, N > &v2) const |
| void | axpy (const T &a, const SymmetricMatrix< T, N > &other) |
| T | frobenius_norm2 () const |
| Compute the Frobenius norm of the matrix. | |
| T | frobenius_norm () const |
| Compute the Frobenius norm of the matrix. | |
| const Data & | data () const |
| Data & | data () |
Static Public Member Functions | |
| static constexpr SymmetricMatrix< T, N > | identityMatrix () |
| Construct identityMatrix. | |
| static constexpr Data | traceMap () |
| return the trace map in vector representation the returned vector is such that <data,a> = trace(A) where A.data = a | |
| static constexpr size_t | dataSize () |
| Number of scalars needed for compressed vector storage of the symmetric matrix. | |
Detailed Description
class Dune::Fufem::SymmetricMatrix< T, N >
A class implementing a symmetric matrix with compile-time size.
A \( dim\times dim \) matrix is stored internally as a Dune::FieldVector<double, dim*(dim+1)/2> The components are assumed to be \( [ E(1,1),\ E(2,1),\ E(2,2),\ E(3,1),\ E(3,2),\ E(3,3) ]\) and analogous for other dimensions
- Template Parameters
-
dim number of lines/columns of the matrix
Member Typedef Documentation
◆ Data
| using Dune::Fufem::SymmetricMatrix< T, N >::Data = Dune::FieldVector<T,N*(N+1)/2> |
◆ field_type
| using Dune::Fufem::SymmetricMatrix< T, N >::field_type = T |
The type used for scalars.
Constructor & Destructor Documentation
◆ SymmetricMatrix() [1/2]
|
inline |
Default constructor, creates uninitialized matrix.
◆ SymmetricMatrix() [2/2]
|
inline |
Construct from raw memory.
Member Function Documentation
◆ axpy()
|
inline |
◆ data() [1/2]
|
inline |
◆ data() [2/2]
|
inline |
◆ dataSize()
|
inlinestaticconstexpr |
Number of scalars needed for compressed vector storage of the symmetric matrix.
◆ energyScalarProduct()
|
inline |
◆ frobenius_norm()
|
inline |
Compute the Frobenius norm of the matrix.
◆ frobenius_norm2()
|
inline |
Compute the Frobenius norm of the matrix.
We have a guaranteed isometric mapping between the Frobenius norm of the matrix and the two-norm of the data vector!
◆ identityMatrix()
|
inlinestaticconstexpr |
Construct identityMatrix.
◆ operator()()
|
inline |
Matrix style random read access to components.
- Parameters
-
i line index j column index The off-diagonal entries are scaled by 1/sqrt(2) to ensure isometry
◆ operator*=()
|
inline |
◆ operator=()
|
inline |
◆ setEntry()
|
inline |
Random write access to components.
- Parameters
-
i line index j column index entry The value to store as matrix entry The off-diagonal entries are scaled by sqrt(2) to ensure isometry
- Note
- : You need to know what you are doing: Modifying an off-diagonal entry modifies two entries in the matrix!
◆ traceMap()
|
inlinestaticconstexpr |
return the trace map in vector representation the returned vector is such that <data,a> = trace(A) where A.data = a
The documentation for this class was generated from the following file:
