From: Denis Davydov Date: Fri, 21 Oct 2016 14:40:05 +0000 (+0200) Subject: use std::complex in (P)Arpack::set_shift() X-Git-Tag: v8.5.0-rc1~544^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3275%2Fhead;p=dealii.git use std::complex in (P)Arpack::set_shift() --- diff --git a/include/deal.II/lac/arpack_solver.h b/include/deal.II/lac/arpack_solver.h index e43e13000f..887e358d67 100644 --- a/include/deal.II/lac/arpack_solver.h +++ b/include/deal.II/lac/arpack_solver.h @@ -162,12 +162,11 @@ public: void set_initial_vector(const VectorType &vec); /** - * Set real @p sigmar and complex @p sigmai parts of the shift for - * shift-and-invert spectral transformation. + * Set shift @p sigma for shift-and-invert spectral transformation. * * If this function is not called, the shift is assumed to be zero. */ - void set_shift(const double sigmar, const double sigmai = 0); + void set_shift(const std::complex sigma); /** * Solve the generalized eigensprectrum problem $A x=\lambda B x$ by calling @@ -362,10 +361,10 @@ ArpackSolver::ArpackSolver (SolverControl &control, inline void -ArpackSolver::set_shift(const double r, const double i) +ArpackSolver::set_shift(const std::complex sigma) { - sigmar = r; - sigmai = i; + sigmar = sigma.real(); + sigmai = sigma.imag(); } diff --git a/include/deal.II/lac/parpack_solver.h b/include/deal.II/lac/parpack_solver.h index 2346edf29f..950edc9ece 100644 --- a/include/deal.II/lac/parpack_solver.h +++ b/include/deal.II/lac/parpack_solver.h @@ -264,12 +264,11 @@ public: void set_initial_vector(const VectorType &vec); /** - * Set real @p sigmar and complex @p sigmai parts of the shift for - * shift-and-invert spectral transformation. + * Set shift @p sigma for shift-and-invert spectral transformation. * * If this function is not called, the shift is assumed to be zero. */ - void set_shift(const double sigmar, const double sigmai = 0.); + void set_shift(const std::complex sigma); /** * Solve the generalized eigensprectrum problem $A x=\lambda B x$ by calling @@ -533,10 +532,10 @@ PArpackSolver::PArpackSolver (SolverControl &control, {} template -void PArpackSolver::set_shift(const double r, const double i ) +void PArpackSolver::set_shift(const std::complex sigma) { - sigmar = r; - sigmai = i; + sigmar = sigma.real(); + sigmai = sigma.imag(); } template