From: hartmann Date: Wed, 14 Apr 1999 13:14:32 +0000 (+0000) Subject: add a nontemplatized assignement operator to convince the compiler not to generate... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=34fff89062bb72c09bf747cd71672574a1309c89;p=dealii-svn.git add a nontemplatized assignement operator to convince the compiler not to generate a predefined copy operator git-svn-id: https://svn.dealii.org/trunk@1140 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/full_matrix.h b/deal.II/lac/include/lac/full_matrix.h index 9d2f480c14..7e3fc0ea23 100644 --- a/deal.II/lac/include/lac/full_matrix.h +++ b/deal.II/lac/include/lac/full_matrix.h @@ -143,8 +143,22 @@ class FullMatrix /** * Assignment operator. * Copy all elements of #src# - into the matrix. The size is - adjusted if needed. + * into the matrix. The size is + * adjusted if needed. + * + * We can't use the other, templatized + * version since if we don't declare + * this one, the compiler will happily + * generate a predefined copy + * operator which is not what we want. + */ + FullMatrix& operator = (const FullMatrix& src); + + /** + * Assignment operator. + * Copy all elements of #src# + * into the matrix. The size is + * adjusted if needed. */ template FullMatrix& operator = (const FullMatrix& src); diff --git a/deal.II/lac/include/lac/full_matrix.templates.h b/deal.II/lac/include/lac/full_matrix.templates.h index e90f277b78..df5b23e574 100644 --- a/deal.II/lac/include/lac/full_matrix.templates.h +++ b/deal.II/lac/include/lac/full_matrix.templates.h @@ -458,6 +458,24 @@ void FullMatrix::backward (Vector& dst, const Vector& +template +FullMatrix& +FullMatrix::operator = (const FullMatrix& m) +{ + reinit(m); + + number * p = &val[0]; + const number * vp = &m.val[0]; + const number * const e = &val[dim_image*dim_range]; + + while (p!=e) + *p++ = *vp++; + + return *this; +} + + + template template FullMatrix&