]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
add a nontemplatized assignement operator to convince the compiler not to generate...
authorhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 14 Apr 1999 13:14:32 +0000 (13:14 +0000)
committerhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 14 Apr 1999 13:14:32 +0000 (13:14 +0000)
git-svn-id: https://svn.dealii.org/trunk@1140 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/full_matrix.h
deal.II/lac/include/lac/full_matrix.templates.h

index 9d2f480c14bb3e3f7a418d273dbc08bbd9087c5f..7e3fc0ea23545596312672e235e1ad5bb60f78eb 100644 (file)
@@ -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<number>& operator = (const FullMatrix<number>& src);
+
+                                    /**
+                                     * Assignment operator.
+                                     * Copy all elements of #src#
+                                     * into the matrix. The size is
+                                     * adjusted if needed.
                                      */
     template<typename number2>
     FullMatrix<number>& operator = (const FullMatrix<number2>& src);
index e90f277b78b30d7a26d24c66c080108b3d3fb176..df5b23e574c63d6ec6c663af76238a6fbd1c2f28 100644 (file)
@@ -458,6 +458,24 @@ void FullMatrix<number>::backward (Vector<number2>& dst, const Vector<number2>&
 
 
 
+template <typename number>
+FullMatrix<number>&
+FullMatrix<number>::operator = (const FullMatrix<number>& 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 <typename number>
 template <typename number2>
 FullMatrix<number>&

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.