]> https://gitweb.dealii.org/ - dealii.git/commitdiff
fixed Table<2,T>::reinit(TableIndices<2>) 1036/head
authorDenis Davydov <davydden@gmail.com>
Tue, 23 Jun 2015 17:46:12 +0000 (19:46 +0200)
committerDenis Davydov <davydden@gmail.com>
Tue, 23 Jun 2015 17:46:12 +0000 (19:46 +0200)
include/deal.II/base/table.h
tests/base/table_05.cc [new file with mode: 0644]
tests/base/table_05.output [new file with mode: 0644]

index 50301c7c3d9055cfb07e0170534b3d87c145da28..3dc6ec75d1dd8341d32531b0d1da44e412e4496c 100644 (file)
@@ -866,6 +866,8 @@ public:
                const unsigned int size2,
                const bool         fast = false);
 
+  using TableBase<2,T>::reinit;
+
   /**
    * Access operator. Generate an object that accesses the requested row of
    * this two-dimensional table. Range checks are performed.
diff --git a/tests/base/table_05.cc b/tests/base/table_05.cc
new file mode 100644 (file)
index 0000000..00a0b12
--- /dev/null
@@ -0,0 +1,59 @@
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 1998 - 2015 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 that Table<{1,2,3},T>::reinit(TableIndices) work 
+
+#include "../tests.h"
+#include <cmath>
+#include <fstream>
+#include <iomanip>
+#include <cstdlib>
+
+#include <deal.II/base/logstream.h>
+#include <deal.II/base/table.h>
+
+template<int dim>
+void test()
+{
+  dealii::TableIndices<dim> new_size;
+  for (unsigned int d = 0; d < dim; d++)
+    new_size[d] = 5;
+
+  dealii::Table<dim,int>    unrolled;
+  unrolled.reinit(new_size);
+
+  deallog<<"OK"<<std::endl;
+}
+
+
+int
+main ()
+{
+  std::ofstream logfile("output");
+  deallog << std::fixed;
+  deallog << std::setprecision(0);
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+  test<1>();
+  test<2>();
+  test<3>();
+
+}
+
+
+
diff --git a/tests/base/table_05.output b/tests/base/table_05.output
new file mode 100644 (file)
index 0000000..fb71de2
--- /dev/null
@@ -0,0 +1,4 @@
+
+DEAL::OK
+DEAL::OK
+DEAL::OK

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.