* diagonal entries in the
* matrix.
*/
- PetscReal trace () const;
+ PetscScalar trace () const;
#endif
/**
*/
real_type norm_sqr () const;
+#ifndef PETSC_USE_COMPLEX
/**
- * Mean value of the elements of
- * this vector.
+ * Return the mean value of the elements of this vector.
*/
PetscScalar mean_value () const;
+#endif
/**
* $l_1$-norm of the vector.
#if DEAL_II_PETSC_VERSION_GTE(3,1,0)
- PetscReal
+ PetscScalar
MatrixBase::trace () const
{
- PetscReal result;
+ PetscScalar result;
const int ierr
= MatGetTrace (matrix, &result);
return d*d;
}
-
-
+ // @todo does not build with PETSc complex scalar types.
+ // :425:25: error: no match for ‘operator/’ in ‘sum / dealii::PETScWrappers::VectorBase::size()’
+#ifndef PETSC_USE_COMPLEX
PetscScalar
VectorBase::mean_value () const
{
int ierr;
+
// We can only use our more efficient
// routine in the serial case.
if (dynamic_cast<const PETScWrappers::MPI::Vector *>(this) != 0)
{
PetscScalar sum;
- ierr = VecSum( vector, &sum);
+ ierr = VecSum(vector, &sum);
AssertThrow (ierr == 0, ExcPETScError(ierr));
return sum/size();
}
return mean;
}
-
+#endif
VectorBase::real_type
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