--- /dev/null
+//----------------------------------------------------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2007 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.
+//
+//----------------------------------------------------------------------
+
+// Test properties of FilteredMatrix and iterators
+
+#include "../tests.h"
+#include <base/logstream.h>
+#include <lac/filtered_matrix.h>
+#include <lac/matrix_lib.h>
+#include <lac/precondition.h>
+#include <lac/vector.h>
+
+#include <fstream>
+
+
+template<class VECTOR>
+void test (const FilteredMatrix<VECTOR>& M)
+{
+ deallog << "Iterator";
+
+ unsigned int max = 0;
+ for (typename FilteredMatrix<VECTOR>::const_iterator i= M.begin();
+ i != M.end();++i)
+ {
+ Assert(i->row() == i->column(), ExcInternalError());
+ deallog << ' ' << i->row() << ':' << i->value();
+ max = i->row();
+ }
+ VECTOR v(max+1);
+ VECTOR w(max+1);
+
+ for (unsigned int i=0;i<v.size();++i)
+ v(i) = 31+i;
+
+ deallog << std::endl << "vmult ";
+
+ w = 0.;
+ M.vmult(w,v);
+ for (unsigned int i=0;i<v.size();++i)
+ deallog << ' ' << w(i);
+
+ deallog << std::endl << "Tvmult";
+
+ w = 0.;
+ M.Tvmult(w,v);
+ for (unsigned int i=0;i<v.size();++i)
+ deallog << ' ' << w(i);
+
+ deallog << std::endl << "vmult_add";
+
+ M.vmult_add(w,v);
+ for (unsigned int i=0;i<v.size();++i)
+ deallog << ' ' << w(i);
+
+ deallog << std::endl << "boundary";
+
+ M.apply_constraints(w, true);
+ for (unsigned int i=0;i<v.size();++i)
+ deallog << ' ' << w(i);
+
+ deallog << std::endl << "boundary";
+
+ M.apply_constraints(w, false);
+ for (unsigned int i=0;i<v.size();++i)
+ deallog << ' ' << w(i);
+
+ deallog << std::endl;
+}
+
+
+
+int main()
+{
+ std::ofstream logfile("filtered_matrix/output");
+ deallog.attach(logfile);
+ deallog.depth_console(10);
+
+ PreconditionIdentity identity;
+ ScaledMatrix<Vector<double> > s(identity, 3.);
+
+ FilteredMatrix<Vector<double> > f;
+ f.initialize(s, false);
+ test(f);
+
+ for (unsigned int i=0;i<5;++i)
+ f.add_constraint(i*i,i/2.);
+ test(f);
+
+ f.initialize(s, true);
+ test(f);
+
+}
--- /dev/null
+
+DEAL::Iterator
+DEAL::vmult 93.0000
+DEAL::Tvmult 93.0000
+DEAL::vmult_add 186.000
+DEAL::boundary 186.000
+DEAL::boundary 186.000
+DEAL::Iterator 0:0 1:0.500000 4:1.00000 9:1.50000 16:2.00000
+DEAL::vmult 31.0000 32.0000 99.0000 102.000 35.0000 108.000 111.000 114.000 117.000 40.0000 123.000 126.000 129.000 132.000 135.000 138.000 47.0000
+DEAL::Tvmult 31.0000 32.0000 99.0000 102.000 35.0000 108.000 111.000 114.000 117.000 40.0000 123.000 126.000 129.000 132.000 135.000 138.000 47.0000
+DEAL::vmult_add 31.0000 32.0000 198.000 204.000 35.0000 216.000 222.000 228.000 234.000 40.0000 246.000 252.000 258.000 264.000 270.000 276.000 47.0000
+DEAL::boundary 0 0.500000 198.000 204.000 1.00000 216.000 222.000 228.000 234.000 1.50000 246.000 252.000 258.000 264.000 270.000 276.000 2.00000
+DEAL::boundary 0 0.500000 198.000 204.000 1.00000 216.000 222.000 228.000 234.000 1.50000 246.000 252.000 258.000 264.000 270.000 276.000 2.00000
+DEAL::Iterator 0:0 1:0.500000 4:1.00000 9:1.50000 16:2.00000
+DEAL::vmult 31.0000 32.0000 99.0000 102.000 35.0000 108.000 111.000 114.000 117.000 40.0000 123.000 126.000 129.000 132.000 135.000 138.000 47.0000
+DEAL::Tvmult 31.0000 32.0000 99.0000 102.000 35.0000 108.000 111.000 114.000 117.000 40.0000 123.000 126.000 129.000 132.000 135.000 138.000 47.0000
+DEAL::vmult_add 31.0000 32.0000 198.000 204.000 35.0000 216.000 222.000 228.000 234.000 40.0000 246.000 252.000 258.000 264.000 270.000 276.000 47.0000
+DEAL::boundary 0 0.500000 198.000 204.000 1.00000 216.000 222.000 228.000 234.000 1.50000 246.000 252.000 258.000 264.000 270.000 276.000 2.00000
+DEAL::boundary 0 0.500000 198.000 204.000 1.00000 216.000 222.000 228.000 234.000 1.50000 246.000 252.000 258.000 264.000 270.000 276.000 2.00000