From fb6cd924f4d502aa643fd73be2075a3f1db47615 Mon Sep 17 00:00:00 2001
From: "dakshina.ilangova"
 <dakshina.ilangova@0785d39b-7218-0410-832d-ea1e28bc413d>
Date: Sat, 5 Apr 2014 19:31:21 +0000
Subject: [PATCH] Added tests for lac/PointerMatrix

git-svn-id: https://svn.dealii.org/trunk@32719 0785d39b-7218-0410-832d-ea1e28bc413d
---
 tests/lac/pointer_matrix_01.cc     |  46 ++++++++++++
 tests/lac/pointer_matrix_01.output |   3 +
 tests/lac/pointer_matrix_02.cc     |  52 +++++++++++++
 tests/lac/pointer_matrix_02.output |   3 +
 tests/lac/pointer_matrix_03.cc     |  49 +++++++++++++
 tests/lac/pointer_matrix_03.output |   3 +
 tests/lac/pointer_matrix_04.cc     |  54 ++++++++++++++
 tests/lac/pointer_matrix_04.output |   3 +
 tests/lac/pointer_matrix_05.cc     |  74 +++++++++++++++++++
 tests/lac/pointer_matrix_05.output |   5 ++
 tests/lac/pointer_matrix_06.cc     |  74 +++++++++++++++++++
 tests/lac/pointer_matrix_06.output |   5 ++
 tests/lac/pointer_matrix_07.cc     |  83 +++++++++++++++++++++
 tests/lac/pointer_matrix_07.output |   6 ++
 tests/lac/pointer_matrix_08.cc     |  83 +++++++++++++++++++++
 tests/lac/pointer_matrix_08.output |   6 ++
 tests/lac/pointer_matrix_09.cc     |  81 +++++++++++++++++++++
 tests/lac/pointer_matrix_09.output |   9 +++
 tests/lac/pointer_matrix_10.cc     | 113 +++++++++++++++++++++++++++++
 tests/lac/pointer_matrix_10.output |  14 ++++
 20 files changed, 766 insertions(+)
 create mode 100644 tests/lac/pointer_matrix_01.cc
 create mode 100644 tests/lac/pointer_matrix_01.output
 create mode 100644 tests/lac/pointer_matrix_02.cc
 create mode 100644 tests/lac/pointer_matrix_02.output
 create mode 100644 tests/lac/pointer_matrix_03.cc
 create mode 100644 tests/lac/pointer_matrix_03.output
 create mode 100644 tests/lac/pointer_matrix_04.cc
 create mode 100644 tests/lac/pointer_matrix_04.output
 create mode 100644 tests/lac/pointer_matrix_05.cc
 create mode 100644 tests/lac/pointer_matrix_05.output
 create mode 100644 tests/lac/pointer_matrix_06.cc
 create mode 100644 tests/lac/pointer_matrix_06.output
 create mode 100644 tests/lac/pointer_matrix_07.cc
 create mode 100644 tests/lac/pointer_matrix_07.output
 create mode 100644 tests/lac/pointer_matrix_08.cc
 create mode 100644 tests/lac/pointer_matrix_08.output
 create mode 100644 tests/lac/pointer_matrix_09.cc
 create mode 100644 tests/lac/pointer_matrix_09.output
 create mode 100644 tests/lac/pointer_matrix_10.cc
 create mode 100644 tests/lac/pointer_matrix_10.output

diff --git a/tests/lac/pointer_matrix_01.cc b/tests/lac/pointer_matrix_01.cc
new file mode 100644
index 0000000000..dc4a1bb6b2
--- /dev/null
+++ b/tests/lac/pointer_matrix_01.cc
@@ -0,0 +1,46 @@
+// ---------------------------------------------------------------------
+// $Id: pointer_matrix_01.cc 2014-03-14 dilangov $
+//
+// Copyright (C) 2006 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+// check PointerMatrix:checkConstructor1
+
+#include "../tests.h"
+#include <deal.II/base/logstream.h>
+#include <deal.II/lac/pointer_matrix.h>
+#include <deal.II/lac/full_matrix.h>
+#include <deal.II/lac/vector.h>
+
+template<typename number>
+  void
+  checkConstructor1()
+  {
+    deallog << "Init with empty matrix" << std::endl;
+    PointerMatrix<FullMatrix<number>, Vector<number> > P;
+    deallog << "Is matrix empty:" << P.empty() << std::endl;
+  }
+
+int
+main()
+{
+
+  std::ofstream logfile("output");
+  deallog << std::fixed;
+  deallog << std::setprecision(4);
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+  checkConstructor1<double>();
+}
diff --git a/tests/lac/pointer_matrix_01.output b/tests/lac/pointer_matrix_01.output
new file mode 100644
index 0000000000..29ff7b71c0
--- /dev/null
+++ b/tests/lac/pointer_matrix_01.output
@@ -0,0 +1,3 @@
+
+DEAL::Init with empty matrix
+DEAL::Is matrix empty:1
diff --git a/tests/lac/pointer_matrix_02.cc b/tests/lac/pointer_matrix_02.cc
new file mode 100644
index 0000000000..2fd9975f9c
--- /dev/null
+++ b/tests/lac/pointer_matrix_02.cc
@@ -0,0 +1,52 @@
+// ---------------------------------------------------------------------
+// $Id: pointer_matrix_01.cc 2014-03-14 dilangov $
+//
+// Copyright (C) 2006 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+// check PointerMatrix:checkConstructor2
+
+#include "../tests.h"
+#include <deal.II/base/logstream.h>
+#include <deal.II/lac/pointer_matrix.h>
+#include <deal.II/lac/full_matrix.h>
+#include <deal.II/lac/vector.h>
+
+template<typename number>
+  void
+  checkConstructor2(FullMatrix<number> &A)
+  {
+    deallog << "Init with matrix A" << std::endl;
+    PointerMatrix<FullMatrix<number>, Vector<number> > P(&A);
+    deallog << "Is matrix empty:" << P.empty() << std::endl;
+  }
+
+int
+main()
+{
+
+  std::ofstream logfile("output");
+  deallog << std::fixed;
+  deallog << std::setprecision(4);
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+  const double Adata[] =
+    { 2, 3, 4, 5 };
+
+  FullMatrix<double> A(2, 2);
+  A.fill(Adata);
+
+  checkConstructor2<double>(A);
+}
diff --git a/tests/lac/pointer_matrix_02.output b/tests/lac/pointer_matrix_02.output
new file mode 100644
index 0000000000..4b02719a99
--- /dev/null
+++ b/tests/lac/pointer_matrix_02.output
@@ -0,0 +1,3 @@
+
+DEAL::Init with matrix A
+DEAL::Is matrix empty:0
diff --git a/tests/lac/pointer_matrix_03.cc b/tests/lac/pointer_matrix_03.cc
new file mode 100644
index 0000000000..0d66472ac6
--- /dev/null
+++ b/tests/lac/pointer_matrix_03.cc
@@ -0,0 +1,49 @@
+// ---------------------------------------------------------------------
+// $Id: pointer_matrix_01.cc 2014-03-14 dilangov $
+//
+// Copyright (C) 2006 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+// check PointerMatrix:checkConstructor3
+
+#include "../tests.h"
+#include <deal.II/base/logstream.h>
+#include <deal.II/lac/pointer_matrix.h>
+#include <deal.II/lac/full_matrix.h>
+#include <deal.II/lac/vector.h>
+
+template<typename number>
+  void
+  checkConstructor3(char *name)
+  {
+    deallog << "Init with matrix name" << std::endl;
+    PointerMatrix<FullMatrix<number>, Vector<number> > P(name);
+    deallog << "Is matrix empty:" << P.empty() << std::endl;
+  }
+
+int
+main()
+{
+
+  std::ofstream logfile("output");
+  deallog << std::fixed;
+  deallog << std::setprecision(4);
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+  char *name = "Matrix A";
+
+  checkConstructor3<double>(name);
+
+}
diff --git a/tests/lac/pointer_matrix_03.output b/tests/lac/pointer_matrix_03.output
new file mode 100644
index 0000000000..b90ebcb206
--- /dev/null
+++ b/tests/lac/pointer_matrix_03.output
@@ -0,0 +1,3 @@
+
+DEAL::Init with matrix name
+DEAL::Is matrix empty:1
diff --git a/tests/lac/pointer_matrix_04.cc b/tests/lac/pointer_matrix_04.cc
new file mode 100644
index 0000000000..2e8a5aff75
--- /dev/null
+++ b/tests/lac/pointer_matrix_04.cc
@@ -0,0 +1,54 @@
+// ---------------------------------------------------------------------
+// $Id: pointer_matrix_01.cc 2014-03-14 dilangov $
+//
+// Copyright (C) 2006 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+// check PointerMatrix:checkConstructor4
+
+#include "../tests.h"
+#include <deal.II/base/logstream.h>
+#include <deal.II/lac/pointer_matrix.h>
+#include <deal.II/lac/full_matrix.h>
+#include <deal.II/lac/vector.h>
+
+template<typename number>
+  void
+  checkConstructor4(const FullMatrix<number> &A, char *name)
+  {
+    deallog << "Init with matrix name and matrix" << std::endl;
+    PointerMatrix<FullMatrix<number>, Vector<number> > P(&A, name);
+    deallog << "Is matrix empty:" << P.empty() << std::endl;
+  }
+
+int
+main()
+{
+
+  std::ofstream logfile("output");
+  deallog << std::fixed;
+  deallog << std::setprecision(4);
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+  const double Adata[] =
+    { 2, 3, 4, 5 };
+
+  FullMatrix<double> A(2, 2);
+  A.fill(Adata);
+
+  char *name = "Matrix A";
+
+  checkConstructor4<double>(A, name);
+}
diff --git a/tests/lac/pointer_matrix_04.output b/tests/lac/pointer_matrix_04.output
new file mode 100644
index 0000000000..eebc2cc092
--- /dev/null
+++ b/tests/lac/pointer_matrix_04.output
@@ -0,0 +1,3 @@
+
+DEAL::Init with matrix name and matrix
+DEAL::Is matrix empty:0
diff --git a/tests/lac/pointer_matrix_05.cc b/tests/lac/pointer_matrix_05.cc
new file mode 100644
index 0000000000..32f667e444
--- /dev/null
+++ b/tests/lac/pointer_matrix_05.cc
@@ -0,0 +1,74 @@
+// ---------------------------------------------------------------------
+// $Id: pointer_matrix_01.cc 2014-03-14 dilangov $
+//
+// Copyright (C) 2006 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+// check PointerMatrix:checkVmult
+
+#include "../tests.h"
+#include <deal.II/base/logstream.h>
+#include <deal.II/lac/pointer_matrix.h>
+#include <deal.II/lac/full_matrix.h>
+#include <deal.II/lac/vector.h>
+
+template<typename number>
+  void
+  checkVmult(FullMatrix<number> &A, Vector<number> &V, char *name =
+      "Test Matrix")
+  {
+    deallog << "vmult" << std::endl;
+
+    PointerMatrix<FullMatrix<number>, Vector<number> > P(&A, name);
+    Vector<number> O(A.m());
+    P.vmult(O, V);
+
+    // Check the dimensions of the result matrix
+    Assert(A.m() == O.size(), ExcInternalError());
+    deallog << "Dimensions of result vector verified" << std::endl;
+
+    // Verifying results with Method 2: O=A*V	
+    Vector<number> O_(A.m());
+    A.vmult(O_, V);
+
+    Assert(O == O_, ExcInternalError());
+    deallog << "Result vector data verified" << std::endl;
+
+    for (unsigned int i = 0; i < O.size(); ++i)
+      deallog << O(i) << '\t';
+    deallog << std::endl;
+  }
+
+int
+main()
+{
+
+  std::ofstream logfile("output");
+  deallog << std::fixed;
+  deallog << std::setprecision(4);
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+  const double Adata[] =
+    { 2, 3, 4, 5 };
+
+  FullMatrix<double> A(2, 2);
+  A.fill(Adata);
+
+  Vector<double> V(2);
+  V(0) = 1;
+  V(1) = 2;
+
+  checkVmult<double>(A, V);
+}
diff --git a/tests/lac/pointer_matrix_05.output b/tests/lac/pointer_matrix_05.output
new file mode 100644
index 0000000000..a867192b6d
--- /dev/null
+++ b/tests/lac/pointer_matrix_05.output
@@ -0,0 +1,5 @@
+
+DEAL::vmult
+DEAL::Dimensions of result vector verified
+DEAL::Result vector data verified
+DEAL::8.0000	14.0000	
diff --git a/tests/lac/pointer_matrix_06.cc b/tests/lac/pointer_matrix_06.cc
new file mode 100644
index 0000000000..af35fd9e60
--- /dev/null
+++ b/tests/lac/pointer_matrix_06.cc
@@ -0,0 +1,74 @@
+// ---------------------------------------------------------------------
+// $Id: pointer_matrix_01.cc 2014-03-14 dilangov $
+//
+// Copyright (C) 2006 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+// check PointerMatrix:checkTvmult
+
+#include "../tests.h"
+#include <deal.II/base/logstream.h>
+#include <deal.II/lac/pointer_matrix.h>
+#include <deal.II/lac/full_matrix.h>
+#include <deal.II/lac/vector.h>
+
+template<typename number>
+  void
+  checkTvmult(FullMatrix<number> &A, Vector<number> &V, char *name =
+      "Test Matrix")
+  {
+    deallog << "Tvmult" << std::endl;
+
+    PointerMatrix<FullMatrix<number>, Vector<number> > P(&A, name);
+    Vector<number> O(A.m());
+    P.Tvmult(O, V);
+
+    // Check the dimensions of the result matrix
+    Assert(A.m() == O.size(), ExcInternalError());
+    deallog << "Dimensions of result vector verified" << std::endl;
+
+    // Verifying results with Method 2: O=A Transpose*V	
+    Vector<number> O_(A.m());
+    A.Tvmult(O_, V);
+
+    Assert(O == O_, ExcInternalError());
+    deallog << "Result vector data verified" << std::endl;
+
+    for (unsigned int i = 0; i < O.size(); ++i)
+      deallog << O(i) << '\t';
+    deallog << std::endl;
+  }
+
+int
+main()
+{
+
+  std::ofstream logfile("output");
+  deallog << std::fixed;
+  deallog << std::setprecision(4);
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+  const double Adata[] =
+    { 2, 3, 4, 5 };
+
+  FullMatrix<double> A(2, 2);
+  A.fill(Adata);
+
+  Vector<double> V(2);
+  V(0) = 1;
+  V(1) = 2;
+
+  checkTvmult<double>(A, V);
+}
diff --git a/tests/lac/pointer_matrix_06.output b/tests/lac/pointer_matrix_06.output
new file mode 100644
index 0000000000..510a561c65
--- /dev/null
+++ b/tests/lac/pointer_matrix_06.output
@@ -0,0 +1,5 @@
+
+DEAL::Tvmult
+DEAL::Dimensions of result vector verified
+DEAL::Result vector data verified
+DEAL::10.0000	13.0000	
diff --git a/tests/lac/pointer_matrix_07.cc b/tests/lac/pointer_matrix_07.cc
new file mode 100644
index 0000000000..98d8174e43
--- /dev/null
+++ b/tests/lac/pointer_matrix_07.cc
@@ -0,0 +1,83 @@
+// ---------------------------------------------------------------------
+// $Id: pointer_matrix_01.cc 2014-03-14 dilangov $
+//
+// Copyright (C) 2006 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+// check PointerMatrix:checkTvmult_add
+
+#include "../tests.h"
+#include <deal.II/base/logstream.h>
+#include <deal.II/lac/pointer_matrix.h>
+#include <deal.II/lac/full_matrix.h>
+#include <deal.II/lac/vector.h>
+
+template<typename number>
+  void
+  checkTvmult_add(FullMatrix<number> &A, Vector<number> &V, char *name =
+      "Test Matrix")
+  {
+    deallog << "Tvmult_add" << std::endl;
+
+    PointerMatrix<FullMatrix<number>, Vector<number> > P(&A, name);
+
+    deallog << "Result vector set to all ones and to be added with result"
+        << std::endl;
+    Vector<number> O(V.size());
+    for (unsigned int i = 0; i < O.size(); ++i)
+      O(i) = 1;
+
+    P.Tvmult_add(O, V);
+
+    // Check the dimensions of the result matrix
+    Assert(A.m() == O.size(), ExcInternalError());
+    deallog << "Dimensions of result vector verified" << std::endl;
+
+    // Verifying results with Method 2: O=O+A Transpose*V	
+    Vector<number> O_(V.size());
+    for (unsigned int i = 0; i < O_.size(); ++i)
+      O_(i) = 1;
+
+    A.Tvmult_add(O_, V);
+
+    Assert(O == O_, ExcInternalError());
+    deallog << "Result vector data verified" << std::endl;
+
+    for (unsigned int i = 0; i < O.size(); ++i)
+      deallog << O(i) << '\t';
+    deallog << std::endl;
+  }
+
+int
+main()
+{
+
+  std::ofstream logfile("output");
+  deallog << std::fixed;
+  deallog << std::setprecision(4);
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+  const double Adata[] =
+    { 2, 3, 4, 5 };
+
+  FullMatrix<double> A(2, 2);
+  A.fill(Adata);
+
+  Vector<double> V(2);
+  V(0) = 1;
+  V(1) = 2;
+
+  checkTvmult_add<double>(A, V);
+}
diff --git a/tests/lac/pointer_matrix_07.output b/tests/lac/pointer_matrix_07.output
new file mode 100644
index 0000000000..71e06a0437
--- /dev/null
+++ b/tests/lac/pointer_matrix_07.output
@@ -0,0 +1,6 @@
+
+DEAL::Tvmult_add
+DEAL::Result vector set to all ones and to be added with result
+DEAL::Dimensions of result vector verified
+DEAL::Result vector data verified
+DEAL::11.0000	14.0000	
diff --git a/tests/lac/pointer_matrix_08.cc b/tests/lac/pointer_matrix_08.cc
new file mode 100644
index 0000000000..ad3d1b18f8
--- /dev/null
+++ b/tests/lac/pointer_matrix_08.cc
@@ -0,0 +1,83 @@
+// ---------------------------------------------------------------------
+// $Id: pointer_matrix_01.cc 2014-03-14 dilangov $
+//
+// Copyright (C) 2006 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+// check PointerMatrix:checkVmult_add
+
+#include "../tests.h"
+#include <deal.II/base/logstream.h>
+#include <deal.II/lac/pointer_matrix.h>
+#include <deal.II/lac/full_matrix.h>
+#include <deal.II/lac/vector.h>
+
+template<typename number>
+  void
+  checkVmult_add(FullMatrix<number> &A, Vector<number> &V, char *name =
+      "Test Matrix")
+  {
+    deallog << "vmult_add" << std::endl;
+
+    PointerMatrix<FullMatrix<number>, Vector<number> > P(&A, name);
+
+    deallog << "Result vector set to all ones and to be added with result"
+        << std::endl;
+    Vector<number> O(V.size());
+    for (unsigned int i = 0; i < O.size(); ++i)
+      O(i) = 1;
+
+    P.vmult_add(O, V);
+
+    // Check the dimensions of the result matrix
+    Assert(A.m() == O.size(), ExcInternalError());
+    deallog << "Dimensions of result vector verified" << std::endl;
+
+    // Verifying results with Method 2: O=O+A*V	
+    Vector<number> O_(V.size());
+    for (unsigned int i = 0; i < O_.size(); ++i)
+      O_(i) = 1;
+
+    A.vmult_add(O_, V);
+
+    Assert(O == O_, ExcInternalError());
+    deallog << "Result vector data verified" << std::endl;
+
+    for (unsigned int i = 0; i < O.size(); ++i)
+      deallog << O(i) << '\t';
+    deallog << std::endl;
+  }
+
+int
+main()
+{
+
+  std::ofstream logfile("output");
+  deallog << std::fixed;
+  deallog << std::setprecision(4);
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+  const double Adata[] =
+    { 2, 3, 4, 5 };
+
+  FullMatrix<double> A(2, 2);
+  A.fill(Adata);
+
+  Vector<double> V(2);
+  V(0) = 1;
+  V(1) = 2;
+
+  checkVmult_add<double>(A, V);
+}
diff --git a/tests/lac/pointer_matrix_08.output b/tests/lac/pointer_matrix_08.output
new file mode 100644
index 0000000000..654ff7f6ad
--- /dev/null
+++ b/tests/lac/pointer_matrix_08.output
@@ -0,0 +1,6 @@
+
+DEAL::vmult_add
+DEAL::Result vector set to all ones and to be added with result
+DEAL::Dimensions of result vector verified
+DEAL::Result vector data verified
+DEAL::9.0000	15.0000	
diff --git a/tests/lac/pointer_matrix_09.cc b/tests/lac/pointer_matrix_09.cc
new file mode 100644
index 0000000000..5a27c2586f
--- /dev/null
+++ b/tests/lac/pointer_matrix_09.cc
@@ -0,0 +1,81 @@
+// ---------------------------------------------------------------------
+// $Id: pointer_matrix_01.cc 2014-03-14 dilangov $
+//
+// Copyright (C) 2006 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+// check PointerMatrix:checkClear
+
+#include "../tests.h"
+#include <deal.II/base/logstream.h>
+#include <deal.II/lac/pointer_matrix.h>
+#include <deal.II/lac/full_matrix.h>
+#include <deal.II/lac/vector.h>
+
+template<typename number>
+  void
+  checkClear(FullMatrix<number> &A)
+  {
+    deallog << "clear" << std::endl;
+    deallog << "Init with matrix 1" << std::endl;
+
+    PointerMatrix<FullMatrix<number>, Vector<number> > P(&A);
+
+    deallog << "Multiplying with all ones vector" << std::endl;
+    Vector<number> V(A.n());
+    for (unsigned int i = 0; i < V.size(); ++i)
+      V(i) = 1;
+
+    Vector<number> O(A.m());
+    P.vmult(O, V);
+
+    // Check the dimensions of the result vector
+    Assert(A.m() == O.size(), ExcInternalError());
+    deallog << "Dimensions of result vector verified" << std::endl;
+
+    // Verifying results with Method 2: O=A*V
+    Vector<number> O_(A.m());
+    A.vmult(O_, V);
+
+    Assert(O == O_, ExcInternalError());
+    deallog << "Result vector data verified" << std::endl;
+
+    for (unsigned int i = 0; i < O.size(); ++i)
+      deallog << O(i) << '\t';
+    deallog << std::endl;
+
+    deallog << "Clearing pointer matrix" << std::endl;
+    P.clear();
+
+    deallog << "Is matrix empty:" << P.empty() << std::endl;
+  }
+
+int
+main()
+{
+
+  std::ofstream logfile("output");
+  deallog << std::fixed;
+  deallog << std::setprecision(4);
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+  const double Adata[] =
+    { 2, 3, 4, 5 };
+
+  FullMatrix<double> A(2, 2);
+  A.fill(Adata);
+
+  checkClear(A);
+}
diff --git a/tests/lac/pointer_matrix_09.output b/tests/lac/pointer_matrix_09.output
new file mode 100644
index 0000000000..0455e79cb6
--- /dev/null
+++ b/tests/lac/pointer_matrix_09.output
@@ -0,0 +1,9 @@
+
+DEAL::clear
+DEAL::Init with matrix 1
+DEAL::Multiplying with all ones vector
+DEAL::Dimensions of result vector verified
+DEAL::Result vector data verified
+DEAL::5.0000	9.0000	
+DEAL::Clearing pointer matrix
+DEAL::Is matrix empty:1
diff --git a/tests/lac/pointer_matrix_10.cc b/tests/lac/pointer_matrix_10.cc
new file mode 100644
index 0000000000..b4489cd30e
--- /dev/null
+++ b/tests/lac/pointer_matrix_10.cc
@@ -0,0 +1,113 @@
+// ---------------------------------------------------------------------
+// $Id: pointer_matrix_01.cc 2014-03-14 dilangov $
+//
+// Copyright (C) 2006 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+// check PointerMatrix:checkAssign
+
+#include "../tests.h"
+#include <deal.II/base/logstream.h>
+#include <deal.II/lac/pointer_matrix.h>
+#include <deal.II/lac/full_matrix.h>
+#include <deal.II/lac/vector.h>
+
+template<typename number>
+  void
+  checkAssign(FullMatrix<number> &A, FullMatrix<number> &B)
+  {
+    deallog << "=" << std::endl;
+    deallog << "Init with matrix 1" << std::endl;
+
+    PointerMatrix<FullMatrix<number>, Vector<number> > P(&A);
+
+    deallog << "Multiplying with all ones vector" << std::endl;
+    Vector<number> V(A.n());
+    for (unsigned int i = 0; i < V.size(); ++i)
+      V(i) = 1;
+
+    Vector<number> O(A.m());
+    P.vmult(O, V);
+
+    // Check the dimensions of the result vector
+    Assert(A.m() == O.size(), ExcInternalError());
+    deallog << "Dimensions of result vector verified" << std::endl;
+
+    // Verifying results with Method 2: O=A*V
+    Vector<number> O_(A.m());
+    A.vmult(O_, V);
+
+    Assert(O == O_, ExcInternalError());
+    deallog << "Result vector data verified" << std::endl;
+
+    for (unsigned int i = 0; i < O.size(); ++i)
+      deallog << O(i) << '\t';
+    deallog << std::endl;
+
+    deallog << "Clearing pointer matrix" << std::endl;
+    P.clear();
+
+    deallog << "Is matrix empty:" << P.empty() << std::endl;
+
+    deallog << "Assigning pointer matrix to matrix 2" << std::endl;
+
+    P = &B;
+
+    deallog << "Multiplying with all ones vector" << std::endl;
+    Vector<number> V_(B.n());
+    for (unsigned int i = 0; i < V_.size(); ++i)
+      V_(i) = 1;
+
+    Vector<number> OU(B.m());
+    P.vmult(OU, V_);
+
+    // Check the dimensions of the result vector
+    Assert(B.m() == OU.size(), ExcInternalError());
+    deallog << "Dimensions of result vector verified" << std::endl;
+
+    // Verifying results with Method 2: O=B*V
+    Vector<number> OU_(B.m());
+    B.vmult(OU_, V_);
+
+    Assert(OU == OU_, ExcInternalError());
+    deallog << "Result vector data verified" << std::endl;
+
+    for (unsigned int i = 0; i < OU.size(); ++i)
+      deallog << OU(i) << '\t';
+    deallog << std::endl;
+  }
+
+int
+main()
+{
+
+  std::ofstream logfile("output");
+  deallog << std::fixed;
+  deallog << std::setprecision(4);
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+  const double Adata[] =
+    { 2, 3, 4, 5 };
+
+  const double Bdata[] =
+    { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
+
+  FullMatrix<double> A(2, 2);
+  A.fill(Adata);
+  FullMatrix<double> B(3, 3);
+  B.fill(Bdata);
+
+  checkAssign(A, B);
+}
diff --git a/tests/lac/pointer_matrix_10.output b/tests/lac/pointer_matrix_10.output
new file mode 100644
index 0000000000..6b39ca39a4
--- /dev/null
+++ b/tests/lac/pointer_matrix_10.output
@@ -0,0 +1,14 @@
+
+DEAL::=
+DEAL::Init with matrix 1
+DEAL::Multiplying with all ones vector
+DEAL::Dimensions of result vector verified
+DEAL::Result vector data verified
+DEAL::5.0000	9.0000	
+DEAL::Clearing pointer matrix
+DEAL::Is matrix empty:1
+DEAL::Assigning pointer matrix to matrix 2
+DEAL::Multiplying with all ones vector
+DEAL::Dimensions of result vector verified
+DEAL::Result vector data verified
+DEAL::6.0000	15.0000	24.0000	
-- 
2.39.5