]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Unconditionally instantiate complex FullMatrix. 14939/head
authorDavid Wells <drwells@email.unc.edu>
Tue, 21 Mar 2023 21:17:48 +0000 (17:17 -0400)
committerDavid Wells <drwells@email.unc.edu>
Wed, 22 Mar 2023 12:02:18 +0000 (08:02 -0400)
Like the previous commit - we need it for complex eigenvalues.

source/lac/full_matrix.cc
source/lac/full_matrix.inst.in

index b0c19ccb38c136394fc813802a89a25134c5a25e..63f50b263133ae64d9a3762783e1de1585beb031 100644 (file)
@@ -23,11 +23,14 @@ DEAL_II_NAMESPACE_OPEN
 
 #ifndef DOXYGEN
 
-#  ifndef DEAL_II_WITH_COMPLEX_VALUES
-// instantiate for std::complex<double> because we use it internally in
-// FESeries.
+// We use FullMatrix<std::complex<T>> for complex eigenvalues so ignore the
+// value of DEAL_II_WITH_COMPLEX_VALUES and always instantiate. As a consequence
+// we cannot use REAL_AND_COMPLEX_SCALARS without getting duplicate
+// instantiations so do float and double here too.
+template class FullMatrix<float>;
+template class FullMatrix<double>;
+template class FullMatrix<std::complex<float>>;
 template class FullMatrix<std::complex<double>>;
-#  endif
 
 // instantiate for long double manually because we use it in a few places
 // inside the library
@@ -74,12 +77,10 @@ FullMatrix<long double>::add<long double>(const long double,
 TEMPL_OP_EQ(double, float);
 TEMPL_OP_EQ(float, double);
 
-#  ifdef DEAL_II_WITH_COMPLEX_VALUES
 TEMPL_OP_EQ(std::complex<double>, std::complex<float>);
 TEMPL_OP_EQ(std::complex<float>, std::complex<double>);
 TEMPL_OP_EQ(std::complex<double>, double);
 TEMPL_OP_EQ(std::complex<float>, float);
-#  endif
 
 #  undef TEMPL_OP_EQ
 
index 90b48df1350331c03a7e3fd2e32d5a3484ccf503..23e334aeb8b087dd6b77719fa75465a601dc7317 100644 (file)
@@ -17,8 +17,6 @@
 
 for (S : REAL_AND_COMPLEX_SCALARS)
   {
-    template class FullMatrix<S>;
-
     template void FullMatrix<S>::print(LogStream &,
                                        const unsigned int,
                                        const unsigned int) const;

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.