From: Daniel Arndt Date: Tue, 5 Jul 2016 15:31:37 +0000 (+0200) Subject: Use consistent order of arguments for PETScMatrix::add X-Git-Tag: v8.5.0-rc1~927^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=acb0850361f28172441d92e726b27858b5b371bc;p=dealii.git Use consistent order of arguments for PETScMatrix::add --- diff --git a/include/deal.II/lac/petsc_matrix_base.h b/include/deal.II/lac/petsc_matrix_base.h index 51bcad37d0..acca524ec2 100644 --- a/include/deal.II/lac/petsc_matrix_base.h +++ b/include/deal.II/lac/petsc_matrix_base.h @@ -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 dst = M*src with M diff --git a/source/lac/petsc_matrix_base.cc b/source/lac/petsc_matrix_base.cc index cea675dfb9..941370e3bc 100644 --- a/source/lac/petsc_matrix_base.cc +++ b/source/lac/petsc_matrix_base.cc @@ -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