72 template <
int M,
int N,
typename T = real_t>
76 for (
int i = 0; i < M; i++)
78 for (
int j = 0; j < N; j++)
80 (*this)(i,j) = values[i][j];
151 const real_t &
Elem(
int i,
int j)
const override;
191 const real_t a = 1.0)
const override;
277 MFEM_ASSERT(v.
Size() ==
Width(),
"incompatible Vector size!");
296 { Eigensystem(ev, &evect); }
300 { Eigensystem(ev, &evect); }
305 { Eigensystem(
b, ev); }
309 { Eigensystem(
b, ev, &evect); }
314 { Eigensystem(
b, ev, &evect); }
396 int row_offset,
int col_offset);
507void Add(
const DenseMatrix &A,
const DenseMatrix &B,
516 real_t beta,
const DenseMatrix &B, DenseMatrix &C);
535void Mult(
const DenseMatrix &
b,
const DenseMatrix &c, DenseMatrix &
a);
538void AddMult(
const DenseMatrix &
b,
const DenseMatrix &c, DenseMatrix &
a);
554void CalcInverse(
const DenseMatrix &
a, DenseMatrix &inva);
562void CalcOrtho(
const DenseMatrix &J, Vector &n);
565void MultAAt(
const DenseMatrix &
a, DenseMatrix &aat);
568void MultADAt(
const DenseMatrix &A,
const Vector &D, DenseMatrix &ADAt);
571void AddMultADAt(
const DenseMatrix &A,
const Vector &D, DenseMatrix &ADAt);
574void MultABt(
const DenseMatrix &A,
const DenseMatrix &B, DenseMatrix &ABt);
577void MultADBt(
const DenseMatrix &A,
const Vector &D,
578 const DenseMatrix &B, DenseMatrix &ADBt);
581void AddMultABt(
const DenseMatrix &A,
const DenseMatrix &B, DenseMatrix &ABt);
584void AddMultADBt(
const DenseMatrix &A,
const Vector &D,
585 const DenseMatrix &B, DenseMatrix &ADBt);
592void MultAtB(
const DenseMatrix &A,
const DenseMatrix &B, DenseMatrix &AtB);
595void AddMultAtB(
const DenseMatrix &A,
const DenseMatrix &B, DenseMatrix &AtB);
608void MultVVt(
const Vector &v, DenseMatrix &vvt);
610void MultVWt(
const Vector &v,
const Vector &w, DenseMatrix &VWt);
613void AddMultVWt(
const Vector &v,
const Vector &w, DenseMatrix &VWt);
616void AddMultVVt(
const Vector &v, DenseMatrix &VWt);
627void RAP(
const DenseMatrix &A,
const DenseMatrix &P, DenseMatrix &
RAP);
631void RAP(
const DenseMatrix &Rt,
const DenseMatrix &A,
632 const DenseMatrix &P, DenseMatrix &
RAP);
718 void Solve(
int m,
int n,
real_t *X)
const override;
821 void Solve(
int m,
int n,
real_t *X)
const override;
844 bool own_data =
false;
894#ifdef MFEM_USE_LAPACK
944 bool left_eigen_vectors =
false,
945 bool right_eigen_vectors =
false);
969#ifdef MFEM_USE_LAPACK
992 bool left_singular_vectors=
false,
993 bool right_singular_vectors=
false);
1010 bool left_singular_vectors=
false,
1011 bool right_singular_vectors=
false);
1035 char left_singular_vectors=
'A',
1036 char right_singular_vectors=
'A');
1061 char left_singular_vectors=
'A',
1062 char right_singular_vectors=
'A');
1120 DenseTensor(
int i,
int j,
int k) : tdata(i*j*k), ni(i), nj(j), nk(k) { }
1123 : tdata(d, i*j*k), ni(i), nj(j), nk(k) { }
1126 : tdata(i*j*k, mt), ni(i), nj(j), nk(k) { }
1137 tdata.
GetMemory().GetMemoryType() : mt_;
1151 tdata.
MakeRef(ext_data, i*j*k);
1186 MFEM_ASSERT_INDEX_IN_RANGE(k, 0,
SizeK());
1192 MFEM_ASSERT_INDEX_IN_RANGE(k, 0,
SizeK());
1199 MFEM_ASSERT_INDEX_IN_RANGE(i, 0,
SizeI());
1200 MFEM_ASSERT_INDEX_IN_RANGE(j, 0,
SizeJ());
1201 MFEM_ASSERT_INDEX_IN_RANGE(k, 0,
SizeK());
1207 MFEM_ASSERT_INDEX_IN_RANGE(i, 0,
SizeI());
1208 MFEM_ASSERT_INDEX_IN_RANGE(j, 0,
SizeJ());
1209 MFEM_ASSERT_INDEX_IN_RANGE(k, 0,
SizeK());
1215 MFEM_ASSERT_INDEX_IN_RANGE(k, 0,
SizeK());
1221 MFEM_ASSERT_INDEX_IN_RANGE(k, 0,
SizeK());
1286void BatchLUSolve(
const DenseTensor &Mlu,
const Array<int> &P, Vector &X);
1288#ifdef MFEM_USE_LAPACK
1289void BandedSolve(
int KL,
int KU, DenseMatrix &AB, DenseMatrix &B,
1292 bool transpose, Array<int> &ipiv);
1299 MFEM_ASSERT(data && i >= 0 && i < height && j >= 0 && j <
width,
"");
1305 MFEM_ASSERT(data && i >= 0 && i < height && j >= 0 && j <
width,
"");
Memory< T > & GetMemory()
Return a reference to the Memory object used by the Array.
const T * HostRead() const
Shortcut for mfem::Read(a.GetMemory(), a.Size(), false).
T * ReadWrite(bool on_dev=true)
Shortcut for mfem::ReadWrite(a.GetMemory(), a.Size(), on_dev).
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
void LoseData()
NULL-ifies the data.
void MakeRef(T *data_, int size_, bool own_data=false)
Make this Array a reference to a pointer.
void DeleteAll()
Delete the whole array.
T * Write(bool on_dev=true)
Shortcut for mfem::Write(a.GetMemory(), a.Size(), on_dev).
T * GetData()
Returns the data.
bool OwnsData() const
Return true if the data will be deleted by the Array.
const T * Read(bool on_dev=true) const
Shortcut for mfem::Read(a.GetMemory(), a.Size(), on_dev).
T * HostReadWrite()
Shortcut for mfem::ReadWrite(a.GetMemory(), a.Size(), false).
std::size_t MemoryUsage() const
Returns the number of bytes allocated for the array including any reserve.
void NewMemoryAndSize(const Memory< T > &mem, int s, bool own_mem)
Reset the Array to use the given external Memory mem and size s.
T * HostWrite()
Shortcut for mfem::Write(a.GetMemory(), a.Size(), false).
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).
DenseMatrix(DenseMatrix &&)=default
Move constructor.
void CalcEigenvalues(real_t *lambda, real_t *vec) const
void Eigenvalues(Vector &ev)
Compute eigenvalues of A x = ev x where A = *this.
int TotalSize() const
Total size = width*height.
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. Warning: this method casts away constness.
const Memory< real_t > & GetMemory() const
void GetSubMatrix(const Array< int > &idx, DenseMatrix &A) const
real_t * GetData() const
Returns the matrix data array. Warning: this method casts away constness.
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.
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.
void AbsMult(const Vector &x, Vector &y) const override
Absolute-value matrix vector multiplication.
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 AbsMultTranspose(const Vector &x, Vector &y) const override
Multiply a vector with the absolute-value transpose matrix.
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)
DenseMatrix & operator=(const DenseMatrix &)=default
Copy assignment (deep copy).
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.
void Eigenvalues(DenseMatrix &b, Vector &ev)
real_t MaxMaxNorm() const
Compute the norm ||A|| = max_{ij} |A_{ij}|.
DenseMatrix(const DenseMatrix &)=default
Copy constructor (deep copy).
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.
DenseMatrix & operator=(DenseMatrix &&)=default
Move assignment.
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)
DenseMatrix & operator()(int k, DenseMatrix &buff)
real_t * HostWrite()
Shortcut for mfem::Write(GetMemory(), TotalSize(), false).
const DenseMatrix & operator()(int k, DenseMatrix &buff) const
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
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}.
static constexpr int ipiv_base
Abstract data type for matrix inverse.
Abstract data type matrix.
Class used by MFEM to store pointers to host and/or device memory.
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 ...
Table stores the connectivity of elements of TYPE I to elements of TYPE II. For example,...
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)
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.
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.
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 Swap(T &a, T &b)
Swap objects of type T. The operation is performed using the most specialized swap function from the ...
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 BandedFactorizedSolve(int KL, int KU, DenseMatrix &AB, DenseMatrix &B, bool transpose, Array< int > &ipiv)
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.
void BandedSolve(int KL, int KU, DenseMatrix &AB, DenseMatrix &B, Array< int > &ipiv)