54template <
typename VectorType = Vector<
double>>
86 const AdditionalData &
data = AdditionalData());
95 template <
typename MatrixType>
97 solve(
double &value,
const MatrixType &A, VectorType &x);
127template <
typename VectorType = Vector<
double>>
171 const AdditionalData &
data = AdditionalData());
180 template <
typename MatrixType>
182 solve(
double &value,
const MatrixType &A, VectorType &x);
195template <
typename VectorType>
200 , additional_data(
data)
205template <
typename VectorType>
206template <
typename MatrixType>
221 double length = x.l2_norm();
222 double old_length = 0.;
231 y.add(additional_data.shift, x);
235 length = y.l2_norm();
241 double thresh = length / x.size();
247 while (std::fabs(entry) < thresh);
252 value = (entry * x(i) < 0.) ? -length : length;
253 value -= additional_data.shift;
256 x.equ(1 / length, y);
263 conv = this->iteration_status(iter,
264 std::fabs(1. / length - 1. / old_length),
271 iter, std::fabs(1. / length - 1. / old_length)));
278template <
typename VectorType>
283 , additional_data(
data)
288template <
typename VectorType>
289template <
typename MatrixType>
301 double current_shift = -value;
310 unsigned int goal = additional_data.start_adaption;
320 double length = x.l2_norm();
321 double old_value = value;
326 double res = std::numeric_limits<double>::lowest();
330 solver.
solve(A_s, y, x, prec);
333 length = y.l2_norm();
339 double thresh = length / x.size();
345 while (std::fabs(entry) < thresh);
350 value = (entry * x(i) < 0. ? -1. : 1.) / length - current_shift;
354 const auto &relaxation = additional_data.relaxation;
355 const double new_shift =
356 relaxation * (-value) + (1. - relaxation) * current_shift;
359 current_shift = new_shift;
365 x.equ(1. / length, y);
367 if (additional_data.use_residual)
371 r.sadd(-1., value, x);
374 conv = this->iteration_status(iter, res, x);
378 res = std::fabs(1. / value - 1. / old_value);
379 conv = this->iteration_status(iter, res, x);
EigenInverse(SolverControl &cn, VectorMemory< VectorType > &mem, const AdditionalData &data=AdditionalData())
AdditionalData additional_data
void solve(double &value, const MatrixType &A, VectorType &x)
EigenPower(SolverControl &cn, VectorMemory< VectorType > &mem, const AdditionalData &data=AdditionalData())
void solve(double &value, const MatrixType &A, VectorType &x)
AdditionalData additional_data
@ iterate
Continue iteration.
@ success
Stop iteration, goal reached.
void solve(const MatrixType &A, VectorType &x, const VectorType &b, const PreconditionerType &preconditioner)
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define Assert(cond, exc)
static ::ExceptionBase & ExcInternalError()
#define AssertThrow(cond, exc)
LinearOperator< Range, Domain, Payload > linear_operator(const OperatorExemplar &, const Matrix &)
LinearOperator< Range, Domain, Payload > identity_operator(const LinearOperator< Range, Domain, Payload > &)
std::vector< index_type > data
unsigned int global_dof_index
AdditionalData(double relaxation=1., unsigned int start_adaption=6, bool use_residual=true)
unsigned int start_adaption
AdditionalData(const double shift=0.)