</p>
<ol>
+ <li> <p>Changed: A few simple PETSc wrappers forhelper functions
+ <code>MatrixBase::transpose</code>,
+ <code>MatrixBase::is_symmetric</code>,
+ <code>MatrixBase::is_hermitian</code>,
+ <code>MatrixBase::is_hermitian</code>, and
+ <code>MatrixBase::write_ascii</code> have been added.
+ <br>
+ (Toby D. Young 2008/04/30)
+ </p>
+
<li> <p>Removed: The <code>FullMatrix::add_diag</code> function was removed. It
offered functionality of questionable use in the first place, and its
implementation was correct only for matrices of size $3 \times 3$, $4 \times 4$
*/
operator const Mat () const;
+ /**
+ * Make an in-place transpose of a
+ * matrix.
+ */
+ void transpose ();
+
+ /**
+ * Test whether a matrix is symmetric.
+ * Default tolerance is zero.
+ */
+ PetscTruth is_symmetric (const double tol = 0.0);
+
+ /**
+ * Test whether a matrix is Hermitian,
+ * i.e. it is the complex conjugate
+ * of its transpose.
+ */
+ PetscTruth is_hermitian ();
+
+ /*
+ * Abstract PETSc object that helps view
+ * in ASCII other PETSc objects. Currently
+ * this function simply writes non-zero
+ * elements of a matrix to the terminal.
+ */
+ void write_ascii ();
+
/**
* Exception
*/
{
return matrix;
}
+
+ void
+ MatrixBase::transpose ()
+ {
+ int ierr;
+ ierr = MatTranspose(matrix, PETSC_NULL);
+ AssertThrow (ierr == 0, ExcPETScError(ierr));
+ }
+
+ PetscTruth
+ MatrixBase::is_symmetric (const double tolerance)
+ {
+ PetscTruth truth;
+ // First flush PETSc caches
+ compress ();
+ MatIsSymmetric (matrix, tolerance, &truth);
+ return truth;
+ }
+
+ PetscTruth
+ MatrixBase::is_hermitian ()
+ {
+ PetscTruth truth;
+ // First flush PETSc caches
+ compress ();
+ MatIsHermitian (matrix, &truth);
+ return truth;
+ }
+
+ void
+ MatrixBase::write_ascii ()
+ {
+ // First flush PETSc caches
+ compress ();
+
+ // Write to screen
+ PetscViewerSetFormat (PETSC_VIEWER_STDOUT_WORLD,
+ PETSC_VIEWER_ASCII_DEFAULT);
+
+ MatView (matrix,PETSC_VIEWER_STDOUT_WORLD);
+ }
+
}
DEAL_II_NAMESPACE_CLOSE