From 73429c10825f60757fb898591f46e4787a8d6aa0 Mon Sep 17 00:00:00 2001 From: guido Date: Fri, 30 May 2003 18:40:46 +0000 Subject: [PATCH] driver file fixed and split in matrix and vector part git-svn-id: https://svn.dealii.org/trunk@7688 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/source/sparse_matrix.double.cc | 20 +++-- deal.II/lac/source/sparse_matrix.float.cc | 20 +++-- deal.II/lac/source/sparse_matrix.in.h | 65 ---------------- deal.II/lac/source/sparse_matrix_matrix.in.h | 26 +++++++ deal.II/lac/source/sparse_matrix_vector.in.h | 79 ++++++++++++++++++++ 5 files changed, 131 insertions(+), 79 deletions(-) delete mode 100644 deal.II/lac/source/sparse_matrix.in.h create mode 100644 deal.II/lac/source/sparse_matrix_matrix.in.h create mode 100644 deal.II/lac/source/sparse_matrix_vector.in.h diff --git a/deal.II/lac/source/sparse_matrix.double.cc b/deal.II/lac/source/sparse_matrix.double.cc index bec54b5bd0..67a3b2b192 100644 --- a/deal.II/lac/source/sparse_matrix.double.cc +++ b/deal.II/lac/source/sparse_matrix.double.cc @@ -1,4 +1,4 @@ -//---------------------------- sparse_matrix.double.cc --------------------------- +//--------------------------------------------------------------------------- // $Id$ // Version: $Name$ // @@ -9,7 +9,7 @@ // to the file deal.II/doc/license.html for the text and // further information on this license. // -//---------------------------- sparse_matrix.double.cc --------------------------- +//--------------------------------------------------------------------------- #include @@ -18,14 +18,21 @@ template class SparseMatrix; -#define TYPEVEC float +#define TYPE2 float +#include "sparse_matrix_matrix.in.h" +#undef TYPE2 -#include "sparse_matrix.in.h" +#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.in.h" +#define TYPEVEC double +#include "sparse_matrix_vector.in.h" +#undef TYPEVEC // a prerelease of gcc3.0 fails to // compile this due to long double @@ -34,5 +41,4 @@ template class SparseMatrix; // #include -#undef TYPEVEC #undef TYPEMAT diff --git a/deal.II/lac/source/sparse_matrix.float.cc b/deal.II/lac/source/sparse_matrix.float.cc index c5baea8a8e..7aae94aac1 100644 --- a/deal.II/lac/source/sparse_matrix.float.cc +++ b/deal.II/lac/source/sparse_matrix.float.cc @@ -1,4 +1,4 @@ -//---------------------------- sparse_matrix.float.cc --------------------------- +//--------------------------------------------------------------------------- // $Id$ // Version: $Name$ // @@ -9,7 +9,7 @@ // to the file deal.II/doc/license.html for the text and // further information on this license. // -//---------------------------- sparse_matrix.float.cc --------------------------- +//--------------------------------------------------------------------------- #include @@ -18,14 +18,21 @@ template class SparseMatrix; -#define TYPEVEC float +#define TYPE2 float +#include "sparse_matrix_matrix.in.h" +#undef TYPE2 -#include "sparse_matrix.in.h" +#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.in.h" +#define TYPEVEC double +#include "sparse_matrix_vector.in.h" +#undef TYPEVEC // a prerelease of gcc3.0 fails to // compile this due to long double @@ -34,5 +41,4 @@ template class SparseMatrix; // #include -#undef TYPEVEC #undef TYPEMAT diff --git a/deal.II/lac/source/sparse_matrix.in.h b/deal.II/lac/source/sparse_matrix.in.h deleted file mode 100644 index 4417d0d7dd..0000000000 --- a/deal.II/lac/source/sparse_matrix.in.h +++ /dev/null @@ -1,65 +0,0 @@ -//--------------------------------------------------------------------------- -// $Id$ -// Version: $Name$ -// -// Copyright (C) 2002, 2003 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. -// -//--------------------------------------------------------------------------- - - -// File copied from sparse_matrix.2.templates.h and modified - -// Driver file for SparseMatrixEZ functions with two types. - -// TYPEMAT and TYPE2 are defined in sparsematrix?.cc - -//template SparseMatrixEZ & -//SparseMatrixEZ::copy_from (const SparseMatrixEZ &); - -//template -//void SparseMatrixEZ::copy_from (const FullMatrix &); - -//template void SparseMatrixEZ::add_scaled (const TYPEMAT, -// const SparseMatrixEZ &); - -template void SparseMatrixEZ::vmult (Vector &, - const Vector &) const; -template void SparseMatrixEZ::Tvmult (Vector &, - const Vector &) const; -template void SparseMatrixEZ::vmult_add (Vector &, - const Vector &) const; -template void SparseMatrixEZ::Tvmult_add (Vector &, - const Vector &) const; - -//template TYPEVEC -//SparseMatrixEZ::matrix_norm_square (const Vector &) const; - -//template TYPEVEC -//SparseMatrixEZ::matrix_scalar_product (const Vector &, -// const Vector &) const; - -//template TYPEVEC SparseMatrixEZ::residual (Vector &, -// const Vector &, -// const Vector &) const; - -template void SparseMatrixEZ::precondition_SSOR (Vector &, - const Vector &, - const TYPEMAT) const; - -template void SparseMatrixEZ::precondition_SOR (Vector &, - const Vector &, - const TYPEMAT) const; - -template void SparseMatrixEZ::precondition_TSOR (Vector &, - const Vector &, - const TYPEMAT) const; - -template void SparseMatrixEZ::precondition_Jacobi (Vector &, - const Vector &, - const TYPEMAT) const; - diff --git a/deal.II/lac/source/sparse_matrix_matrix.in.h b/deal.II/lac/source/sparse_matrix_matrix.in.h new file mode 100644 index 0000000000..5bdab3604f --- /dev/null +++ b/deal.II/lac/source/sparse_matrix_matrix.in.h @@ -0,0 +1,26 @@ +//---------------------------- sparse_matrix.2.templates --------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 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 + +template SparseMatrix & +SparseMatrix::copy_from (const SparseMatrix &); + +template +void SparseMatrix::copy_from (const FullMatrix &); + +template void SparseMatrix::add_scaled (const TYPEMAT, + const SparseMatrix &); diff --git a/deal.II/lac/source/sparse_matrix_vector.in.h b/deal.II/lac/source/sparse_matrix_vector.in.h new file mode 100644 index 0000000000..4287bd6da9 --- /dev/null +++ b/deal.II/lac/source/sparse_matrix_vector.in.h @@ -0,0 +1,79 @@ +//---------------------------- sparse_matrix.2.templates --------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 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 TYPEVEC are defined in sparsematrix?.cc + +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 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; + -- 2.39.5