]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Generate instantiations automatically
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Sun, 9 Dec 2007 18:54:32 +0000 (18:54 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Sun, 9 Dec 2007 18:54:32 +0000 (18:54 +0000)
git-svn-id: https://svn.dealii.org/trunk@15580 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/source/block_vector.cc
deal.II/lac/source/block_vector.inst.in [new file with mode: 0644]

index 7a889ac1a917b5769a5996b62c7ffdf545f972fe..14ee44b6a28a6c552da79fe6358838065d02dea3 100644 (file)
 
 DEAL_II_NAMESPACE_OPEN
 
-// explicit instantiations for real data types
-template class BlockVector<double>;
-template class BlockVector<float>;
+#include "block_vector.inst"
 
+// these functions can't be generated by the preprocessor since
+// the template arguments need to be different
 #ifndef DEAL_II_EXPLICIT_CONSTRUCTOR_BUG    
 template BlockVector<double>::BlockVector (const BlockVector<float> &);
 template BlockVector<float>::BlockVector (const BlockVector<double> &);
-#endif
-
-template void BlockVector<double>::reinit<double>(const BlockVector<double>&,
-                                                 const bool);
-template void BlockVector<double>::reinit<float>(const BlockVector<float>&,
-                                                const bool);
-
-template void BlockVector<float>::reinit<double>(const BlockVector<double>&,
-                                                const bool);
-template void BlockVector<float>::reinit<float>(const BlockVector<float>&,
-                                               const bool);
-
-// explicit instantiations for complex data types
-template class BlockVector<std::complex<double> >;
-template class BlockVector<std::complex<float> >;
 
-#ifndef DEAL_II_EXPLICIT_CONSTRUCTOR_BUG    
 template BlockVector<std::complex<double> >::BlockVector (const BlockVector<std::complex<float> > &);
 template BlockVector<std::complex<float> >::BlockVector (const BlockVector<std::complex<double> > &);
 #endif
 
-template void BlockVector<std::complex<double> >::reinit<std::complex<double> >(const BlockVector<std::complex<double> >&,
-                                                 const bool);
-template void BlockVector<std::complex<double> >::reinit<std::complex<float> >(const BlockVector<std::complex<float> >&,
-                                                const bool);
-
-template void BlockVector<std::complex<float> >::reinit<std::complex<double> >(const BlockVector<std::complex<double> >&,
-                                                const bool);
-template void BlockVector<std::complex<float> >::reinit<std::complex<float> >(const BlockVector<std::complex<float> >&,
-                                               const bool);
-
-
 DEAL_II_NAMESPACE_CLOSE
diff --git a/deal.II/lac/source/block_vector.inst.in b/deal.II/lac/source/block_vector.inst.in
new file mode 100644 (file)
index 0000000..6a303cd
--- /dev/null
@@ -0,0 +1,36 @@
+//---------------------------------------------------------------------------
+//    $Id: block_vector.cc 15454 2007-11-06 21:20:29Z bangerth $
+//    Version: $Name$
+//
+//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//---------------------------------------------------------------------------
+
+
+for (S : REAL_SCALAR)
+  {
+    template class BlockVector<S>;
+  }
+
+for (S1, S2 : REAL_SCALAR)
+  {
+    template void BlockVector<S1>::reinit<S2>(const BlockVector<S2>&,
+                                             const bool);
+  }
+
+
+for (S : COMPLEX_SCALAR)
+  {
+    template class BlockVector<S>;
+  }
+
+for (S1, S2 : COMPLEX_SCALAR)
+  {
+    template void BlockVector<S1>::reinit<S2>(const BlockVector<S2>&,
+                                             const bool);
+  }

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.