]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use consistent order of arguments for PETScMatrix::add 2749/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Tue, 5 Jul 2016 15:31:37 +0000 (17:31 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Tue, 5 Jul 2016 15:51:16 +0000 (17:51 +0200)
include/deal.II/lac/petsc_matrix_base.h
source/lac/petsc_matrix_base.cc

index 51bcad37d07b4e7928f5b0dc76faf17fbf129636..acca524ec264b0b72a72bc14ad89600e6a507ef7 100644 (file)
@@ -701,12 +701,22 @@ namespace PETScWrappers
      */
     MatrixBase &operator /= (const PetscScalar factor);
 
+
+    /**
+     * Add the matrix @p other scaled by the factor @p factor to the current
+     * matrix.
+     */
+    MatrixBase &add (const PetscScalar factor,
+                     const MatrixBase &other);
+
+
     /**
      * Add the matrix @p other scaled by the factor @p factor to the current
      * matrix.
+     * @deprecated Use the function with order of arguments reversed instead.
      */
     MatrixBase &add (const MatrixBase &other,
-                     const PetscScalar factor);
+                     const PetscScalar factor) DEAL_II_DEPRECATED;
 
     /**
      * Matrix-vector multiplication: let <i>dst = M*src</i> with <i>M</i>
index cea675dfb9dc2ada9faf7fdbed6e32c825ff2581..941370e3bcce185fd4b8b79d7e3f6dbd72fa9c05 100644 (file)
@@ -470,8 +470,8 @@ namespace PETScWrappers
 
 
   MatrixBase &
-  MatrixBase::add (const MatrixBase &other,
-                   const PetscScalar factor)
+  MatrixBase::add (const PetscScalar factor,
+                   const MatrixBase &other)
   {
     const int ierr = MatAXPY (matrix, factor,
                               other, DIFFERENT_NONZERO_PATTERN);
@@ -483,6 +483,15 @@ namespace PETScWrappers
   }
 
 
+
+  MatrixBase &
+  MatrixBase::add (const MatrixBase &other,
+                   const PetscScalar factor)
+  {
+    return add(factor, other);
+  }
+
+
   void
   MatrixBase::vmult (VectorBase       &dst,
                      const VectorBase &src) const

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.