From: Denis Davydov Date: Fri, 16 Mar 2018 09:00:59 +0000 (+0100) Subject: lapack: add set(i,j,value) X-Git-Tag: v9.0.0-rc1~317^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2bd630bece53e4e791147dc45ce559d50df44b05;p=dealii.git lapack: add set(i,j,value) --- diff --git a/include/deal.II/lac/lapack_full_matrix.h b/include/deal.II/lac/lapack_full_matrix.h index 0547f29e3c..e2a7d23673 100644 --- a/include/deal.II/lac/lapack_full_matrix.h +++ b/include/deal.II/lac/lapack_full_matrix.h @@ -135,6 +135,19 @@ public: LAPACKFullMatrix & operator/= (const number factor); + /** + * Set a particular entry of the matrix to a @p value. + * Thus, calling A.set(1,2,3.141); is entirely equivalent to the operation A(1,2) = 3.141;. + * This function exists for compatibility with the various sparse matrix objects. + * + * @param i The row index of the element to be set. + * @param j The column index of the element to be set. + * @param value The value to be written into the element. + */ + void set (const size_type i, + const size_type j, + const number value); + /** * Simple addition of a scaled matrix, i.e. *this += a*A. */ @@ -909,6 +922,16 @@ private: /*---------------------- Inline functions -----------------------------------*/ +template +inline +void LAPACKFullMatrix::set (const size_type i, + const size_type j, + const number value) +{ + (*this)(i,j) = value; +} + + template inline typename LAPACKFullMatrix::size_type