From 0d538424776cdc3bdf4c2e67eecdaabae1a50a0b Mon Sep 17 00:00:00 2001 From: Guido Kanschat Date: Tue, 12 Feb 2002 11:04:55 +0000 Subject: [PATCH] invert and assignment from matrices with different entry type git-svn-id: https://svn.dealii.org/trunk@5507 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/include/lac/full_matrix.h | 13 ++++++++++- .../lac/include/lac/full_matrix.templates.h | 22 ++++++++++++++++++- deal.II/lac/source/full_matrix.double.cc | 1 + deal.II/lac/source/full_matrix.float.cc | 2 +- 4 files changed, 35 insertions(+), 3 deletions(-) diff --git a/deal.II/lac/include/lac/full_matrix.h b/deal.II/lac/include/lac/full_matrix.h index 6bc4bc72e7..5c841f3b70 100644 --- a/deal.II/lac/include/lac/full_matrix.h +++ b/deal.II/lac/include/lac/full_matrix.h @@ -118,6 +118,16 @@ class FullMatrix : public vector2d const unsigned int cols, const number* entries); + /** + * Assignment operator. + */ + FullMatrix& operator = (const FullMatrix&); + + /** + * Variable assignment operator. + */ + template + FullMatrix& operator = (const FullMatrix&); /** * Comparison operator. Be @@ -448,7 +458,8 @@ class FullMatrix : public vector2d * @ref{gauss_jordan} is invoked * implicitly. */ - void invert (const FullMatrix &M); + template + void invert (const FullMatrix &M); /** * Apply the Jacobi diff --git a/deal.II/lac/include/lac/full_matrix.templates.h b/deal.II/lac/include/lac/full_matrix.templates.h index d044fc6a10..bba5d9850c 100644 --- a/deal.II/lac/include/lac/full_matrix.templates.h +++ b/deal.II/lac/include/lac/full_matrix.templates.h @@ -52,6 +52,25 @@ FullMatrix::FullMatrix (const FullMatrix &m) : {} +template +FullMatrix& +FullMatrix::operator = (const FullMatrix& M) +{ + vector2d::operator=(M); + return *this; +} + + +template +template +FullMatrix& +FullMatrix::operator = (const FullMatrix& M) +{ + vector2d::operator=(M); + return *this; +} + + template bool FullMatrix::all_zero () const @@ -1126,8 +1145,9 @@ FullMatrix::relative_symmetry_norm2 () const template +template void -FullMatrix::invert (const FullMatrix &M) +FullMatrix::invert (const FullMatrix &M) { Assert (data() != 0, ExcEmptyMatrix()); diff --git a/deal.II/lac/source/full_matrix.double.cc b/deal.II/lac/source/full_matrix.double.cc index 1e6e01348f..940b5a5f3a 100644 --- a/deal.II/lac/source/full_matrix.double.cc +++ b/deal.II/lac/source/full_matrix.double.cc @@ -28,6 +28,7 @@ template void FullMatrix::Tadd (const TYPEMAT, const 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 diff --git a/deal.II/lac/source/full_matrix.float.cc b/deal.II/lac/source/full_matrix.float.cc index c050ecf331..b8a2128031 100644 --- a/deal.II/lac/source/full_matrix.float.cc +++ b/deal.II/lac/source/full_matrix.float.cc @@ -27,7 +27,7 @@ template void FullMatrix::Tadd (const TYPEMAT, const 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 -- 2.39.5