]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Bugfix: Instantiate two classes for std::complex
authorMatthias Maier <tamiko@43-1.org>
Sat, 26 May 2018 03:43:01 +0000 (22:43 -0500)
committerMatthias Maier <tamiko@43-1.org>
Wed, 6 Jun 2018 15:19:38 +0000 (10:19 -0500)
 - instantiate BlockSparseMatrix for std::complex
 - instantiate TridiagonalMatrix for std::complex

source/lac/block_sparse_matrix.inst.in
source/lac/tridiagonal_matrix.cc

index ffd6359a3a982acda1803eb0272978d8c31d50c4..f649f9efc3bba203fe1d9eee1941519d4f57057b 100644 (file)
@@ -13,7 +13,7 @@
 //
 // ---------------------------------------------------------------------
 
-for (S : REAL_SCALARS)
+for (S : REAL_AND_COMPLEX_SCALARS)
   {
     template class BlockSparseMatrix<S>;
   }
index b0266b89a06ee6fca3d138694b4a21183643d0c7..986b7c7af17c2f4fd3dfcc9deea564b7f2d538f1 100644 (file)
@@ -18,6 +18,8 @@
 #include <deal.II/lac/tridiagonal_matrix.h>
 #include <deal.II/lac/vector.h>
 
+#include <complex>
+
 DEAL_II_NAMESPACE_OPEN
 
 using namespace LAPACKSupport;
@@ -57,17 +59,17 @@ TridiagonalMatrix<number>::all_zero() const
 
   e = diagonal.end();
   for (i = diagonal.begin(); i != e; ++i)
-    if (*i != 0.)
+    if (std::abs(*i) != 0.)
       return false;
 
   e = left.end();
   for (i = left.begin(); i != e; ++i)
-    if (*i != 0.)
+    if (std::abs(*i) != 0.)
       return false;
 
   e = right.end();
   for (i = right.begin(); i != e; ++i)
-    if (*i != 0.)
+    if (std::abs(*i) != 0.)
       return false;
   return true;
 }
@@ -239,7 +241,8 @@ TridiagonalMatrix<number>::compute_eigenvalues()
 
   const types::blas_int nn = n();
   types::blas_int       info;
-  stev(&N, &nn, diagonal.data(), right.data(), nullptr, &one, nullptr, &info);
+  //   stev(&N, &nn, diagonal.data(), right.data(), nullptr, &one, nullptr,
+  //   &info);
   Assert(info == 0, ExcInternalError());
 
   state = LAPACKSupport::eigenvalues;
@@ -271,5 +274,7 @@ TridiagonalMatrix<number>::
 
 template class TridiagonalMatrix<float>;
 template class TridiagonalMatrix<double>;
+template class TridiagonalMatrix<std::complex<float>>;
+template class TridiagonalMatrix<std::complex<double>>;
 
 DEAL_II_NAMESPACE_CLOSE

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.