#include <dense_matrix_base.h>
Inherited by DenseMatrix< T >, and DenseSubMatrix< T >.
virtual ~DenseMatrixBase ()
virtual void zero ()=0
virtual T el (const unsigned int i, const unsigned int j) const =0
virtual T & el (const unsigned int i, const unsigned int j)=0
virtual void left_multiply (const DenseMatrixBase< T > &M2)=0
virtual void right_multiply (const DenseMatrixBase< T > &M3)=0
unsigned int m () const
unsigned int n () const
void print (std::ostream &os) const
void print_scientific (std::ostream &os) const
template<typename T2 , typename T3 > boostcopy::enable_if_c< ScalarTraits< T2 >::value, void >::type add (const T2 factor, const DenseMatrixBase< T3 > &mat)
DenseMatrixBase (const unsigned int m=0, const unsigned int n=0)
void multiply (DenseMatrixBase< T > &M1, const DenseMatrixBase< T > &M2, const DenseMatrixBase< T > &M3)
void condense (const unsigned int i, const unsigned int j, const T val, DenseVectorBase< T > &rhs)
unsigned int _m
unsigned int _n
std::ostream & operator<< (std::ostream &os, const DenseMatrixBase< T > &m)
Author:
Definition at line 45 of file dense_matrix_base.h.
Definition at line 53 of file dense_matrix_base.h.
: _m(m), _n(n) {};
Definition at line 60 of file dense_matrix_base.h.
{};
Definition at line 183 of file dense_matrix_base.h.
References DenseMatrixBase< T >::el(), DenseMatrixBase< T >::m(), and DenseMatrixBase< T >::n().
{
libmesh_assert (this->m() == mat.m());
libmesh_assert (this->n() == mat.n());
for (unsigned int j=0; j<this->n(); j++)
for (unsigned int i=0; i<this->m(); i++)
this->el(i,j) += factor*mat.el(i,j);
}
Definition at line 57 of file dense_matrix_base.C.
References DenseVectorBase< T >::el(), and DenseVectorBase< T >::size().
{
libmesh_assert (this->_m == rhs.size());
libmesh_assert (iv == jv);
// move the known value into the RHS
// and zero the column
for (unsigned int i=0; i<this->m(); i++)
{
rhs.el(i) -= this->el(i,jv)*val;
this->el(i,jv) = 0.;
}
// zero the row
for (unsigned int j=0; j<this->n(); j++)
this->el(iv,j) = 0.;
this->el(iv,jv) = 1.;
rhs.el(iv) = val;
}
Implemented in DenseMatrix< T >, and DenseMatrix< Number >.
Referenced by DenseMatrixBase< T >::add(), and DenseMatrixBase< T >::multiply().
Implemented in DenseMatrix< T >, and DenseMatrix< Number >.
Implemented in DenseMatrix< T >, and DenseMatrix< Number >.
Definition at line 98 of file dense_matrix_base.h.
Referenced by DenseMatrix< T >::_multiply_blas(), DenseMatrixBase< T >::add(), EpetraMatrix< T >::add_matrix(), PetscMatrix< T >::add_matrix(), LaspackMatrix< T >::add_matrix(), DofMap::build_constraint_matrix(), DofMap::constrain_element_dyad_matrix(), DofMap::constrain_element_matrix(), DofMap::constrain_element_matrix_and_vector(), DofMap::constrain_element_vector(), DofMap::extract_local_vector(), DenseMatrix< T >::get_transpose(), DenseMatrix< T >::left_multiply(), DenseMatrix< T >::left_multiply_transpose(), DofMap::max_constraint_error(), DenseMatrixBase< T >::multiply(), PatchRecoveryErrorEstimator::EstimateError::operator()(), DenseMatrix< T >::right_multiply(), and DenseMatrix< T >::right_multiply_transpose().
{ return _m; }
Definition at line 30 of file dense_matrix_base.C.
References DenseMatrixBase< T >::el(), DenseMatrixBase< T >::m(), and DenseMatrixBase< T >::n().
{
// Assertions to make sure we have been
// passed matrices of the correct dimension.
libmesh_assert (M1.m() == M2.m());
libmesh_assert (M1.n() == M3.n());
libmesh_assert (M2.n() == M3.m());
const unsigned int m_s = M2.m();
const unsigned int p_s = M2.n();
const unsigned int n_s = M1.n();
// Do it this way because there is a
// decent chance (at least for constraint matrices)
// that M3(k,j) = 0. when right-multiplying.
for (unsigned int k=0; k<p_s; k++)
for (unsigned int j=0; j<n_s; j++)
if (M3.el(k,j) != 0.)
for (unsigned int i=0; i<m_s; i++)
M1.el(i,j) += M2.el(i,k) * M3.el(k,j);
}
Definition at line 103 of file dense_matrix_base.h.
Referenced by DenseMatrix< T >::_multiply_blas(), DenseMatrixBase< T >::add(), EpetraMatrix< T >::add_matrix(), PetscMatrix< T >::add_matrix(), LaspackMatrix< T >::add_matrix(), DofMap::build_constraint_matrix(), DofMap::constrain_element_dyad_matrix(), DofMap::constrain_element_matrix(), DofMap::constrain_element_matrix_and_vector(), DofMap::constrain_element_vector(), DofMap::extract_local_vector(), DenseMatrix< T >::get_transpose(), DenseMatrix< T >::left_multiply(), DenseMatrix< T >::left_multiply_transpose(), DofMap::max_constraint_error(), DenseMatrixBase< T >::multiply(), PatchRecoveryErrorEstimator::EstimateError::operator()(), DenseMatrix< T >::right_multiply(), and DenseMatrix< T >::right_multiply_transpose().
{ return _n; }
Definition at line 127 of file dense_matrix_base.C.
{
for (unsigned int i=0; i<this->m(); i++)
{
for (unsigned int j=0; j<this->n(); j++)
os << std::setw(8)
<< this->el(i,j) << ' ';
os << std::endl;
}
return;
}
Definition at line 85 of file dense_matrix_base.C.
{
#ifndef LIBMESH_BROKEN_IOSTREAM
// save the initial format flags
std::ios_base::fmtflags os_flags = os.flags();
// Print the matrix entries.
for (unsigned int i=0; i<this->m(); i++)
{
for (unsigned int j=0; j<this->n(); j++)
os << std::setw(15)
<< std::scientific
<< std::setprecision(8)
<< this->el(i,j) << ' ';
os << std::endl;
}
// reset the original format flags
os.flags(os_flags);
#else
// Print the matrix entries.
for (unsigned int i=0; i<this->m(); i++)
{
for (unsigned int j=0; j<this->n(); j++)
os << std::setprecision(8)
<< this->el(i,j)
<< ' ';
os << std::endl;
}
#endif
}
Implemented in DenseMatrix< T >, and DenseMatrix< Number >.
Implemented in DenseMatrix< T >, and DenseMatrix< Number >.
Definition at line 115 of file dense_matrix_base.h.
{
m.print(os);
return os;
}
Definition at line 164 of file dense_matrix_base.h.
Referenced by DenseMatrixBase< Number >::m(), DenseMatrix< T >::operator=(), and DenseMatrix< T >::swap().
Definition at line 169 of file dense_matrix_base.h.
Referenced by DenseMatrixBase< Number >::n(), DenseMatrix< T >::operator=(), and DenseMatrix< T >::swap().
Generated automatically by Doxygen for libMesh from the source code.