]> https://gitweb.dealii.org/ - dealii.git/commitdiff
use std::complex in (P)Arpack::set_shift() 3275/head
authorDenis Davydov <davydden@gmail.com>
Fri, 21 Oct 2016 14:40:05 +0000 (16:40 +0200)
committerDenis Davydov <davydden@gmail.com>
Tue, 25 Oct 2016 12:41:31 +0000 (14:41 +0200)
include/deal.II/lac/arpack_solver.h
include/deal.II/lac/parpack_solver.h

index e43e13000f8a6c7493120d9e84d3b6b6bcb634a8..887e358d67d6a8fca3b051ef58c5d55d6f7e79a3 100644 (file)
@@ -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<double> 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<double> sigma)
 {
-  sigmar = r;
-  sigmai = i;
+  sigmar = sigma.real();
+  sigmai = sigma.imag();
 }
 
 
index 2346edf29f347691a9db964e4b41033bdc5d8084..950edc9ecec2844b674ec116e10c943990f703a5 100644 (file)
@@ -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<double> sigma);
 
   /**
    * Solve the generalized eigensprectrum problem $A x=\lambda B x$ by calling
@@ -533,10 +532,10 @@ PArpackSolver<VectorType>::PArpackSolver (SolverControl        &control,
 {}
 
 template <typename VectorType>
-void PArpackSolver<VectorType>::set_shift(const double r, const double i )
+void PArpackSolver<VectorType>::set_shift(const std::complex<double> sigma)
 {
-  sigmar = r;
-  sigmai = i;
+  sigmar = sigma.real();
+  sigmai = sigma.imag();
 }
 
 template <typename VectorType>

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.