From: bangerth Date: Sun, 9 Dec 2007 17:01:31 +0000 (+0000) Subject: Use the instantiations automatically generated from the .inst.in file X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4df2b674ac97ca86ac7f2a8f47b9c527989b817d;p=dealii-svn.git Use the instantiations automatically generated from the .inst.in file git-svn-id: https://svn.dealii.org/trunk@15573 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/source/full_matrix.cc b/deal.II/lac/source/full_matrix.cc new file mode 100644 index 0000000000..ace35c372a --- /dev/null +++ b/deal.II/lac/source/full_matrix.cc @@ -0,0 +1,51 @@ +//--------------------------------------------------------------------------- +// $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. +// +//--------------------------------------------------------------------------- + + +#include +#include + +DEAL_II_NAMESPACE_OPEN + +#include "full_matrix.inst" + + +// do a few functions that currently don't fit the scheme because they have +// two template arguments that need to be different (the case of same +// arguments is covered by the default copy constructor and copy operator that +// is declared separately) + +#define TEMPL_OP_EQ(S1,S2) \ + template FullMatrix& FullMatrix::operator = \ + (const FullMatrix&) + +TEMPL_OP_EQ(double,float); +TEMPL_OP_EQ(float,double); + +TEMPL_OP_EQ(long double,double); +TEMPL_OP_EQ(double,long double); + +TEMPL_OP_EQ(long double,float); +TEMPL_OP_EQ(float,long double); + + +TEMPL_OP_EQ(std::complex,std::complex); +TEMPL_OP_EQ(std::complex,std::complex); + +TEMPL_OP_EQ(std::complex,std::complex); +TEMPL_OP_EQ(std::complex,std::complex); + +TEMPL_OP_EQ(std::complex,std::complex); +TEMPL_OP_EQ(std::complex,std::complex); + +DEAL_II_NAMESPACE_CLOSE diff --git a/deal.II/lac/source/full_matrix.double.cc b/deal.II/lac/source/full_matrix.double.cc deleted file mode 100644 index 58bd9a7e84..0000000000 --- a/deal.II/lac/source/full_matrix.double.cc +++ /dev/null @@ -1,227 +0,0 @@ -//--------------------------------------------------------------------------- -// $Id$ -// 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. -// -//--------------------------------------------------------------------------- - - -#include -#include - -DEAL_II_NAMESPACE_OPEN - -#define TYPEMAT double - -template class FullMatrix; - -template void FullMatrix::print( - LogStream&, const unsigned int, const unsigned int) const; -template void FullMatrix::print( - std::ostream&, const unsigned int, const unsigned int) const; - -template FullMatrix& FullMatrix::operator =( - const FullMatrix&); - -#define TYPEMAT2 double - -template void FullMatrix::fill ( - const FullMatrix&, unsigned, unsigned, unsigned, unsigned); -template void FullMatrix::add (const TYPEMAT, const FullMatrix&); -template void FullMatrix::add (const TYPEMAT, const FullMatrix&, - const TYPEMAT, const FullMatrix&); -template void FullMatrix::add (const TYPEMAT, const FullMatrix&, - const TYPEMAT, const FullMatrix&, - const TYPEMAT, const FullMatrix&); -template void FullMatrix::add ( - const FullMatrix&, double, unsigned, unsigned, unsigned, unsigned); -template void FullMatrix::Tadd (const TYPEMAT, const FullMatrix&); -template void FullMatrix::Tadd ( - const FullMatrix&, double, unsigned, unsigned, unsigned, unsigned); -template void FullMatrix::equ (const TYPEMAT, const FullMatrix&); -template void FullMatrix::equ (const TYPEMAT, const FullMatrix&, - const TYPEMAT, const FullMatrix&); -template void FullMatrix::equ (const TYPEMAT, const FullMatrix&, - const TYPEMAT, const FullMatrix&, - const TYPEMAT, const FullMatrix&); -template void FullMatrix::mmult (FullMatrix&, const FullMatrix&, const bool) const; -template void FullMatrix::Tmmult (FullMatrix&, const FullMatrix&, const bool) const; -template void FullMatrix::add_diag (const TYPEMAT, const FullMatrix&); -template void FullMatrix::invert (const FullMatrix&); - -#define TYPEVEC double -#define TYPERES double - -template void FullMatrix::fill_permutation ( - const FullMatrix&, - const std::vector&, - const std::vector&); -template void FullMatrix::vmult( - Vector&, const Vector&, bool) const; -template void FullMatrix::Tvmult( - Vector&, const Vector&, bool) const; -template double FullMatrix::residual( - Vector&, const Vector&, const Vector&) const; -template TYPEVEC FullMatrix::matrix_norm_square ( - const Vector &) const; -template TYPEVEC FullMatrix::matrix_scalar_product( - const Vector&, const Vector&) const; -template void FullMatrix::forward( - Vector&, const Vector&) const; -template void FullMatrix::backward( - Vector&, const Vector&) const; - -template -void FullMatrix::precondition_Jacobi ( - Vector &, const Vector &, const TYPEMAT) const; - -#undef TYPEVEC -#define TYPEVEC float - -template void FullMatrix::fill_permutation ( - const FullMatrix&, - const std::vector&, - const std::vector&); -template void FullMatrix::vmult( - Vector&, const Vector&, bool) const; -template void FullMatrix::Tvmult( - Vector&, const Vector&, bool) const; -template double FullMatrix::residual( - Vector&, const Vector&, const Vector&) const; -template TYPEVEC FullMatrix::matrix_norm_square ( - const Vector &) const; -template TYPEVEC FullMatrix::matrix_scalar_product( - const Vector&, const Vector&) const; -template void FullMatrix::forward( - Vector&, const Vector&) const; -template void FullMatrix::backward( - Vector&, const Vector&) const; -template -void FullMatrix::precondition_Jacobi ( - Vector &, const Vector &, const TYPEMAT) const; - - -#undef TYPERES -#define TYPERES float - -template -double -FullMatrix::residual(Vector&, - const Vector&, - const Vector&) const; - - - -#undef TYPEMAT - -#define TYPEMAT std::complex - -template class FullMatrix; - -template void FullMatrix::print( - LogStream&, const unsigned int, const unsigned int) const; -template void FullMatrix::print( - std::ostream&, const unsigned int, const unsigned int) const; - -template FullMatrix& FullMatrix::operator =( - const FullMatrix >&); - -#undef TYPEMAT2 -#define TYPEMAT2 std::complex - -template void FullMatrix::fill ( - const FullMatrix&, unsigned, unsigned, unsigned, unsigned); -template void FullMatrix::add (const TYPEMAT, const FullMatrix&); -template void FullMatrix::add (const TYPEMAT, const FullMatrix&, - const TYPEMAT, const FullMatrix&); -template void FullMatrix::add (const TYPEMAT, const FullMatrix&, - const TYPEMAT, const FullMatrix&, - const TYPEMAT, const FullMatrix&); -template void FullMatrix::add ( - const FullMatrix&, std::complex, unsigned, unsigned, unsigned, unsigned); -template void FullMatrix::Tadd (const TYPEMAT, const FullMatrix&); -template void FullMatrix::Tadd ( - const FullMatrix&, std::complex, unsigned, unsigned, unsigned, unsigned); -template void FullMatrix::equ (const TYPEMAT, const FullMatrix&); -template void FullMatrix::equ (const TYPEMAT, const FullMatrix&, - const TYPEMAT, const FullMatrix&); -template void FullMatrix::equ (const TYPEMAT, const FullMatrix&, - const TYPEMAT, const FullMatrix&, - const TYPEMAT, const FullMatrix&); -template void FullMatrix::mmult (FullMatrix&, const FullMatrix&, const bool) const; -template void FullMatrix::Tmmult (FullMatrix&, const FullMatrix&, const bool) const; -template void FullMatrix::add_diag (const TYPEMAT, const FullMatrix&); -template void FullMatrix::invert (const FullMatrix&); - - -#undef TYPEVEC -#undef TYPERES -#define TYPEVEC std::complex -#define TYPERES std::complex - -template void FullMatrix::fill_permutation ( - const FullMatrix&, - const std::vector&, - const std::vector&); -template void FullMatrix::vmult( - Vector&, const Vector&, bool) const; -template void FullMatrix::Tvmult( - Vector&, const Vector&, bool) const; -template std::complex FullMatrix::residual( - Vector&, const Vector&, const Vector&) const; -template TYPEVEC FullMatrix::matrix_norm_square ( - const Vector &) const; -template TYPEVEC FullMatrix::matrix_scalar_product( - const Vector&, const Vector&) const; -template void FullMatrix::forward( - Vector&, const Vector&) const; -template void FullMatrix::backward( - Vector&, const Vector&) const; - -template -void FullMatrix::precondition_Jacobi ( - Vector &, const Vector &, const TYPEMAT) const; - -#undef TYPEVEC -#define TYPEVEC std::complex - -template void FullMatrix::fill_permutation ( - const FullMatrix&, - const std::vector&, - const std::vector&); -template void FullMatrix::vmult( - Vector&, const Vector&, bool) const; -template void FullMatrix::Tvmult( - Vector&, const Vector&, bool) const; -template std::complex FullMatrix::residual( - Vector&, const Vector&, const Vector&) const; -template TYPEVEC FullMatrix::matrix_norm_square ( - const Vector &) const; -template TYPEVEC FullMatrix::matrix_scalar_product( - const Vector&, const Vector&) const; -template void FullMatrix::forward( - Vector&, const Vector&) const; -template void FullMatrix::backward( - Vector&, const Vector&) const; -template -void FullMatrix::precondition_Jacobi ( - Vector &, const Vector &, const TYPEMAT) const; - - -#undef TYPERES -#define TYPERES std::complex - -template -std::complex -FullMatrix::residual(Vector&, - const Vector&, - const Vector&) const; - - -DEAL_II_NAMESPACE_CLOSE diff --git a/deal.II/lac/source/full_matrix.float.cc b/deal.II/lac/source/full_matrix.float.cc deleted file mode 100644 index 75b77eef07..0000000000 --- a/deal.II/lac/source/full_matrix.float.cc +++ /dev/null @@ -1,231 +0,0 @@ -//--------------------------------------------------------------------------- -// $Id$ -// 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. -// -//--------------------------------------------------------------------------- - - -#include -#include - -DEAL_II_NAMESPACE_OPEN - -#define TYPEMAT float - -template class FullMatrix; - -template void FullMatrix::print( - LogStream&, const unsigned int, const unsigned int) const; -template void FullMatrix::print( - std::ostream&, const unsigned int, const unsigned int) const; - -template FullMatrix& FullMatrix::operator =( - const FullMatrix&); - -#define TYPEMAT2 float - -//template FullMatrix& FullMatrix::operator =<>(const FullMatrix&); -template void FullMatrix::fill ( - const FullMatrix&, unsigned, unsigned, unsigned, unsigned); -template void FullMatrix::add (const TYPEMAT, const FullMatrix&); -template void FullMatrix::add (const TYPEMAT, const FullMatrix&, - const TYPEMAT, const FullMatrix&); -template void FullMatrix::add (const TYPEMAT, const FullMatrix&, - const TYPEMAT, const FullMatrix&, - const TYPEMAT, const FullMatrix&); -template void FullMatrix::add ( - const FullMatrix&, TYPEMAT, unsigned, unsigned, unsigned, unsigned); -template void FullMatrix::Tadd (const TYPEMAT, const FullMatrix&); -template void FullMatrix::Tadd ( - const FullMatrix&, TYPEMAT, unsigned, unsigned, unsigned, unsigned); -template void FullMatrix::equ (const TYPEMAT, const FullMatrix&); -template void FullMatrix::equ (const TYPEMAT, const FullMatrix&, - const TYPEMAT, const FullMatrix&); -template void FullMatrix::equ (const TYPEMAT, const FullMatrix&, - const TYPEMAT, const FullMatrix&, - const TYPEMAT, const FullMatrix&); -template void FullMatrix::mmult (FullMatrix&, const FullMatrix&, const bool) const; -template void FullMatrix::Tmmult (FullMatrix&, const FullMatrix&, const bool) const; -template void FullMatrix::add_diag (const TYPEMAT, const FullMatrix&); -template void FullMatrix::invert (const FullMatrix&); - -#define TYPEVEC double -#define TYPERES double - -template void FullMatrix::fill_permutation ( - const FullMatrix&, - const std::vector&, - const std::vector&); -template void FullMatrix::vmult( - Vector&, const Vector&, bool) const; -template void FullMatrix::Tvmult( - Vector&, const Vector&, bool) const; -template TYPEMAT FullMatrix::residual( - Vector&, const Vector&, const Vector&) const; -template TYPEVEC FullMatrix::matrix_norm_square ( - const Vector &) const; -template TYPEVEC FullMatrix::matrix_scalar_product( - const Vector&, const Vector&) const; -template void FullMatrix::forward( - Vector&, const Vector&) const; -template void FullMatrix::backward( - Vector&, const Vector&) const; - -template -void FullMatrix::precondition_Jacobi ( - Vector &, const Vector &, const TYPEMAT) const; - -#undef TYPEVEC -#define TYPEVEC float - -template void FullMatrix::fill_permutation ( - const FullMatrix&, - const std::vector&, - const std::vector&); -template void FullMatrix::vmult( - Vector&, const Vector&, bool) const; -template void FullMatrix::Tvmult( - Vector&, const Vector&, bool) const; -template TYPEMAT FullMatrix::residual( - Vector&, const Vector&, const Vector&) const; -template TYPEVEC FullMatrix::matrix_norm_square ( - const Vector &) const; -template TYPEVEC FullMatrix::matrix_scalar_product( - const Vector&, const Vector&) const; -template void FullMatrix::forward( - Vector&, const Vector&) const; -template void FullMatrix::backward( - Vector&, const Vector&) const; -template -void FullMatrix::precondition_Jacobi ( - Vector &, const Vector &, const TYPEMAT) const; - - -#undef TYPERES -#define TYPERES float - -template TYPEMAT FullMatrix::residual( - Vector&, const Vector&, const Vector&) const; - - - - - - - - - - - - - -#undef TYPEMAT -#undef TYPEMAT2 -#undef TYPEVEC -#undef TYPERES - -#define TYPEMAT std::complex - -template class FullMatrix; - -template void FullMatrix::print( - LogStream&, const unsigned int, const unsigned int) const; -template void FullMatrix::print( - std::ostream&, const unsigned int, const unsigned int) const; - -template FullMatrix& FullMatrix::operator =( - const FullMatrix >&); - -#define TYPEMAT2 std::complex - -//template FullMatrix& FullMatrix::operator =<>(const FullMatrix&); -template void FullMatrix::fill ( - const FullMatrix&, unsigned, unsigned, unsigned, unsigned); -template void FullMatrix::add (const TYPEMAT, const FullMatrix&); -template void FullMatrix::add (const TYPEMAT, const FullMatrix&, - const TYPEMAT, const FullMatrix&); -template void FullMatrix::add (const TYPEMAT, const FullMatrix&, - const TYPEMAT, const FullMatrix&, - const TYPEMAT, const FullMatrix&); -template void FullMatrix::add ( - const FullMatrix&, TYPEMAT, unsigned, unsigned, unsigned, unsigned); -template void FullMatrix::Tadd (const TYPEMAT, const FullMatrix&); -template void FullMatrix::Tadd ( - const FullMatrix&, TYPEMAT, unsigned, unsigned, unsigned, unsigned); -template void FullMatrix::equ (const TYPEMAT, const FullMatrix&); -template void FullMatrix::equ (const TYPEMAT, const FullMatrix&, - const TYPEMAT, const FullMatrix&); -template void FullMatrix::equ (const TYPEMAT, const FullMatrix&, - const TYPEMAT, const FullMatrix&, - const TYPEMAT, const FullMatrix&); -template void FullMatrix::mmult (FullMatrix&, const FullMatrix&, const bool) const; -template void FullMatrix::Tmmult (FullMatrix&, const FullMatrix&, const bool) const; -template void FullMatrix::add_diag (const TYPEMAT, const FullMatrix&); -template void FullMatrix::invert (const FullMatrix&); - -#define TYPEVEC std::complex -#define TYPERES std::complex - -template void FullMatrix::fill_permutation ( - const FullMatrix&, - const std::vector&, - const std::vector&); -template void FullMatrix::vmult( - Vector&, const Vector&, bool) const; -template void FullMatrix::Tvmult( - Vector&, const Vector&, bool) const; -template TYPEMAT FullMatrix::residual( - Vector&, const Vector&, const Vector&) const; -template TYPEVEC FullMatrix::matrix_norm_square ( - const Vector &) const; -template TYPEVEC FullMatrix::matrix_scalar_product( - const Vector&, const Vector&) const; -template void FullMatrix::forward( - Vector&, const Vector&) const; -template void FullMatrix::backward( - Vector&, const Vector&) const; - -template -void FullMatrix::precondition_Jacobi ( - Vector &, const Vector &, const TYPEMAT) const; - -#undef TYPEVEC -#define TYPEVEC std::complex - -template void FullMatrix::fill_permutation ( - const FullMatrix&, - const std::vector&, - const std::vector&); -template void FullMatrix::vmult( - Vector&, const Vector&, bool) const; -template void FullMatrix::Tvmult( - Vector&, const Vector&, bool) const; -template TYPEMAT FullMatrix::residual( - Vector&, const Vector&, const Vector&) const; -template TYPEVEC FullMatrix::matrix_norm_square ( - const Vector &) const; -template TYPEVEC FullMatrix::matrix_scalar_product( - const Vector&, const Vector&) const; -template void FullMatrix::forward( - Vector&, const Vector&) const; -template void FullMatrix::backward( - Vector&, const Vector&) const; -template -void FullMatrix::precondition_Jacobi ( - Vector &, const Vector &, const TYPEMAT) const; - - -#undef TYPERES -#define TYPERES std::complex - -template TYPEMAT FullMatrix::residual( - Vector&, const Vector&, const Vector&) const; - -DEAL_II_NAMESPACE_CLOSE diff --git a/deal.II/lac/source/sparse_matrix.cc b/deal.II/lac/source/sparse_matrix.cc new file mode 100644 index 0000000000..7fe30c2e9d --- /dev/null +++ b/deal.II/lac/source/sparse_matrix.cc @@ -0,0 +1,20 @@ +//--------------------------------------------------------------------------- +// $Id: sparse_matrix.double.cc 14038 2006-10-23 02:46:34Z 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. +// +//--------------------------------------------------------------------------- + + +#include +#include + +DEAL_II_NAMESPACE_OPEN +#include "sparse_matrix.inst" +DEAL_II_NAMESPACE_CLOSE diff --git a/deal.II/lac/source/sparse_matrix.double.cc b/deal.II/lac/source/sparse_matrix.double.cc deleted file mode 100644 index 59ff434c74..0000000000 --- a/deal.II/lac/source/sparse_matrix.double.cc +++ /dev/null @@ -1,148 +0,0 @@ -//--------------------------------------------------------------------------- -// $Id$ -// Version: $Name$ -// -// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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. -// -//--------------------------------------------------------------------------- - - -#include -#include - -#define TYPEMAT double - -DEAL_II_NAMESPACE_OPEN -template class SparseMatrix; -DEAL_II_NAMESPACE_CLOSE - -#define TYPE2 float -#include "sparse_matrix_matrix.in.h" -#undef TYPE2 - -#define TYPE2 double -#include "sparse_matrix_matrix.in.h" -#undef TYPE2 - -#define TYPEVEC float -#include "sparse_matrix_vector.in.h" -#undef TYPEVEC - -#define TYPEVEC double -#include "sparse_matrix_vector.in.h" -#undef TYPEVEC - - // a prerelease of gcc3.0 fails to - // compile this due to long double -// #undef TYPEVEC -// #define TYPEVEC long double - -// #include - -DEAL_II_NAMESPACE_OPEN - -#undef TYPEMAT - - -// instantiate a few more functions. this whole mess in this file (and the -// other sparse_matrix.* files) really needs to be cleaned up a little -template void SparseMatrix:: -vmult (Vector &, const Vector &) const; -template void SparseMatrix:: -Tvmult (Vector &, const Vector &) const; -template void SparseMatrix:: -vmult_add (Vector &, const Vector &) const; -template void SparseMatrix:: -Tvmult_add (Vector &, const Vector &) const; - -template void SparseMatrix:: -vmult (Vector &, const Vector &) const; -template void SparseMatrix:: -Tvmult (Vector &, const Vector &) const; -template void SparseMatrix:: -vmult_add (Vector &, const Vector &) const; -template void SparseMatrix:: -Tvmult_add (Vector &, const Vector &) const; - - -template void SparseMatrix:: -vmult (BlockVector &, const BlockVector &) const; -template void SparseMatrix:: -Tvmult (BlockVector &, const BlockVector &) const; -template void SparseMatrix:: -vmult_add (BlockVector &, const BlockVector &) const; -template void SparseMatrix:: -Tvmult_add (BlockVector &, const BlockVector &) const; - -template void SparseMatrix:: -vmult (BlockVector &, const BlockVector &) const; -template void SparseMatrix:: -Tvmult (BlockVector &, const BlockVector &) const; -template void SparseMatrix:: -vmult_add (BlockVector &, const BlockVector &) const; -template void SparseMatrix:: -Tvmult_add (BlockVector &, const BlockVector &) const; - - -template void SparseMatrix:: -vmult (Vector &, const BlockVector &) const; -template void SparseMatrix:: -Tvmult (Vector &, const BlockVector &) const; -template void SparseMatrix:: -vmult_add (Vector &, const BlockVector &) const; -template void SparseMatrix:: -Tvmult_add (Vector &, const BlockVector &) const; - -template void SparseMatrix:: -vmult (BlockVector &, const Vector &) const; -template void SparseMatrix:: -Tvmult (BlockVector &, const Vector &) const; -template void SparseMatrix:: -vmult_add (BlockVector &, const Vector &) const; -template void SparseMatrix:: -Tvmult_add (BlockVector &, const Vector &) const; - - -template void SparseMatrix:: -vmult (BlockVector &, const Vector &) const; -template void SparseMatrix:: -Tvmult (BlockVector &, const Vector &) const; -template void SparseMatrix:: -vmult_add (BlockVector &, const Vector &) const; -template void SparseMatrix:: -Tvmult_add (BlockVector &, const Vector &) const; - -template void SparseMatrix:: -vmult (Vector &, const BlockVector &) const; -template void SparseMatrix:: -Tvmult (Vector &, const BlockVector &) const; -template void SparseMatrix:: -vmult_add (Vector &, const BlockVector &) const; -template void SparseMatrix:: -Tvmult_add (Vector &, const BlockVector &) const; - - -template void SparseMatrix:: -vmult (Vector &, const BlockVector &) const; -template void SparseMatrix:: -Tvmult (Vector &, const BlockVector &) const; -template void SparseMatrix:: -vmult_add (Vector &, const BlockVector &) const; -template void SparseMatrix:: -Tvmult_add (Vector &, const BlockVector &) const; - -template void SparseMatrix:: -vmult (BlockVector &, const Vector &) const; -template void SparseMatrix:: -Tvmult (BlockVector &, const Vector &) const; -template void SparseMatrix:: -vmult_add (BlockVector &, const Vector &) const; -template void SparseMatrix:: -Tvmult_add (BlockVector &, const Vector &) const; - -DEAL_II_NAMESPACE_CLOSE diff --git a/deal.II/lac/source/sparse_matrix.float.cc b/deal.II/lac/source/sparse_matrix.float.cc deleted file mode 100644 index 03b48165ae..0000000000 --- a/deal.II/lac/source/sparse_matrix.float.cc +++ /dev/null @@ -1,148 +0,0 @@ -//--------------------------------------------------------------------------- -// $Id$ -// Version: $Name$ -// -// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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. -// -//--------------------------------------------------------------------------- - - -#include -#include - -#define TYPEMAT float - -DEAL_II_NAMESPACE_OPEN -template class SparseMatrix; -DEAL_II_NAMESPACE_CLOSE - -#define TYPE2 float -#include "sparse_matrix_matrix.in.h" -#undef TYPE2 - -#define TYPE2 double -#include "sparse_matrix_matrix.in.h" -#undef TYPE2 - -#define TYPEVEC float -#include "sparse_matrix_vector.in.h" -#undef TYPEVEC - -#define TYPEVEC double -#include "sparse_matrix_vector.in.h" -#undef TYPEVEC - - // a prerelease of gcc3.0 fails to - // compile this due to long double -// #undef TYPEVEC -// #define TYPEVEC long double - -// #include - -DEAL_II_NAMESPACE_OPEN - -#undef TYPEMAT - - -// instantiate a few more functions. this whole mess in this file (and the -// other sparse_matrix.* files) really needs to be cleaned up a little -template void SparseMatrix:: -vmult (Vector &, const Vector &) const; -template void SparseMatrix:: -Tvmult (Vector &, const Vector &) const; -template void SparseMatrix:: -vmult_add (Vector &, const Vector &) const; -template void SparseMatrix:: -Tvmult_add (Vector &, const Vector &) const; - -template void SparseMatrix:: -vmult (Vector &, const Vector &) const; -template void SparseMatrix:: -Tvmult (Vector &, const Vector &) const; -template void SparseMatrix:: -vmult_add (Vector &, const Vector &) const; -template void SparseMatrix:: -Tvmult_add (Vector &, const Vector &) const; - - -template void SparseMatrix:: -vmult (BlockVector &, const BlockVector &) const; -template void SparseMatrix:: -Tvmult (BlockVector &, const BlockVector &) const; -template void SparseMatrix:: -vmult_add (BlockVector &, const BlockVector &) const; -template void SparseMatrix:: -Tvmult_add (BlockVector &, const BlockVector &) const; - -template void SparseMatrix:: -vmult (BlockVector &, const BlockVector &) const; -template void SparseMatrix:: -Tvmult (BlockVector &, const BlockVector &) const; -template void SparseMatrix:: -vmult_add (BlockVector &, const BlockVector &) const; -template void SparseMatrix:: -Tvmult_add (BlockVector &, const BlockVector &) const; - - -template void SparseMatrix:: -vmult (Vector &, const BlockVector &) const; -template void SparseMatrix:: -Tvmult (Vector &, const BlockVector &) const; -template void SparseMatrix:: -vmult_add (Vector &, const BlockVector &) const; -template void SparseMatrix:: -Tvmult_add (Vector &, const BlockVector &) const; - -template void SparseMatrix:: -vmult (BlockVector &, const Vector &) const; -template void SparseMatrix:: -Tvmult (BlockVector &, const Vector &) const; -template void SparseMatrix:: -vmult_add (BlockVector &, const Vector &) const; -template void SparseMatrix:: -Tvmult_add (BlockVector &, const Vector &) const; - - -template void SparseMatrix:: -vmult (BlockVector &, const Vector &) const; -template void SparseMatrix:: -Tvmult (BlockVector &, const Vector &) const; -template void SparseMatrix:: -vmult_add (BlockVector &, const Vector &) const; -template void SparseMatrix:: -Tvmult_add (BlockVector &, const Vector &) const; - -template void SparseMatrix:: -vmult (Vector &, const BlockVector &) const; -template void SparseMatrix:: -Tvmult (Vector &, const BlockVector &) const; -template void SparseMatrix:: -vmult_add (Vector &, const BlockVector &) const; -template void SparseMatrix:: -Tvmult_add (Vector &, const BlockVector &) const; - - -template void SparseMatrix:: -vmult (Vector &, const BlockVector &) const; -template void SparseMatrix:: -Tvmult (Vector &, const BlockVector &) const; -template void SparseMatrix:: -vmult_add (Vector &, const BlockVector &) const; -template void SparseMatrix:: -Tvmult_add (Vector &, const BlockVector &) const; - -template void SparseMatrix:: -vmult (BlockVector &, const Vector &) const; -template void SparseMatrix:: -Tvmult (BlockVector &, const Vector &) const; -template void SparseMatrix:: -vmult_add (BlockVector &, const Vector &) const; -template void SparseMatrix:: -Tvmult_add (BlockVector &, const Vector &) const; - -DEAL_II_NAMESPACE_CLOSE diff --git a/deal.II/lac/source/sparse_matrix_matrix.in.h b/deal.II/lac/source/sparse_matrix_matrix.in.h deleted file mode 100644 index df8b2b21bf..0000000000 --- a/deal.II/lac/source/sparse_matrix_matrix.in.h +++ /dev/null @@ -1,30 +0,0 @@ -//---------------------------- sparse_matrix.2.templates --------------------------- -// $Id$ -// 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.2.templates --------------------------- - - -// Driver file for SparseMatrix functions with two types. - -// TYPEMAT and TYPE2 are defined in sparsematrix?.cc - -DEAL_II_NAMESPACE_OPEN - -template SparseMatrix & -SparseMatrix::copy_from (const SparseMatrix &); - -template -void SparseMatrix::copy_from (const FullMatrix &); - -template void SparseMatrix::add (const TYPEMAT, - const SparseMatrix &); - -DEAL_II_NAMESPACE_CLOSE diff --git a/deal.II/lac/source/sparse_matrix_vector.in.h b/deal.II/lac/source/sparse_matrix_vector.in.h deleted file mode 100644 index a10a204f66..0000000000 --- a/deal.II/lac/source/sparse_matrix_vector.in.h +++ /dev/null @@ -1,105 +0,0 @@ -//--------------------------------------------------------------------------- -// $Id$ -// Version: $Name$ -// -// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006 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. -// -//--------------------------------------------------------------------------- - - -// Driver file for SparseMatrix functions with two types. - -// TYPEMAT and TYPEVEC are defined in sparsematrix?.cc - -DEAL_II_NAMESPACE_OPEN - -template void SparseMatrix:: -vmult (Vector &, const Vector &) const; -template void SparseMatrix:: -Tvmult (Vector &, const Vector &) const; -template void SparseMatrix:: -vmult_add (Vector &, const Vector &) const; -template void SparseMatrix:: -Tvmult_add (Vector &, const Vector &) const; - -template void SparseMatrix:: -vmult (BlockVector &, const BlockVector &) const; -template void SparseMatrix:: -Tvmult (BlockVector &, const BlockVector &) const; -template void SparseMatrix:: -vmult_add (BlockVector &, const BlockVector &) const; -template void SparseMatrix:: -Tvmult_add (BlockVector &, const BlockVector &) const; - -template TYPEVEC -SparseMatrix:: -matrix_norm_square (const Vector &) const; - -template TYPEVEC -SparseMatrix:: -matrix_scalar_product (const Vector &, - const Vector &) const; - -template TYPEVEC SparseMatrix:: -residual (Vector &, - const Vector &, - const Vector &) const; - -template void SparseMatrix:: -precondition_SSOR (Vector &, - const Vector &, - const TYPEMAT) const; - -template void SparseMatrix:: -precondition_SOR (Vector &, - const Vector &, - const TYPEMAT) const; - -template void SparseMatrix:: -precondition_TSOR (Vector &, - const Vector &, - const TYPEMAT) const; - -template void SparseMatrix:: -precondition_Jacobi (Vector &, - const Vector &, - const TYPEMAT) const; - -template void SparseMatrix:: -SOR (Vector &, - const TYPEMAT) const; -template void SparseMatrix:: -TSOR (Vector &, - const TYPEMAT) const; -template void SparseMatrix:: -SSOR (Vector &, - const TYPEMAT) const; -template void SparseMatrix:: -PSOR (Vector &, - const std::vector&, - const std::vector&, - const TYPEMAT) const; -template void SparseMatrix:: -TPSOR (Vector &, - const std::vector&, - const std::vector&, - const TYPEMAT) const; -template void SparseMatrix:: -SOR_step (Vector &, - const Vector &, - const TYPEMAT) const; -template void SparseMatrix:: -TSOR_step (Vector &, - const Vector &, - const TYPEMAT) const; -template void SparseMatrix:: -SSOR_step (Vector &, - const Vector &, - const TYPEMAT) const; - -DEAL_II_NAMESPACE_CLOSE diff --git a/deal.II/lac/source/vector.cc b/deal.II/lac/source/vector.cc index b25a361fe1..c025d257bc 100644 --- a/deal.II/lac/source/vector.cc +++ b/deal.II/lac/source/vector.cc @@ -16,80 +16,62 @@ DEAL_II_NAMESPACE_OPEN -// explicit instantiations -template class Vector; +#include "vector.inst" + +// do a few functions that currently don't fit the scheme because they have +// two template arguments that need to be different (the case of same +// arguments is covered by the default copy constructor and copy operator that +// is declared separately) + +#define TEMPL_COPY_CONSTRUCTOR(S1,S2) \ + template Vector::Vector (const Vector &) #ifndef DEAL_II_EXPLICIT_CONSTRUCTOR_BUG -template Vector::Vector (const Vector &); -#endif +TEMPL_COPY_CONSTRUCTOR(double,float); +TEMPL_COPY_CONSTRUCTOR(float,double); -template Vector& Vector::DEAL_II_MEMBER_OP_TEMPLATE_INST operator=(const Vector&); -template bool Vector::DEAL_II_MEMBER_OP_TEMPLATE_INST operator==(const Vector&) const; -template bool Vector::DEAL_II_MEMBER_OP_TEMPLATE_INST operator==(const Vector&) const; -template double Vector::DEAL_II_MEMBER_OP_TEMPLATE_INST operator*(const Vector&) const; -template double Vector::DEAL_II_MEMBER_OP_TEMPLATE_INST operator*(const Vector&) const; -template void Vector::reinit(const Vector&, const bool); -template void Vector::reinit(const Vector&, const bool); -template void Vector::equ(const double, const Vector&); -template void Vector::equ(const double, const Vector&); -template void Vector::scale(const Vector&); -template void Vector::scale(const Vector&); +TEMPL_COPY_CONSTRUCTOR(long double,double); +TEMPL_COPY_CONSTRUCTOR(double,long double); -template class Vector; +TEMPL_COPY_CONSTRUCTOR(long double,float); +TEMPL_COPY_CONSTRUCTOR(float,long double); -#ifndef DEAL_II_EXPLICIT_CONSTRUCTOR_BUG -template Vector::Vector (const Vector &); + +TEMPL_COPY_CONSTRUCTOR(std::complex,std::complex); +TEMPL_COPY_CONSTRUCTOR(std::complex,std::complex); + +TEMPL_COPY_CONSTRUCTOR(std::complex,std::complex); +TEMPL_COPY_CONSTRUCTOR(std::complex,std::complex); + +TEMPL_COPY_CONSTRUCTOR(std::complex,std::complex); +TEMPL_COPY_CONSTRUCTOR(std::complex,std::complex); #endif -template Vector& Vector::DEAL_II_MEMBER_OP_TEMPLATE_INST operator=(const Vector&); -template bool Vector::DEAL_II_MEMBER_OP_TEMPLATE_INST operator==(const Vector&) const; -template bool Vector::DEAL_II_MEMBER_OP_TEMPLATE_INST operator==(const Vector&) const; -template float Vector::DEAL_II_MEMBER_OP_TEMPLATE_INST operator*(const Vector&) const; -template float Vector::DEAL_II_MEMBER_OP_TEMPLATE_INST operator*(const Vector&) const; -template void Vector::reinit(const Vector&, const bool); -template void Vector::reinit(const Vector&, const bool); -template void Vector::equ(const float, const Vector&); -template void Vector::equ(const float, const Vector&); -template void Vector::scale(const Vector&); -template void Vector::scale(const Vector&); +#define TEMPL_OP_EQ(S1,S2) \ + template \ + Vector& \ + Vector::DEAL_II_MEMBER_OP_TEMPLATE_INST \ + operator=(const Vector&) +TEMPL_OP_EQ(double,float); +TEMPL_OP_EQ(float,double); -// complex data types -template class Vector >; +TEMPL_OP_EQ(long double,double); +TEMPL_OP_EQ(double,long double); -#ifndef DEAL_II_EXPLICIT_CONSTRUCTOR_BUG -template Vector >::Vector (const Vector > &); -#endif +TEMPL_OP_EQ(long double,float); +TEMPL_OP_EQ(float,long double); -template Vector >& Vector >::DEAL_II_MEMBER_OP_TEMPLATE_INST operator= >(const Vector >&); -template bool Vector >::DEAL_II_MEMBER_OP_TEMPLATE_INST operator== >(const Vector >&) const; -template bool Vector >::DEAL_II_MEMBER_OP_TEMPLATE_INST operator== >(const Vector >&) const; -template std::complex Vector >::DEAL_II_MEMBER_OP_TEMPLATE_INST operator* >(const Vector >&) const; -template std::complex Vector >::DEAL_II_MEMBER_OP_TEMPLATE_INST operator* >(const Vector >&) const; -template void Vector >::reinit >(const Vector >&, const bool); -template void Vector >::reinit >(const Vector >&, const bool); -template void Vector >::equ >(const std::complex, const Vector >&); -template void Vector >::equ >(const std::complex, const Vector >&); -template void Vector >::scale >(const Vector >&); -template void Vector >::scale >(const Vector >&); -template class Vector >; +TEMPL_OP_EQ(std::complex,std::complex); +TEMPL_OP_EQ(std::complex,std::complex); -#ifndef DEAL_II_EXPLICIT_CONSTRUCTOR_BUG -template Vector >::Vector (const Vector > &); -#endif +TEMPL_OP_EQ(std::complex,std::complex); +TEMPL_OP_EQ(std::complex,std::complex); + +TEMPL_OP_EQ(std::complex,std::complex); +TEMPL_OP_EQ(std::complex,std::complex); -template Vector >& Vector >::DEAL_II_MEMBER_OP_TEMPLATE_INST operator= >(const Vector >&); -template bool Vector >::DEAL_II_MEMBER_OP_TEMPLATE_INST operator== >(const Vector >&) const; -template bool Vector >::DEAL_II_MEMBER_OP_TEMPLATE_INST operator== >(const Vector >&) const; -template std::complex Vector >::DEAL_II_MEMBER_OP_TEMPLATE_INST operator* >(const Vector >&) const; -template std::complex Vector >::DEAL_II_MEMBER_OP_TEMPLATE_INST operator* >(const Vector >&) const; -template void Vector >::reinit >(const Vector >&, const bool); -template void Vector >::reinit >(const Vector >&, const bool); -template void Vector >::equ >(const std::complex, const Vector >&); -template void Vector >::equ >(const std::complex, const Vector >&); -template void Vector >::scale >(const Vector >&); -template void Vector >::scale >(const Vector >&); DEAL_II_NAMESPACE_CLOSE diff --git a/deal.II/lac/source/vector.long_double.cc b/deal.II/lac/source/vector.long_double.cc deleted file mode 100644 index 33577c3844..0000000000 --- a/deal.II/lac/source/vector.long_double.cc +++ /dev/null @@ -1,86 +0,0 @@ -//--------------------------------------------------------------------------- -// $Id$ -// 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. -// -//--------------------------------------------------------------------------- - - -#include - -DEAL_II_NAMESPACE_OPEN - -// explicit instantiations for long double -template class Vector; - -#if !defined(DEAL_II_EXPLICIT_CONSTRUCTOR_BUG) && !defined(DEAL_II_LONG_DOUBLE_LOOP_BUG) -template Vector::Vector (const Vector &); -template Vector::Vector (const Vector &); - -template Vector::Vector (const Vector &); -template Vector::Vector (const Vector &); -#endif - -template Vector& Vector::DEAL_II_MEMBER_OP_TEMPLATE_INST operator=(const Vector&); -template Vector& Vector::DEAL_II_MEMBER_OP_TEMPLATE_INST operator=(const Vector&); -template long double Vector::DEAL_II_MEMBER_OP_TEMPLATE_INST operator * (const Vector &) const; -template long double Vector::DEAL_II_MEMBER_OP_TEMPLATE_INST operator * (const Vector &) const; -template long double Vector::DEAL_II_MEMBER_OP_TEMPLATE_INST operator * (const Vector &) const; -template void Vector::reinit(const Vector&, const bool); -template void Vector::reinit(const Vector&, const bool); -template void Vector::reinit(const Vector&, const bool); -template void Vector::equ(const long double, const Vector&); -template void Vector::equ(const long double, const Vector&); -template void Vector::equ(const long double, const Vector&); - -template Vector& Vector::DEAL_II_MEMBER_OP_TEMPLATE_INST operator=(const Vector&); -template double Vector::DEAL_II_MEMBER_OP_TEMPLATE_INST operator * (const Vector &) const; -template void Vector::reinit(const Vector&, const bool); -template void Vector::equ(const double, const Vector&); - -template Vector& Vector::DEAL_II_MEMBER_OP_TEMPLATE_INST operator=(const Vector&); -template float Vector::DEAL_II_MEMBER_OP_TEMPLATE_INST operator * (const Vector &) const; -template void Vector::reinit(const Vector&, const bool); -template void Vector::equ(const float, const Vector&); - - -// explicit instantiations for std::complex -template class Vector >; - -#if !defined(DEAL_II_EXPLICIT_CONSTRUCTOR_BUG) && !defined(DEAL_II_LONG_DOUBLE_LOOP_BUG) -template Vector >::Vector (const Vector > &); -template Vector >::Vector (const Vector > &); - -template Vector >::Vector (const Vector > &); -template Vector >::Vector (const Vector > &); -#endif - -template Vector >& Vector >::DEAL_II_MEMBER_OP_TEMPLATE_INST operator= >(const Vector >&); -template Vector >& Vector >::DEAL_II_MEMBER_OP_TEMPLATE_INST operator= >(const Vector >&); -template std::complex Vector >::DEAL_II_MEMBER_OP_TEMPLATE_INST operator * > (const Vector > &) const; -template std::complex Vector >::DEAL_II_MEMBER_OP_TEMPLATE_INST operator * > (const Vector > &) const; -template std::complex Vector >::DEAL_II_MEMBER_OP_TEMPLATE_INST operator * > (const Vector > &) const; -template void Vector >::reinit >(const Vector >&, const bool); -template void Vector >::reinit >(const Vector >&, const bool); -template void Vector >::reinit >(const Vector >&, const bool); -template void Vector >::equ >(const std::complex, const Vector >&); -template void Vector >::equ >(const std::complex, const Vector >&); -template void Vector >::equ >(const std::complex, const Vector >&); - -template Vector >& Vector >::DEAL_II_MEMBER_OP_TEMPLATE_INST operator= >(const Vector >&); -template std::complex Vector >::DEAL_II_MEMBER_OP_TEMPLATE_INST operator * > (const Vector > &) const; -template void Vector >::reinit >(const Vector >&, const bool); -template void Vector >::equ >(const std::complex, const Vector >&); - -template Vector >& Vector >::DEAL_II_MEMBER_OP_TEMPLATE_INST operator= >(const Vector >&); -template std::complex Vector >::DEAL_II_MEMBER_OP_TEMPLATE_INST operator * > (const Vector > &) const; -template void Vector >::reinit >(const Vector >&, const bool); -template void Vector >::equ >(const std::complex, const Vector >&); - -DEAL_II_NAMESPACE_CLOSE