From 4ce51051c84d50401cc5ecdca2b511780a4d286a Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Fri, 21 Oct 2016 16:40:05 +0200 Subject: [PATCH] use std::complex in (P)Arpack::set_shift() --- include/deal.II/lac/arpack_solver.h | 11 +++++------ include/deal.II/lac/parpack_solver.h | 11 +++++------ 2 files changed, 10 insertions(+), 12 deletions(-) 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 -- 2.39.5