]> https://gitweb.dealii.org/ - dealii.git/commitdiff
lapack: add set(i,j,value)
authorDenis Davydov <davydden@gmail.com>
Fri, 16 Mar 2018 09:00:59 +0000 (10:00 +0100)
committerDenis Davydov <davydden@gmail.com>
Fri, 16 Mar 2018 09:28:51 +0000 (10:28 +0100)
include/deal.II/lac/lapack_full_matrix.h

index 0547f29e3c3e8c9ee289928a864159b656146ef8..e2a7d23673612da9a1963c7675a43394202df7a6 100644 (file)
@@ -135,6 +135,19 @@ public:
   LAPACKFullMatrix<number> &
   operator/= (const number factor);
 
+  /**
+   * Set a particular entry of the matrix to a @p value.
+   * Thus, calling <code>A.set(1,2,3.141);</code> is entirely equivalent to the operation <code>A(1,2) = 3.141;</code>.
+   * 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. <tt>*this += a*A</tt>.
    */
@@ -909,6 +922,16 @@ private:
 
 /*---------------------- Inline functions -----------------------------------*/
 
+template <typename number>
+inline
+void LAPACKFullMatrix<number>::set (const size_type i,
+                                    const size_type j,
+                                    const number value)
+{
+  (*this)(i,j) = value;
+}
+
+
 template <typename number>
 inline
 typename LAPACKFullMatrix<number>::size_type

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.