From 39133713266a1749a1f84465320e1c6d7244e3ae Mon Sep 17 00:00:00 2001 From: wolf Date: Mon, 8 May 2000 09:12:50 +0000 Subject: [PATCH] Take over fixes from the main branch. git-svn-id: https://svn.dealii.org/branches/Branch-3-0@2822 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/include/lac/full_matrix.h | 8 ++ .../lac/include/lac/full_matrix.templates.h | 77 +++++-------------- 2 files changed, 27 insertions(+), 58 deletions(-) diff --git a/deal.II/lac/include/lac/full_matrix.h b/deal.II/lac/include/lac/full_matrix.h index 0ef1df83e4..a27cb74dbb 100644 --- a/deal.II/lac/include/lac/full_matrix.h +++ b/deal.II/lac/include/lac/full_matrix.h @@ -232,6 +232,10 @@ class FullMatrix : public Subscriptor /** * Matrix-matrix-multiplication. * $C=A*B$. + * + * Assumes that #A# and #B# have + * compatible sizes and thet #C# + * already has the right size. */ template void mmult (FullMatrix &C, @@ -241,6 +245,10 @@ class FullMatrix : public Subscriptor * Matrix-matrix-multiplication using * transpose of #this#. * $C=A^T*B$. + * + * Assumes that #A# and #B# have + * compatible sizes and thet #C# + * already has the right size. */ template void Tmmult (FullMatrix &C, diff --git a/deal.II/lac/include/lac/full_matrix.templates.h b/deal.II/lac/include/lac/full_matrix.templates.h index d73fa76fe4..40e031886c 100644 --- a/deal.II/lac/include/lac/full_matrix.templates.h +++ b/deal.II/lac/include/lac/full_matrix.templates.h @@ -505,86 +505,47 @@ void FullMatrix::diagadd (const number src) template template -void FullMatrix::mmult (FullMatrix& dst, - const FullMatrix& src) const +void FullMatrix::mmult (FullMatrix &dst, + const FullMatrix &src) const { Assert (val != 0, ExcEmptyMatrix()); Assert (n() == src.m(), ExcDimensionMismatch(n(), src.m())); + Assert (dst.n() == src.n(), ExcDimensionMismatch(dst.n(), src.n())); + Assert (dst.m() == m(), ExcDimensionMismatch(m(), dst.m())); - unsigned int i,j,k; - number2 s = 1.; - dst.reinit(m(), src.n()); - - for (i=0;i::mmult (FullMatrix& dst, const FullMatrix& src) const -{ - Assert (val != 0, ExcEmptyMatrix()); - Assert (m() == src.n(), ExcDimensionMismatch(m(), src.n())); - - unsigned int i,j,k; - number2 s = 1.; - - dst.reinit(n(), src.m()); - - for (i=0;i template -void FullMatrix::Tmmult (FullMatrix& dst, const FullMatrix& src) const +void FullMatrix::Tmmult (FullMatrix &dst, + const FullMatrix &src) const { Assert (val != 0, ExcEmptyMatrix()); - Assert (n() == src.n(), ExcDimensionMismatch(n(), src.n())); - - unsigned int i,j,k; - number2 s = 1.; - dst.reinit(m(), src.m()); + Assert (m() == src.m(), ExcDimensionMismatch(m(), src.m())); + Assert (n() == dst.m(), ExcDimensionMismatch(n(), dst.m())); + Assert (src.n() == dst.n(), ExcDimensionMismatch(src.n(), dst.n())); - for (i=0;i::Tmmult(FullMatrix& dst, const FullMatrix& src) const -{ - Assert (val != 0, ExcEmptyMatrix()); - Assert (m() == src.n(), ExcDimensionMismatch(m(), src.n())); - - unsigned int i,j,k; - number2 s = 1.; - - dst.reinit(n(), src.m()); - - for (i=0;i template -- 2.39.5