<h3>lac</h3>
<ol>
+ <li>
+ <p>
+ New: Added a few simple helper functions (to VectorBase) that allow
+ some manipulation of PETSc vectors. These functions do what they say
+ in the documentation.
+ <br>
+ (Toby D. Young 2009/01/08)
+ </p>
+
<li>
<p>
New: There is now a class TrilinosWrappers::SparsityPattern that allows to
*/
real_type linfty_norm () const;
+ /**
+ * Normalize vector by dividing
+ * by the $l_2$-norm of the
+ * vector. Return vector norm
+ * before normalization.
+ */
+ real_type normalize () const;
+
+ /**
+ * Return vector component with
+ * the maximal magnitude.
+ */
+ real_type max () const;
+
+ /**
+ * Replace every element in a
+ * vector with its absolute
+ * value.
+ */
+ VectorBase & abs ();
+
+ /**
+ * Conjugate a vector.
+ */
+ VectorBase & conjugate ();
+
/**
* Return whether the vector contains
* only elements with value zero. This
+ VectorBase::real_type
+ VectorBase::normalize () const
+ {
+ PetscScalar d;
+
+ const int ierr = VecNormalize (vector, &d);
+ AssertThrow (ierr == 0, ExcPETScError(ierr));
+
+ return d;
+ }
+
+
+
+ VectorBase::real_type
+ VectorBase::max () const
+ {
+ PetscInt p;
+ PetscScalar d;
+
+ const int ierr = VecMax (vector, &p, &d);
+ AssertThrow (ierr == 0, ExcPETScError(ierr));
+
+ return d;
+ }
+
+
+
+ VectorBase &
+ VectorBase::abs ()
+ {
+ const int ierr = VecAbs (vector);
+ AssertThrow (ierr == 0, ExcPETScError(ierr));
+
+ return *this;
+ }
+
+
+
+ VectorBase &
+ VectorBase::conjugate ()
+ {
+ const int ierr = VecConjugate (vector);
+ AssertThrow (ierr == 0, ExcPETScError(ierr));
+
+ return *this;
+ }
+
+
+
bool
VectorBase::all_zero () const
{