<h3>Specific improvements</h3>
<ol>
+<li> New: The copy constructor of FullMatrix from IdentityMatrix
+used to be explicit, but that didn't appear to be necessary in hindsight.
+Consequently, it is now a regular copy constructor.
+<br>
+(Wolfgang Bangerth, 2012/08/14)
+
<li> New: The Patterns::Map pattern allows to describe maps from keys
to values in input files.
<br>
* FullMatrix<double> M(IdentityMatrix(n));
* @endverbatim
*/
- explicit FullMatrix (const IdentityMatrix &id);
+ FullMatrix (const IdentityMatrix &id);
/**
* @}
*/
const unsigned int src_offset_j = 0);
/**
- * Adda single element at the
+ * Add a single element at the
* given position.
*/
- void add(const unsigned int row, const unsigned int column, const number value);
+ void add (const unsigned int row,
+ const unsigned int column,
+ const number value);
/**
* Add an array of values given by
--- /dev/null
+//---------------------------------------------------------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2005, 2006, 2012 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.
+//
+//---------------------------------------------------------------------------
+
+// check assignment from IdentityMatrix to FullMatrix using the syntax
+// FullMatrix<number> M = IdentityMatrix(4);
+// this didn't work initially because the copy constructor in FullMatrix
+// was explicit; however, in hindsight, I can't see a good reason for
+// it to be explicit.
+
+
+#include "../tests.h"
+#include <deal.II/base/logstream.h>
+#include <deal.II/lac/identity_matrix.h>
+#include <deal.II/lac/full_matrix.h>
+#include <deal.II/lac/vector.h>
+
+#include <fstream>
+#include <iomanip>
+#include <cmath>
+
+template<typename number>
+void
+check_vmult()
+{
+ FullMatrix<number> M = IdentityMatrix(4);
+ Vector<number> u(4);
+ Vector<number> v(4);
+
+ for (unsigned int i=0;i<4;++i)
+ u(i) = i+1;
+
+ M.vmult(v,u);
+ Assert (v == u, ExcInternalError());
+ for (unsigned int i=0;i<v.size();++i)
+ deallog << ' ' << v(i);
+ deallog << std::endl;
+
+ M.vmult_add(v,u);
+ v /= 2;
+ Assert (v == u, ExcInternalError());
+ for (unsigned int i=0;i<v.size();++i)
+ deallog << ' ' << v(i);
+ deallog << std::endl;
+
+ M.Tvmult(v,u);
+ Assert (v == u, ExcInternalError());
+ for (unsigned int i=0;i<v.size();++i)
+ deallog << ' ' << v(i);
+ deallog << std::endl;
+
+ M.Tvmult_add(v,u);
+ v /= 2;
+ Assert (v == u, ExcInternalError());
+ for (unsigned int i=0;i<v.size();++i)
+ deallog << ' ' << v(i);
+ deallog << std::endl;
+}
+
+
+int main()
+{
+ std::ofstream logfile("identity_matrix_06/output");
+ logfile.setf(std::ios::fixed);
+ deallog << std::setprecision(0);
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ check_vmult<double>();
+ check_vmult<float>();
+}