![]() |
MFEM
v4.5.2
Finite element discretization library
|
Templated dense matrix data type. More...
#include <taddensemat.hpp>
Public Member Functions | |
int | Height () const |
Get the height (size of output) of the Operator. Synonym with NumRows(). More... | |
int | NumRows () const |
Get the number of rows (size of output) of the Operator. Synonym with Height(). More... | |
int | Width () const |
Get the width (size of input) of the Operator. Synonym with NumCols(). More... | |
int | NumCols () const |
Get the number of columns (size of input) of the Operator. Synonym with Width(). More... | |
TAutoDiffDenseMatrix () | |
template<typename idtype > | |
TAutoDiffDenseMatrix (const TAutoDiffDenseMatrix< idtype > &m) | |
Copy constructor. More... | |
TAutoDiffDenseMatrix (const DenseMatrix &m) | |
Copy constructor using standard DenseMatrix. More... | |
TAutoDiffDenseMatrix (int s) | |
Creates square matrix of size s. More... | |
TAutoDiffDenseMatrix (int m, int n) | |
Creates rectangular matrix of size m x n. More... | |
TAutoDiffDenseMatrix (const TAutoDiffDenseMatrix< dtype > &mat, char ch) | |
void | SetSize (int s) |
Change the size of the DenseMatrix to s x s. More... | |
void | SetSize (int h, int w) |
Change the size of the DenseMatrix to h x w. More... | |
dtype * | Data () const |
Returns the matrix data array. More... | |
dtype * | GetData () const |
Returns the matrix data array. More... | |
bool | OwnsData () const |
dtype & | operator() (int i, int j) |
Returns reference to a_{ij}. More... | |
const dtype & | operator() (int i, int j) const |
dtype & | Elem (int i, int j) |
const dtype & | Elem (int i, int j) const |
void | Mult (const dtype *x, dtype *y) const |
void | Mult (const TAutoDiffVector< dtype > &x, TAutoDiffVector< dtype > &y) const |
dtype | operator* (const TAutoDiffDenseMatrix< dtype > &m) const |
void | MultTranspose (const dtype *x, dtype *y) const |
void | MultTranspose (const TAutoDiffVector< dtype > &x, TAutoDiffVector< dtype > &y) const |
void | Randomize (int seed) |
void | RandomizeDiag (int seed) |
void | Diag (dtype c, int n) |
Creates n x n diagonal matrix with diagonal elements c. More... | |
template<typename itype > | |
void | Diag (itype *diag, int n) |
Creates n x n diagonal matrix with diagonal given by diag. More... | |
void | Transpose () |
(*this) = (*this)^t More... | |
template<typename itype > | |
void | Transpose (const TAutoDiffDenseMatrix< itype > &A) |
(*this) = A^t More... | |
void | Symmetrize () |
(*this) = 1/2 ((*this) + (*this)^t) More... | |
void | Lump () |
Templated dense matrix data type.
The main goal of the TAutoDiffDenseMatrix class is to serve as a data container for representing dense matrices in classes, methods, and functions utilized with automatic differentiation (AD). The functionality/interface is copied from the standard MFEM dense matrix mfem::DenseMatrix. The basic idea is to utilize the templated vector class in combination with AD during the development phase. The AD parts can be replaced with optimized code once the initial development of the application is complete. The common interface between TAutoDiffDenseMatrix and DenseMatrix will ease the transition from AD to hand-optimized code as it does not require a change in the interface or the code structure. TAutoDiffDenseMatrix is intended to be utilized for dense serial matrices. The objects can be combined with TAutoDiffVector or standard Vector.
Definition at line 34 of file taddensemat.hpp.
|
inline |
Default constructor for TAutoDiffDenseMatrix. Sets data = NULL and height = width = 0.
Definition at line 57 of file taddensemat.hpp.
|
inline |
Copy constructor.
Definition at line 67 of file taddensemat.hpp.
|
inline |
Copy constructor using standard DenseMatrix.
Definition at line 92 of file taddensemat.hpp.
|
inlineexplicit |
Creates square matrix of size s.
Definition at line 118 of file taddensemat.hpp.
|
inline |
Creates rectangular matrix of size m x n.
Definition at line 135 of file taddensemat.hpp.
|
inline |
Definition at line 152 of file taddensemat.hpp.
|
inline |
Returns the matrix data array.
Definition at line 202 of file taddensemat.hpp.
|
inline |
Creates n x n diagonal matrix with diagonal elements c.
Definition at line 339 of file taddensemat.hpp.
|
inline |
Creates n x n diagonal matrix with diagonal given by diag.
Definition at line 355 of file taddensemat.hpp.
|
inline |
Definition at line 221 of file taddensemat.hpp.
|
inline |
Definition at line 223 of file taddensemat.hpp.
|
inline |
Returns the matrix data array.
Definition at line 204 of file taddensemat.hpp.
|
inline |
Get the height (size of output) of the Operator. Synonym with NumRows().
Definition at line 44 of file taddensemat.hpp.
|
inline |
Definition at line 423 of file taddensemat.hpp.
|
inline |
Definition at line 225 of file taddensemat.hpp.
|
inline |
Definition at line 253 of file taddensemat.hpp.
|
inline |
Definition at line 276 of file taddensemat.hpp.
|
inline |
Definition at line 291 of file taddensemat.hpp.
|
inline |
Get the number of columns (size of input) of the Operator. Synonym with Width().
Definition at line 53 of file taddensemat.hpp.
|
inline |
Get the number of rows (size of output) of the Operator. Synonym with Height().
Definition at line 47 of file taddensemat.hpp.
|
inline |
Returns reference to a_{ij}.
Definition at line 209 of file taddensemat.hpp.
|
inline |
Definition at line 215 of file taddensemat.hpp.
|
inline |
Definition at line 261 of file taddensemat.hpp.
|
inline |
Definition at line 206 of file taddensemat.hpp.
|
inline |
Definition at line 300 of file taddensemat.hpp.
|
inline |
Definition at line 319 of file taddensemat.hpp.
|
inline |
Change the size of the DenseMatrix to s x s.
Definition at line 176 of file taddensemat.hpp.
|
inline |
Change the size of the DenseMatrix to h x w.
Definition at line 179 of file taddensemat.hpp.
|
inline |
(*this) = 1/2 ((*this) + (*this)^t)
Definition at line 406 of file taddensemat.hpp.
|
inline |
(*this) = (*this)^t
Definition at line 371 of file taddensemat.hpp.
|
inline |
(*this) = A^t
Definition at line 394 of file taddensemat.hpp.
|
inline |
Get the width (size of input) of the Operator. Synonym with NumCols().
Definition at line 50 of file taddensemat.hpp.