63 template <
int M,
int N,
typename T = real_t>
67 for (
int i = 0; i < M; i++)
69 for (
int j = 0; j < N; j++)
71 (*this)(i,j) = values[i][j];
82 data.
Wrap(d, h*w,
false);
142 const real_t &
Elem(
int i,
int j)
const override;
176 const real_t a = 1.0)
const override;
265 MFEM_ASSERT(v.
Size() ==
Width(),
"incompatible Vector size!");
284 { Eigensystem(ev, &evect); }
288 { Eigensystem(ev, &evect); }
293 { Eigensystem(
b, ev); }
297 { Eigensystem(
b, ev, &evect); }
302 { Eigensystem(
b, ev, &evect); }
384 int row_offset,
int col_offset);
504void Add(
const DenseMatrix &A,
const DenseMatrix &B,
513 real_t beta,
const DenseMatrix &B, DenseMatrix &C);
532void Mult(
const DenseMatrix &
b,
const DenseMatrix &c, DenseMatrix &
a);
535void AddMult(
const DenseMatrix &
b,
const DenseMatrix &c, DenseMatrix &
a);
551void CalcInverse(
const DenseMatrix &
a, DenseMatrix &inva);
559void CalcOrtho(
const DenseMatrix &J, Vector &n);
562void MultAAt(
const DenseMatrix &
a, DenseMatrix &aat);
565void MultADAt(
const DenseMatrix &A,
const Vector &D, DenseMatrix &ADAt);
568void AddMultADAt(
const DenseMatrix &A,
const Vector &D, DenseMatrix &ADAt);
571void MultABt(
const DenseMatrix &A,
const DenseMatrix &B, DenseMatrix &ABt);
574void MultADBt(
const DenseMatrix &A,
const Vector &D,
575 const DenseMatrix &B, DenseMatrix &ADBt);
578void AddMultABt(
const DenseMatrix &A,
const DenseMatrix &B, DenseMatrix &ABt);
581void AddMultADBt(
const DenseMatrix &A,
const Vector &D,
582 const DenseMatrix &B, DenseMatrix &ADBt);
589void MultAtB(
const DenseMatrix &A,
const DenseMatrix &B, DenseMatrix &AtB);
592void AddMultAtB(
const DenseMatrix &A,
const DenseMatrix &B, DenseMatrix &AtB);
605void MultVVt(
const Vector &v, DenseMatrix &vvt);
607void MultVWt(
const Vector &v,
const Vector &w, DenseMatrix &VWt);
610void AddMultVWt(
const Vector &v,
const Vector &w, DenseMatrix &VWt);
613void AddMultVVt(
const Vector &v, DenseMatrix &VWt);
624void RAP(
const DenseMatrix &A,
const DenseMatrix &P, DenseMatrix &
RAP);
628void RAP(
const DenseMatrix &Rt,
const DenseMatrix &A,
629 const DenseMatrix &P, DenseMatrix &
RAP);
675#ifdef MFEM_USE_LAPACK
719 void Solve(
int m,
int n,
real_t *X)
const override;
822 void Solve(
int m,
int n,
real_t *X)
const override;
845 bool own_data =
false;
895#ifdef MFEM_USE_LAPACK
945 bool left_eigen_vectors =
false,
946 bool right_eigen_vectors =
false);
970#ifdef MFEM_USE_LAPACK
993 bool left_singular_vectors=
false,
994 bool right_singular_vectors=
false);
1011 bool left_singular_vectors=
false,
1012 bool right_singular_vectors=
false);
1036 char left_singular_vectors=
'A',
1037 char right_singular_vectors=
'A');
1062 char left_singular_vectors=
'A',
1063 char right_singular_vectors=
'A');
1135 tdata.
Wrap(d, i*j*k,
false);
1142 tdata.
New(i*j*k, mt);
1147 : Mk(NULL, other.Mk.height, other.Mk.width), nk(other.nk)
1169 tdata.
New(i*j*k, mt);
1177 tdata.
Wrap(ext_data, i*j*k,
false);
1213 MFEM_ASSERT_INDEX_IN_RANGE(k, 0,
SizeK());
1219 MFEM_ASSERT_INDEX_IN_RANGE(k, 0,
SizeK());
1227 MFEM_ASSERT_INDEX_IN_RANGE(i, 0,
SizeI());
1228 MFEM_ASSERT_INDEX_IN_RANGE(j, 0,
SizeJ());
1229 MFEM_ASSERT_INDEX_IN_RANGE(k, 0,
SizeK());
1235 MFEM_ASSERT_INDEX_IN_RANGE(i, 0,
SizeI());
1236 MFEM_ASSERT_INDEX_IN_RANGE(j, 0,
SizeJ());
1237 MFEM_ASSERT_INDEX_IN_RANGE(k, 0,
SizeK());
1243 MFEM_ASSERT_INDEX_IN_RANGE(k, 0,
SizeK());
1249 MFEM_ASSERT_INDEX_IN_RANGE(k, 0,
SizeK());
1324void BatchLUSolve(
const DenseTensor &Mlu,
const Array<int> &P, Vector &X);
1330 MFEM_ASSERT(data && i >= 0 && i < height && j >= 0 && j <
width,
"");
1336 MFEM_ASSERT(data && i >= 0 && i < height && j >= 0 && j <
width,
"");
void UMult(int m, int n, real_t *X) const
void Solve(int m, int n, real_t *X) const override
void RightSolve(int m, int n, real_t *X) const
CholeskyFactors(real_t *data_)
void USolve(int m, int n, real_t *X) const
void LSolve(int m, int n, real_t *X) const
bool Factor(int m, real_t TOL=0.0) override
Compute the Cholesky factorization of the current matrix.
void GetInverseMatrix(int m, real_t *X) const override
Assuming L.L^t = A factored data of size (m x m), compute X <- A^{-1}.
void LMult(int m, int n, real_t *X) const
real_t Det(int m) const override
const Vector & Eigenvector(int i)
~DenseMatrixEigensystem()
DenseMatrixEigensystem(DenseMatrix &m)
DenseMatrix & Eigenvectors()
DenseMatrix & LeftEigenvectors()
Vector & EigenvaluesImagPart()
DenseMatrix & RightEigenvectors()
Vector & EigenvaluesRealPart()
~DenseMatrixGeneralizedEigensystem()
DenseMatrixGeneralizedEigensystem(DenseMatrix &a, DenseMatrix &b, bool left_eigen_vectors=false, bool right_eigen_vectors=false)
real_t EigenvalueRealPart(int i)
real_t EigenvalueImagPart(int i)
void TestInversion()
Print the numerical conditioning of the inversion: ||A^{-1} A - I||.
int Size() const
Get the size of the inverse matrix.
DenseMatrixInverse(bool spd_=false)
Default constructor.
virtual ~DenseMatrixInverse()
Destroys dense inverse matrix.
void Factor()
Factor the current DenseMatrix, *a.
void Mult(const real_t *x, real_t *y) const
Matrix vector multiplication with the inverse of dense matrix.
real_t Det() const
Compute the determinant of the original DenseMatrix using the LU factors.
void GetInverseMatrix(DenseMatrix &Ainv) const
Compute and return the inverse matrix in Ainv.
void SetOperator(const Operator &op) override
Set/update the solver for the given operator.
void Mult(DenseMatrix &X) const
Multiply the inverse matrix by another matrix: X <- A^{-1} X.
Class for Singular Value Decomposition of a DenseMatrix.
Vector & Singularvalues()
Return singular values.
DenseMatrix & RightSingularvectors()
Return right singular vectors.
MFEM_DEPRECATED DenseMatrixSVD(DenseMatrix &M, bool left_singular_vectors=false, bool right_singular_vectors=false)
Constructor for the DenseMatrixSVD.
DenseMatrix & LeftSingularvectors()
Return left singular vectors.
real_t Singularvalue(int i)
Return specific singular value.
void Eval(DenseMatrix &M)
Evaluate the SVD.
Data type dense matrix using column-major storage.
void GetDiag(Vector &d) const
Returns the diagonal of the matrix.
void CopyMNDiag(real_t c, int n, int row_offset, int col_offset)
Copy c on the diagonal of size n to *this at row_offset, col_offset.
void AddMult_a(real_t a, const Vector &x, Vector &y) const
y += a * A.x
void Mult(const real_t *x, real_t *y) const
Matrix vector multiplication.
void AddMultTranspose_a(real_t a, const Vector &x, Vector &y) const
y += a * A^t x
void Set(real_t alpha, const real_t *A)
Set the matrix to alpha * A, assuming that A has the same dimensions as the matrix and uses column-ma...
void TestInversion()
Invert and print the numerical conditioning of the inversion.
void CopyExceptMN(const DenseMatrix &A, int m, int n)
Copy All rows and columns except m and n from A.
void CopyCols(const DenseMatrix &A, int col1, int col2)
Copy columns col1 through col2 from A to *this.
void MultTranspose(const real_t *x, real_t *y) const
Multiply a vector with the transpose matrix.
void Transpose()
(*this) = (*this)^t
void AddToVector(int offset, Vector &v) const
Add the matrix 'data' to the Vector 'v' at the given 'offset'.
void Threshold(real_t eps)
Replace small entries, abs(a_ij) <= eps, with zero.
const real_t * HostRead() const
Shortcut for mfem::Read(GetMemory(), TotalSize(), false).
void CalcEigenvalues(real_t *lambda, real_t *vec) const
void Eigenvalues(Vector &ev)
Compute eigenvalues of A x = ev x where A = *this.
DenseMatrix(real_t *d, int h, int w)
Construct a DenseMatrix using an existing data array.
real_t * ReadWrite(bool on_dev=true)
Shortcut for mfem::ReadWrite(GetMemory(), TotalSize(), on_dev).
void RightScaling(const Vector &s)
RightScaling: this = this * diag(s);.
void Norm2(Vector &v) const
Take the 2-norm of the columns of A and store in v.
real_t * HostWrite()
Shortcut for mfem::Write(GetMemory(), TotalSize(), false).
void SetRow(int r, const real_t *row)
void SymmetricScaling(const Vector &s)
SymmetricScaling this = diag(sqrt(s)) * this * diag(sqrt(s))
void Getl1Diag(Vector &l) const
Returns the l1 norm of the rows of the matrix v_i = sum_j |a_ij|.
void GetColumnReference(int c, Vector &col)
real_t & operator()(int i, int j)
Returns reference to a_{ij}.
real_t InnerProduct(const real_t *x, const real_t *y) const
Compute y^t A x.
void Eigenvalues(DenseMatrix &b, Vector &ev, DenseMatrix &evect)
Compute generalized eigenvalues of A x = ev B x, where A = *this.
real_t * Data() const
Returns the matrix data array.
const Memory< real_t > & GetMemory() const
void GetSubMatrix(const Array< int > &idx, DenseMatrix &A) const
real_t * GetData() const
Returns the matrix data array.
void Eigensystem(DenseMatrix &b, Vector &ev, DenseMatrix &evect)
void AddMult(const Vector &x, Vector &y, const real_t a=1.0) const override
y += a * A.x
void SetSize(int s)
Change the size of the DenseMatrix to s x s.
virtual ~DenseMatrix()
Destroys dense matrix.
void Reset(real_t *d, int h, int w)
Change the data array and the size of the DenseMatrix.
void SetCol(int c, const real_t *col)
void Symmetrize()
(*this) = 1/2 ((*this) + (*this)^t)
void Invert()
Replaces the current matrix with its inverse.
DenseMatrix & operator+=(const real_t *m)
void Neg()
(*this) = -(*this)
real_t operator*(const DenseMatrix &m) const
Matrix inner product: tr(A^t B)
void CopyMNt(const DenseMatrix &A, int row_offset, int col_offset)
Copy matrix A^t to the location in *this at row_offset, col_offset.
void AddMultTranspose(const Vector &x, Vector &y, const real_t a=1.0) const override
y += a * A^t x
void AdjustDofDirection(Array< int > &dofs)
void Eigenvalues(Vector &ev, DenseMatrix &evect)
Compute eigenvalues and eigenvectors of A x = ev x where A = *this.
void InvRightScaling(const Vector &s)
InvRightScaling: this = this * diag(1./s);.
const real_t * GetColumn(int col) const
void Eigensystem(Vector &ev, DenseMatrix &evect)
Compute eigenvalues and eigenvectors of A x = ev x where A = *this.
real_t * Write(bool on_dev=true)
Shortcut for mfem::Write(GetMemory(), TotalSize(), on_dev).
real_t * HostReadWrite()
Shortcut for mfem::ReadWrite(GetMemory(), TotalSize(), false).
void SingularValues(Vector &sv) const
real_t FNorm() const
Compute the Frobenius norm of the matrix.
void InvLeftScaling(const Vector &s)
InvLeftScaling this = diag(1./s) * this.
DenseMatrix(const T(&values)[M][N])
void SetSubMatrix(const Array< int > &idx, const DenseMatrix &A)
Set (*this)(idx[i],idx[j]) = A(i,j)
virtual void PrintT(std::ostream &out=mfem::out, int width_=4) const
Prints the transpose matrix to stream out.
void AddSubMatrix(const Array< int > &idx, const DenseMatrix &A)
(*this)(idx[i],idx[j]) += A(i,j)
real_t Trace() const
Trace of a square matrix.
real_t * GetColumn(int col)
void Diag(real_t c, int n)
Creates n x n diagonal matrix with diagonal elements c.
void SquareRootInverse()
Replaces the current matrix with its square root inverse.
virtual void PrintMathematica(std::ostream &out=mfem::out) const
DenseMatrix & operator*=(real_t c)
void Swap(DenseMatrix &other)
const real_t * Read(bool on_dev=true) const
Shortcut for mfem::Read( GetMemory(), TotalSize(), on_dev).
bool OwnsData() const
Return the DenseMatrix data (host pointer) ownership flag.
void AddMatrix(DenseMatrix &A, int ro, int co)
Perform (ro+i,co+j)+=A(i,j) for 0<=i.
void GetRowSums(Vector &l) const
Compute the row sums of the DenseMatrix.
real_t & Elem(int i, int j) override
Returns reference to a_{ij}.
void CopyMN(const DenseMatrix &A, int m, int n, int Aro, int Aco)
Copy the m x n submatrix of A at row/col offsets Aro/Aco to *this.
void InvSymmetricScaling(const Vector &s)
InvSymmetricScaling this = diag(sqrt(1./s)) * this * diag(sqrt(1./s))
int Rank(real_t tol) const
void UseExternalData(real_t *d, int h, int w)
Change the data array and the size of the DenseMatrix.
void Add(const real_t c, const DenseMatrix &A)
Adds the matrix A multiplied by the number c to the matrix.
void PrintMatlab(std::ostream &out=mfem::out) const override
Prints operator in Matlab format.
void Clear()
Delete the matrix data array (if owned) and reset the matrix state.
void LeftScaling(const Vector &s)
LeftScaling this = diag(s) * this.
DenseMatrix & operator-=(const DenseMatrix &m)
real_t InnerProduct(const Vector &x, const Vector &y) const
Compute y^t A x.
std::size_t MemoryUsage() const
Memory< real_t > & GetMemory()
real_t CalcSingularvalue(const int i) const
Return the i-th singular value (decreasing order) of NxN matrix, N=1,2,3.
void GradToCurl(DenseMatrix &curl)
void Print(std::ostream &out=mfem::out, int width_=4) const override
Prints matrix to stream out.
void GetColumn(int c, Vector &col) const
void GradToVectorCurl2D(DenseMatrix &curl)
MatrixInverse * Inverse() const override
Returns a pointer to the inverse matrix.
DenseMatrix & operator=(real_t c)
Sets the matrix elements equal to constant c.
void Eigenvalues(DenseMatrix &b, Vector &ev)
real_t MaxMaxNorm() const
Compute the norm ||A|| = max_{ij} |A_{ij}|.
void Norm2(real_t *v) const
Take the 2-norm of the columns of A and store in v.
void GetFromVector(int offset, const Vector &v)
Get the matrix 'data' from the Vector 'v' at the given 'offset'.
int Size() const
For backward compatibility define Size to be synonym of Width()
real_t FNorm2() const
Compute the square of the Frobenius norm of the matrix.
void GetRow(int r, Vector &row) const
void CopyRows(const DenseMatrix &A, int row1, int row2)
Copy rows row1 through row2 from A to *this.
void GradToDiv(Vector &div)
void Set(real_t alpha, const DenseMatrix &A)
Set the matrix to alpha * A.
Rank 3 tensor (array of matrices)
DenseTensor(int i, int j, int k, MemoryType mt)
real_t * HostWrite()
Shortcut for mfem::Write(GetMemory(), TotalSize(), false).
DenseTensor(const DenseTensor &other)
Copy constructor: deep copy.
void SetSize(int i, int j, int k, MemoryType mt_=MemoryType::PRESERVE)
real_t * HostReadWrite()
Shortcut for mfem::ReadWrite(GetMemory(), TotalSize(), false).
real_t & operator()(int i, int j, int k)
Memory< real_t > & GetMemory()
void UseExternalData(real_t *ext_data, int i, int j, int k)
void AddMult(const Table &elem_dof, const Vector &x, Vector &y) const
DenseTensor(real_t *d, int i, int j, int k)
void NewMemoryAndSize(const Memory< real_t > &mem, int i, int j, int k, bool own_mem)
Reset the DenseTensor to use the given external Memory mem and dimensions i, j, and k.
const real_t * Read(bool on_dev=true) const
Shortcut for mfem::Read( GetMemory(), TotalSize(), on_dev).
const real_t & operator()(int i, int j, int k) const
real_t * Write(bool on_dev=true)
Shortcut for mfem::Write(GetMemory(), TotalSize(), on_dev).
std::size_t MemoryUsage() const
const real_t * Data() const
DenseTensor(int i, int j, int k)
real_t * ReadWrite(bool on_dev=true)
Shortcut for mfem::ReadWrite(GetMemory(), TotalSize(), on_dev).
const real_t * HostRead() const
Shortcut for mfem::Read(GetMemory(), TotalSize(), false).
DenseTensor & operator=(real_t c)
Sets the tensor elements equal to constant c.
const DenseMatrix & operator()(int k) const
void Swap(DenseTensor &t)
const real_t * GetData(int k) const
DenseMatrix & operator()(int k)
const Memory< real_t > & GetMemory() const
virtual void GetInverseMatrix(int m, real_t *X) const
virtual real_t Det(int m) const
virtual void Solve(int m, int n, real_t *X) const
virtual bool Factor(int m, real_t TOL=0.0)
A class to initialize the size of a Tensor.
void LSolve(int m, int n, real_t *X) const
static void SubMult(int m, int n, int r, const real_t *A21, const real_t *X1, real_t *X2)
bool Factor(int m, real_t TOL=0.0) override
Compute the LU factorization of the current matrix.
void Mult(int m, int n, real_t *X) const
void USolve(int m, int n, real_t *X) const
void BlockFactor(int m, int n, real_t *A12, real_t *A21, real_t *A22) const
real_t Det(int m) const override
void BlockForwSolve(int m, int n, int r, const real_t *L21, real_t *B1, real_t *B2) const
void Solve(int m, int n, real_t *X) const override
void RightSolve(int m, int n, real_t *X) const
LUFactors(real_t *data_, int *ipiv_)
void BlockBackSolve(int m, int n, int r, const real_t *U12, const real_t *X2, real_t *Y1) const
static const int ipiv_base
void GetInverseMatrix(int m, real_t *X) const override
Assuming L.U = P.A factored data of size (m x m), compute X <- A^{-1}.
Abstract data type for matrix inverse.
Abstract data type matrix.
Class used by MFEM to store pointers to host and/or device memory.
int Capacity() const
Return the size of the allocated memory.
void MakeAlias(const Memory &base, int offset, int size)
Create a memory object that points inside the memory object base.
bool OwnsHostPtr() const
Return true if the host pointer is owned. Ownership indicates whether the pointer will be deleted by ...
MemoryType GetMemoryType() const
Return a MemoryType that is currently valid. If both the host and the device pointers are currently v...
void CopyFrom(const Memory &src, int size)
Copy size entries from src to *this.
void Reset()
Reset the memory to be empty, ensuring that Delete() will be a no-op.
void Wrap(T *ptr, int size, bool own)
Wrap an externally allocated host pointer, ptr with the current host memory type returned by MemoryMa...
void Delete()
Delete the owned pointers and reset the Memory object.
void New(int size)
Allocate host memory for size entries with the current host memory type returned by MemoryManager::Ge...
int width
Dimension of the input / number of columns in the matrix.
int Height() const
Get the height (size of output) of the Operator. Synonym with NumRows().
int height
Dimension of the output / number of rows in the matrix.
virtual void Mult(const Vector &x, Vector &y) const =0
Operator application: y=A(x).
int Width() const
Get the width (size of input) of the Operator. Synonym with NumCols().
virtual void MultTranspose(const Vector &x, Vector &y) const
Action of the transpose operator: y=A^t(x). The default behavior in class Operator is to generate an ...
void SetDataAndSize(real_t *d, int s)
Set the Vector data and size.
int Size() const
Returns the size of the vector.
real_t * GetData() const
Return a pointer to the beginning of the Vector data.
void CalcOrtho(const DenseMatrix &J, Vector &n)
const T * Read(const Memory< T > &mem, int size, bool on_dev=true)
Get a pointer for read access to mem with the mfem::Device's DeviceMemoryClass, if on_dev = true,...
void Swap(Array< T > &, Array< T > &)
void AddMult_a_ABt(real_t a, const DenseMatrix &A, const DenseMatrix &B, DenseMatrix &ABt)
ABt += a * A * B^t.
void mfem_error(const char *msg)
void Mult(const Table &A, const Table &B, Table &C)
C = A * B (as boolean matrices)
void BatchLUSolve(const DenseTensor &Mlu, const Array< int > &P, Vector &X)
Solve batch linear systems. Calls BatchedLinAlg::LUSolve.
void AddMult_a(real_t alpha, const DenseMatrix &b, const DenseMatrix &c, DenseMatrix &a)
Matrix matrix multiplication. A += alpha * B * C.
void CalcAdjugateTranspose(const DenseMatrix &a, DenseMatrix &adjat)
Calculate the transposed adjugate of a matrix (for NxN matrices, N=1,2,3)
void MultVWt(const Vector &v, const Vector &w, DenseMatrix &VWt)
void MultADBt(const DenseMatrix &A, const Vector &D, const DenseMatrix &B, DenseMatrix &ADBt)
ADBt = A D B^t, where D is diagonal.
void AddMultVVt(const Vector &v, DenseMatrix &VVt)
VVt += v v^t.
T * Write(Memory< T > &mem, int size, bool on_dev=true)
Get a pointer for write access to mem with the mfem::Device's DeviceMemoryClass, if on_dev = true,...
OutStream out(std::cout)
Global stream used by the library for standard output. Initially it uses the same std::streambuf as s...
void MultADAt(const DenseMatrix &A, const Vector &D, DenseMatrix &ADAt)
ADAt = A D A^t, where D is diagonal.
void MultABt(const DenseMatrix &A, const DenseMatrix &B, DenseMatrix &ABt)
Multiply a matrix A with the transpose of a matrix B: A*Bt.
T * ReadWrite(Memory< T > &mem, int size, bool on_dev=true)
Get a pointer for read+write access to mem with the mfem::Device's DeviceMemoryClass,...
void CalcInverse(const DenseMatrix &a, DenseMatrix &inva)
void AddMult_a_VWt(const real_t a, const Vector &v, const Vector &w, DenseMatrix &VWt)
VWt += a * v w^t.
void RAP(const DenseMatrix &A, const DenseMatrix &P, DenseMatrix &RAP)
void AddMult_a_VVt(const real_t a, const Vector &v, DenseMatrix &VVt)
VVt += a * v v^t.
void BatchLUFactor(DenseTensor &Mlu, Array< int > &P, const real_t TOL)
Compute the LU factorization of a batch of matrices. Calls BatchedLinAlg::LUFactor.
void CalcAdjugate(const DenseMatrix &a, DenseMatrix &adja)
void AddMultVWt(const Vector &v, const Vector &w, DenseMatrix &VWt)
VWt += v w^t.
int CheckFinite(const real_t *v, const int n)
void AddMult_a_AtB(real_t a, const DenseMatrix &A, const DenseMatrix &B, DenseMatrix &AtB)
AtB += a * A^t * B.
void MultVVt(const Vector &v, DenseMatrix &vvt)
Make a matrix from a vector V.Vt.
bool LinearSolve(DenseMatrix &A, real_t *X, real_t TOL)
Solves the dense linear system, A * X = B for X
void AddMultABt(const DenseMatrix &A, const DenseMatrix &B, DenseMatrix &ABt)
ABt += A * B^t.
void AddMult_a_AAt(real_t a, const DenseMatrix &A, DenseMatrix &AAt)
AAt += a * A * A^t.
void MultAAt(const DenseMatrix &a, DenseMatrix &aat)
Calculate the matrix A.At.
void CalcInverseTranspose(const DenseMatrix &a, DenseMatrix &inva)
Calculate the inverse transpose of a matrix (for NxN matrices, N=1,2,3)
void AddMultADBt(const DenseMatrix &A, const Vector &D, const DenseMatrix &B, DenseMatrix &ADBt)
ADBt = A D B^t, where D is diagonal.
ComplexDenseMatrix * MultAtB(const ComplexDenseMatrix &A, const ComplexDenseMatrix &B)
Multiply the complex conjugate transpose of a matrix A with a matrix B. A^H*B.
void AddMult(const DenseMatrix &b, const DenseMatrix &c, DenseMatrix &a)
Matrix matrix multiplication. A += B * C.
void AddMultAtB(const DenseMatrix &A, const DenseMatrix &B, DenseMatrix &AtB)
AtB += A^t * B.
MemoryType
Memory types supported by MFEM.
void Mult_a_AAt(real_t a, const DenseMatrix &A, DenseMatrix &AAt)
AAt = a * A * A^t.
void Add(const DenseMatrix &A, const DenseMatrix &B, real_t alpha, DenseMatrix &C)
C = A + alpha*B.
void AddMultADAt(const DenseMatrix &A, const Vector &D, DenseMatrix &ADAt)
ADAt += A D A^t, where D is diagonal.