From 2bd630bece53e4e791147dc45ce559d50df44b05 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Fri, 16 Mar 2018 10:00:59 +0100 Subject: [PATCH] lapack: add set(i,j,value) --- include/deal.II/lac/lapack_full_matrix.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) 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 -- 2.39.5