* Stores whether the preconditioner has been set up and eigenvalues have
* been computed.
*/
- bool is_initialized;
+ bool eigenvalues_are_initialized;
/**
* A mutex to avoid that multiple vmult() invocations by different threads
// a period of 11
for (unsigned int i=0; i<vector.size(); ++i)
vector(i) = i%11;
+
+ const Number mean_value = vector.mean_value();
+ vector.add(-mean_value);
}
template <typename Number>
// a period of 11
for (unsigned int i=0; i<vector.local_size(); ++i)
vector.local_element(i) = i%11;
+
+ const Number mean_value = vector.mean_value();
+ vector.add(-mean_value);
}
struct EigenvalueTracker
inline
PreconditionChebyshev<MatrixType,VectorType,PreconditionerType>::PreconditionChebyshev ()
:
- theta (1.),
- delta (1.),
- is_initialized (false)
+ theta (1.),
+ delta (1.),
+ eigenvalues_are_initialized (false)
{
static_assert(
std::is_same<size_type, typename VectorType::size_type>::value,
internal::PreconditionChebyshev::initialize_preconditioner(matrix,
data.preconditioner,
data.matrix_diagonal_inverse);
- is_initialized = false;
+ eigenvalues_are_initialized = false;
}
void
PreconditionChebyshev<MatrixType,VectorType,PreconditionerType>::clear ()
{
- is_initialized = false;
+ eigenvalues_are_initialized = false;
theta = delta = 1.0;
matrix_ptr = nullptr;
{
PreconditionChebyshev<MatrixType,VectorType,PreconditionerType>::estimate_eigenvalues
(const VectorType &src) const
{
- Assert(is_initialized == false, ExcInternalError());
+ Assert(eigenvalues_are_initialized == false, ExcInternalError());
Assert(data.preconditioner.get() != nullptr, ExcNotInitialized());
update1.reinit(src);
))
update3.reinit (src, true);
- const_cast<PreconditionChebyshev<MatrixType,VectorType,PreconditionerType> *>(this)->is_initialized = true;
+ const_cast<PreconditionChebyshev<MatrixType,VectorType,PreconditionerType> *>(this)->eigenvalues_are_initialized = true;
}
const VectorType &src) const
{
Threads::Mutex::ScopedLock lock(mutex);
- if (is_initialized == false)
+ if (eigenvalues_are_initialized == false)
estimate_eigenvalues(src);
internal::PreconditionChebyshev::vector_updates
const VectorType &src) const
{
Threads::Mutex::ScopedLock lock(mutex);
- if (is_initialized == false)
+ if (eigenvalues_are_initialized == false)
estimate_eigenvalues(src);
internal::PreconditionChebyshev::vector_updates
const VectorType &src) const
{
Threads::Mutex::ScopedLock lock(mutex);
- if (is_initialized == false)
+ if (eigenvalues_are_initialized == false)
estimate_eigenvalues(src);
if (!dst.all_zero())
const VectorType &src) const
{
Threads::Mutex::ScopedLock lock(mutex);
- if (is_initialized == false)
+ if (eigenvalues_are_initialized == false)
estimate_eigenvalues(src);
if (!dst.all_zero())