Go to the documentation of this file.
20 #ifndef LIBMESH_DENSE_MATRIX_BASE_IMPL_H
21 #define LIBMESH_DENSE_MATRIX_BASE_IMPL_H
24 #include "libmesh/dense_matrix.h"
25 #include "libmesh/dense_vector_base.h"
26 #include "libmesh/dense_vector.h"
27 #include "libmesh/int_range.h"
40 for (decltype(_m) i = 0; i < _m; ++i)
52 libmesh_assert_equal_to (M1.
m(), M2.
m());
53 libmesh_assert_equal_to (M1.
n(), M3.
n());
54 libmesh_assert_equal_to (M2.
n(), M3.
m());
56 const unsigned int m_s = M2.
m();
57 const unsigned int p_s = M2.
n();
58 const unsigned int n_s = M1.
n();
63 for (
unsigned int k=0; k<p_s; k++)
64 for (
unsigned int j=0; j<n_s; j++)
66 for (
unsigned int i=0; i<m_s; i++)
67 M1.
el(i,j) += M2.
el(i,k) * M3.
el(k,j);
74 const unsigned int jv,
78 libmesh_assert_equal_to (this->_m, rhs.
size());
79 libmesh_assert_equal_to (iv, jv);
86 rhs.
el(i) -= this->el(i,jv)*val;
104 std::ios_base::fmtflags os_flags = os.flags();
112 << std::setprecision(precision)
113 << this->el(i,j) <<
" ";
131 << this->el(i,j) <<
" ";
143 #endif // LIBMESH_DENSE_MATRIX_BASE_IMPL_H
DenseVector< T > diagonal() const
Return the matrix diagonal.
void print_scientific(std::ostream &os, unsigned precision=8) const
Prints the matrix entries with more decimal places in scientific notation.
static void multiply(DenseMatrixBase< T > &M1, const DenseMatrixBase< T > &M2, const DenseMatrixBase< T > &M3)
Helper function - Performs the computation M1 = M2 * M3 where: M1 = (m x n) M2 = (m x p) M3 = (p x n)
The libMesh namespace provides an interface to certain functionality in the library.
Defines an abstract dense vector base class for use in Finite Element-type computations.
virtual T el(const unsigned int i) const =0
void condense(const unsigned int i, const unsigned int j, const T val, DenseVectorBase< T > &rhs)
Condense-out the (i,j) entry of the matrix, forcing it to take on the value val.
The IntRange templated class is intended to make it easy to loop over integers which are indices of a...
Defines an abstract dense matrix base class for use in Finite Element-type computations.
virtual unsigned int size() const =0
void print(std::ostream &os=libMesh::out) const
Pretty-print the matrix, by default to libMesh::out.
virtual T el(const unsigned int i, const unsigned int j) const =0
Defines a dense vector for use in Finite Element-type computations.