*/
PetscReal frobenius_norm () const;
+#if DEAL_II_PETSC_VERSION_GTE(3,1,0)
+ /**
+ * Return the trace of the
+ * matrix, i.e. the sum of all
+ * diagonal entries in the
+ * matrix.
+ */
+ PetscReal trace () const;
+#endif
+
/**
* Multiply the entire matrix by a
* fixed factor.
*/
VectorBase & mult ();
+ /**
+ * A collective piecewise
+ * multiply operation of two
+ * vectors.
+ */
+ VectorBase & mult (const VectorBase &v);
+
/**
* Return whether the vector contains
* only elements with value zero. This
+#if DEAL_II_PETSC_VERSION_GTE(3,1,0)
+ PetscReal
+ MatrixBase::trace () const
+ {
+ PetscReal result;
+
+ const int ierr
+ = MatGetTrace (matrix, &result);
+ AssertThrow (ierr == 0, ExcPETScError(ierr));
+
+ return result;
+ }
+#endif
+
+
+
MatrixBase &
MatrixBase::operator *= (const PetscScalar a)
{
return *this;
}
+ VectorBase &
+ VectorBase::mult (const VectorBase &v)
+ {
+ const int ierr = VecPointwiseMult (vector,vector,v);
+ AssertThrow (ierr == 0, ExcPETScError(ierr));
+
+ return *this;
+ }
+
bool
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