#ifdef DEAL_II_WITH_PETSC
+#ifndef PETSC_USE_COMPLEX
PetscScalar
max_element (const PETScWrappers::Vector &criteria)
{
- // this is horribly slow (since we have
- // to get the array of values from PETSc
- // in every iteration), but works
+ // this is horribly slow (since we have to get the array of
+ // values from PETSc in every iteration), but works
PetscScalar m = 0;
- // @whattodo How do we get the maximum element of a complex vector? This only makes sense in real.
- // for (unsigned int i=0; i<criteria.size(); ++i)
- // m = std::max (m, criteria(i));
+ for (unsigned int i=0; i<criteria.size(); ++i)
+ m = std::max (m, criteria(i));
Assert ((false), ExcMessage ("This function is corrupt: @whattodo"));
return m;
}
-
-
+
+
PetscScalar
min_element (const PETScWrappers::Vector &criteria)
{
- // this is horribly slow (since we have
- // to get the array of values from PETSc
- // in every iteration), but works
+ // this is horribly slow (since we have to get the array of
+ // values from PETSc in every iteration), but works
PetscScalar m = criteria(0);
- // @whattodo How do we get the minimum element of a complex vector? This only makes sense in real.
- // for (unsigned int i=1; i<criteria.size(); ++i)
- // m = std::min (m, criteria(i));
+ for (unsigned int i=1; i<criteria.size(); ++i)
+ m = std::min (m, criteria(i));
Assert ((false), ExcMessage ("This function is corrupt: @whattodo"));
return m;
}
#endif
+#endif
#ifdef DEAL_II_WITH_TRILINOS