]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Provide the infrastructure to generate some of the template instantiations in this...
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Sun, 9 Dec 2007 16:58:11 +0000 (16:58 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Sun, 9 Dec 2007 16:58:11 +0000 (16:58 +0000)
git-svn-id: https://svn.dealii.org/trunk@15572 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/common/template-arguments [new file with mode: 0644]
deal.II/lac/Makefile
deal.II/lac/source/full_matrix.inst.in [new file with mode: 0644]
deal.II/lac/source/sparse_matrix.inst.in [new file with mode: 0644]
deal.II/lac/source/vector.inst.in [new file with mode: 0644]

diff --git a/deal.II/common/template-arguments b/deal.II/common/template-arguments
new file mode 100644 (file)
index 0000000..88e7b4b
--- /dev/null
@@ -0,0 +1,6 @@
+REAL_SCALARS    := { double; float; long double }
+COMPLEX_SCALARS := { std::complex<double>; 
+                     std::complex<float>;
+                     std::complex<long double> }
+
+DEAL_II_VEC_TEMPLATES := { Vector; BlockVector }
index c548e3bf82d74ba771a3f7cd126f92d27712589a..3b7189f5ba5d0e090af9dcb612b22e556d8a7f09 100644 (file)
@@ -40,6 +40,10 @@ $(LIBDIR)/lac/%.$(OBJEXT) :
        @echo "=====lac==============optimized==$(MT)== $(<F)"
        @$(CXX) $(CXXFLAGS.o) -c $< -o $@
 
+source/%.inst :
+       @echo "=====lac============================= $(@F)"
+       @$D/common/scripts/expand_instantiations $D/common/template-arguments < $< > $@
+
 
 # rules
 lib: $(LIBDIR)/liblac.g$(lib-suffix) $(LIBDIR)/liblac$(lib-suffix)
@@ -116,11 +120,17 @@ clean:
 # of this file.
 #
 # If the command fails, then remove Makefile.dep again and fail
-Makefile.dep: $(cc-files) $(h-files) Makefile $D/common/Make.global_options
+Makefile.dep: $(cc-files) $(h-files) \
+               $(shell echo source/*.inst.in) \
+               Makefile $D/common/Make.global_options
        @echo ============================ Remaking lac/Makefile
        @$D/common/scripts/make_dependencies $(INCLUDE) "-B$(LIBDIR)/lac" $(cc-files) \
                > $@ \
         || (rm -f $@ ; false)
+       @for i in source/*inst.in ; do \
+               echo "$${i}.x : $${i}" | \
+               $(PERL) -pi -e 's/\.inst\.in\.x/.inst/g;' ; \
+        done >> $@
 
 
 # include all the dependencies
diff --git a/deal.II/lac/source/full_matrix.inst.in b/deal.II/lac/source/full_matrix.inst.in
new file mode 100644 (file)
index 0000000..e1e0e89
--- /dev/null
@@ -0,0 +1,191 @@
+//---------------------------------------------------------------------------
+//    $Id: full_matrix.double.cc 15518 2007-11-18 22:31:00Z bangerth $
+//    Version: $Name$
+//
+//    Copyright (C) 1999, 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_SCALARS)
+  {
+    template class FullMatrix<S>;
+
+    template void FullMatrix<S>::print(
+      LogStream&, const unsigned int, const unsigned int) const;
+    template void FullMatrix<S>::print(
+      std::ostream&, const unsigned int, const unsigned int) const;
+  }
+
+for (S1, S2 : REAL_SCALARS)
+  {
+    template
+      void FullMatrix<S1>::fill<S2> (
+       const FullMatrix<S2>&, unsigned, unsigned, unsigned, unsigned);
+    template
+      void FullMatrix<S1>::add<S2> (const S1, const FullMatrix<S2>&);
+    template
+      void FullMatrix<S1>::add<S2> (const S1, const FullMatrix<S2>&,
+                                   const S1, const FullMatrix<S2>&);
+    template
+      void FullMatrix<S1>::add<S2> (const S1, const FullMatrix<S2>&,
+                                   const S1, const FullMatrix<S2>&,
+                                   const S1, const FullMatrix<S2>&);
+    template
+      void FullMatrix<S1>::add<S2> (
+       const FullMatrix<S2>&, S1, unsigned, unsigned,unsigned, unsigned);
+    template
+      void FullMatrix<S1>::Tadd<S2> (const S1, const FullMatrix<S2>&);
+    template
+      void FullMatrix<S1>::Tadd<S2> (
+       const FullMatrix<S2>&, S1, unsigned, unsigned, unsigned, unsigned);
+    template
+      void FullMatrix<S1>::equ<S2> (const S1, const FullMatrix<S2>&);
+    template
+      void FullMatrix<S1>::equ<S2> (const S1, const FullMatrix<S2>&,
+                                   const S1, const FullMatrix<S2>&);
+    template
+      void FullMatrix<S1>::equ<S2> (const S1, const FullMatrix<S2>&,
+                                   const S1, const FullMatrix<S2>&,
+                                   const S1, const FullMatrix<S2>&);
+    template
+      void FullMatrix<S1>::mmult<S2> (FullMatrix<S2>&, const FullMatrix<S2>&, const bool) const;
+    template
+      void FullMatrix<S1>::Tmmult<S2> (FullMatrix<S2>&, const FullMatrix<S2>&, const bool) const;
+    template
+      void FullMatrix<S1>::invert<S2> (const FullMatrix<S2>&);
+
+    template
+      void FullMatrix<S1>::fill_permutation<S2> (
+       const FullMatrix<S2>&,
+       const std::vector<unsigned int>&,
+       const std::vector<unsigned int>&);
+    template
+      void FullMatrix<S1>::vmult<S2>(
+      Vector<S2>&, const Vector<S2>&, bool) const;
+    template
+      void FullMatrix<S1>::Tvmult<S2>(
+      Vector<S2>&, const Vector<S2>&, bool) const;
+    template
+      S2 FullMatrix<S1>::matrix_norm_square<S2> (
+      const Vector<S2> &) const;
+    template
+      S2 FullMatrix<S1>::matrix_scalar_product<S2>(
+      const Vector<S2>&, const Vector<S2>&) const;
+    template
+      void FullMatrix<S1>::forward<S2>(
+      Vector<S2>&, const Vector<S2>&) const;
+    template
+      void FullMatrix<S1>::backward<S2>(
+      Vector<S2>&, const Vector<S2>&) const;
+
+    template
+      void FullMatrix<S1>::precondition_Jacobi<S2> (
+       Vector<S2> &, const Vector<S2> &, const S1) const;
+  }
+
+for (S1, S2, S3 : REAL_SCALARS)
+  {
+    template
+      S1
+      FullMatrix<S1>::residual<S2,S3>(Vector<S2>&,
+                                     const Vector<S2>&,
+                                     const Vector<S3>&) const;
+  }
+
+
+
+
+
+// same for complex scalars
+
+for (S : COMPLEX_SCALARS)
+  {
+    template class FullMatrix<S>;
+
+    template void FullMatrix<S>::print(
+      LogStream&, const unsigned int, const unsigned int) const;
+    template void FullMatrix<S>::print(
+      std::ostream&, const unsigned int, const unsigned int) const;
+  }
+
+for (S1, S2 : COMPLEX_SCALARS)
+  {
+    template
+      void FullMatrix<S1>::fill<S2> (
+       const FullMatrix<S2>&, unsigned, unsigned, unsigned, unsigned);
+    template
+      void FullMatrix<S1>::add<S2> (const S1, const FullMatrix<S2>&);
+    template
+      void FullMatrix<S1>::add<S2> (const S1, const FullMatrix<S2>&,
+                                   const S1, const FullMatrix<S2>&);
+    template
+      void FullMatrix<S1>::add<S2> (const S1, const FullMatrix<S2>&,
+                                   const S1, const FullMatrix<S2>&,
+                                   const S1, const FullMatrix<S2>&);
+    template
+      void FullMatrix<S1>::add<S2> (
+       const FullMatrix<S2>&, S1, unsigned, unsigned,unsigned, unsigned);
+    template
+      void FullMatrix<S1>::Tadd<S2> (const S1, const FullMatrix<S2>&);
+    template
+      void FullMatrix<S1>::Tadd<S2> (
+       const FullMatrix<S2>&, S1, unsigned, unsigned, unsigned, unsigned);
+    template
+      void FullMatrix<S1>::equ<S2> (const S1, const FullMatrix<S2>&);
+    template
+      void FullMatrix<S1>::equ<S2> (const S1, const FullMatrix<S2>&,
+                                   const S1, const FullMatrix<S2>&);
+    template
+      void FullMatrix<S1>::equ<S2> (const S1, const FullMatrix<S2>&,
+                                   const S1, const FullMatrix<S2>&,
+                                   const S1, const FullMatrix<S2>&);
+    template
+      void FullMatrix<S1>::mmult<S2> (FullMatrix<S2>&, const FullMatrix<S2>&, const bool) const;
+    template
+      void FullMatrix<S1>::Tmmult<S2> (FullMatrix<S2>&, const FullMatrix<S2>&, const bool) const;
+    template
+      void FullMatrix<S1>::invert<S2> (const FullMatrix<S2>&);
+
+    template
+      void FullMatrix<S1>::fill_permutation<S2> (
+       const FullMatrix<S2>&,
+       const std::vector<unsigned int>&,
+       const std::vector<unsigned int>&);
+    template
+      void FullMatrix<S1>::vmult<S2>(
+      Vector<S2>&, const Vector<S2>&, bool) const;
+    template
+      void FullMatrix<S1>::Tvmult<S2>(
+      Vector<S2>&, const Vector<S2>&, bool) const;
+    template
+      S2 FullMatrix<S1>::matrix_norm_square<S2> (
+      const Vector<S2> &) const;
+    template
+      S2 FullMatrix<S1>::matrix_scalar_product<S2>(
+      const Vector<S2>&, const Vector<S2>&) const;
+    template
+      void FullMatrix<S1>::forward<S2>(
+      Vector<S2>&, const Vector<S2>&) const;
+    template
+      void FullMatrix<S1>::backward<S2>(
+      Vector<S2>&, const Vector<S2>&) const;
+
+    template
+      void FullMatrix<S1>::precondition_Jacobi<S2> (
+       Vector<S2> &, const Vector<S2> &, const S1) const;
+  }
+
+for (S1, S2, S3 : COMPLEX_SCALARS)
+  {
+    template
+      S1
+      FullMatrix<S1>::residual<S2,S3>(Vector<S2>&,
+                                     const Vector<S2>&,
+                                     const Vector<S3>&) const;
+  }
diff --git a/deal.II/lac/source/sparse_matrix.inst.in b/deal.II/lac/source/sparse_matrix.inst.in
new file mode 100644 (file)
index 0000000..bf128b0
--- /dev/null
@@ -0,0 +1,116 @@
+//----------------------------  sparse_matrix.inst.in  ---------------------------
+//    $Id: sparse_matrix_matrix.in.h 15011 2007-08-22 16:59:41Z kanschat $
+//    Version: $Name$
+//
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 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.
+//
+//----------------------------  sparse_matrix.inst.in  ---------------------------
+
+
+for (S : REAL_SCALARS)
+  {
+    template class SparseMatrix<S>;
+  }
+
+
+
+for (S1, S2 : REAL_SCALARS)
+  {
+    template SparseMatrix<S1> &
+      SparseMatrix<S1>::copy_from<S2> (const SparseMatrix<S2> &);
+
+    template 
+      void SparseMatrix<S1>::copy_from<S2> (const FullMatrix<S2> &);
+
+    template void SparseMatrix<S1>::add<S2> (const S1,
+                                            const SparseMatrix<S2> &);
+  }
+
+
+for (S1, S2 : SCALARS)
+  {
+    template S2
+      SparseMatrix<S1>::
+      matrix_norm_square<S2> (const Vector<S2> &) const;
+
+    template S2
+      SparseMatrix<S1>::
+      matrix_scalar_product<S2> (const Vector<S2> &,
+                                const Vector<S2> &) const;
+
+    template S2 SparseMatrix<S1>::
+      residual<S2> (Vector<S2> &,
+                   const Vector<S2> &,
+                   const Vector<S2> &) const;
+
+    template void SparseMatrix<S1>::
+      precondition_SSOR<S2> (Vector<S2> &,
+                            const Vector<S2> &,
+                            const S1) const;
+
+    template void SparseMatrix<S1>::
+      precondition_SOR<S2> (Vector<S2> &,
+                           const Vector<S2> &,
+                           const S1) const;
+
+    template void SparseMatrix<S1>::
+      precondition_TSOR<S2> (Vector<S2> &,
+                            const Vector<S2> &,
+                            const S1) const;
+
+    template void SparseMatrix<S1>::
+      precondition_Jacobi<S2> (Vector<S2> &,
+                              const Vector<S2> &,
+                              const S1) const;
+
+    template void SparseMatrix<S1>::
+      SOR<S2> (Vector<S2> &,
+              const S1) const;
+    template void SparseMatrix<S1>::
+      TSOR<S2> (Vector<S2> &,
+               const S1) const;
+    template void SparseMatrix<S1>::
+      SSOR<S2> (Vector<S2> &,
+               const S1) const;
+    template void SparseMatrix<S1>::
+      PSOR<S2> (Vector<S2> &,
+               const std::vector<unsigned int>&,
+               const std::vector<unsigned int>&,
+               const S1) const;
+    template void SparseMatrix<S1>::
+      TPSOR<S2> (Vector<S2> &,
+                const std::vector<unsigned int>&,
+                const std::vector<unsigned int>&,
+                const S1) const;
+    template void SparseMatrix<S1>::
+      SOR_step<S2> (Vector<S2> &,
+                   const Vector<S2> &,
+                   const S1) const;
+    template void SparseMatrix<S1>::
+      TSOR_step<S2> (Vector<S2> &,
+                    const Vector<S2> &,
+                    const S1) const;
+    template void SparseMatrix<S1>::
+      SSOR_step<S2> (Vector<S2> &,
+                    const Vector<S2> &, 
+                    const S1) const;
+  }
+
+
+for (S1, S2, S3 : SCALARS;
+     V1, V2     : DEAL_II_VEC_TEMPLATES)
+  {
+    template void SparseMatrix<S1>::
+      vmult (V1<S2> &, const V2<S3> &) const;
+    template void SparseMatrix<S1>::
+      Tvmult (V1<S2> &, const V2<S3> &) const;
+    template void SparseMatrix<S1>::
+      vmult_add (V1<S2> &, const V2<S3> &) const;
+    template void SparseMatrix<S1>::
+      Tvmult_add (V1<S2> &, const V2<S3> &) const;
+  }
diff --git a/deal.II/lac/source/vector.inst.in b/deal.II/lac/source/vector.inst.in
new file mode 100644 (file)
index 0000000..096d3a7
--- /dev/null
@@ -0,0 +1,61 @@
+//---------------------------------------------------------------------------
+//    $Id: vector.cc 15443 2007-11-05 03:43:52Z bangerth $
+//    Version: $Name$
+//
+//    Copyright (C) 1999, 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 (SCALAR : REAL_SCALARS)
+  {
+    template class Vector<SCALAR>;
+  }
+
+for (S1, S2 : REAL_SCALARS)
+  {
+    template
+      bool
+      Vector<S1>::DEAL_II_MEMBER_OP_TEMPLATE_INST
+      operator==<S2>(const Vector<S2>&) const;
+    template
+      S1
+      Vector<S1>::DEAL_II_MEMBER_OP_TEMPLATE_INST
+      operator*<S2>(const Vector<S2>&) const;
+    template
+      void Vector<S1>::reinit<S2>(const Vector<S2>&, const bool);
+    template
+      void Vector<S1>::equ<S2>(const S1, const Vector<S2>&);
+    template
+      void Vector<S1>::scale<S2>(const Vector<S2>&);
+  }
+
+
+
+for (SCALAR : COMPLEX_SCALARS)
+  {
+    template class Vector<SCALAR>;
+  }
+
+for (S1, S2 : COMPLEX_SCALARS)
+  {
+    template
+      bool
+      Vector<S1>::DEAL_II_MEMBER_OP_TEMPLATE_INST
+      operator==<S2>(const Vector<S2>&) const;
+    template
+      S1
+      Vector<S1>::DEAL_II_MEMBER_OP_TEMPLATE_INST
+      operator*<S2>(const Vector<S2>&) const;
+    template
+      void Vector<S1>::reinit<S2>(const Vector<S2>&, const bool);
+    template
+      void Vector<S1>::equ<S2>(const S1, const Vector<S2>&);
+    template
+      void Vector<S1>::scale<S2>(const Vector<S2>&);
+  }

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.