]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
New test
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 19 Jun 2004 22:19:56 +0000 (22:19 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 19 Jun 2004 22:19:56 +0000 (22:19 +0000)
git-svn-id: https://svn.dealii.org/trunk@9435 0785d39b-7218-0410-832d-ea1e28bc413d

tests/bits/sparsity_pattern_01.cc [new file with mode: 0644]

diff --git a/tests/bits/sparsity_pattern_01.cc b/tests/bits/sparsity_pattern_01.cc
new file mode 100644 (file)
index 0000000..76e1d24
--- /dev/null
@@ -0,0 +1,51 @@
+//----------------------------  sparsity_pattern_01.cc  ---------------------------
+//    $Id$
+//    Version: $Name$ 
+//
+//    Copyright (C) 2004 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.
+//
+//----------------------------  sparsity_pattern_01.cc  ---------------------------
+
+
+// check SparsityPattern::copy_from(CompressedSparsityPattern)
+
+#include "../tests.h"
+#include <base/logstream.h>
+#include <lac/sparsity_pattern.h>
+#include <lac/compressed_sparsity_pattern.h>
+#include <iostream>
+#include <fstream>
+
+
+void test ()
+{
+  const unsigned int N = 100;
+  CompressedSparsityPattern csp (N,N);
+  for (unsigned int i=0; i<N; ++i)
+    for (unsigned int j=0; j<10; ++j)
+      csp.add (i, (i+(i+1)*(j*j+i))%N);
+
+  SparsityPattern sp;
+  sp.copy_from (csp);
+  for (unsigned int i=0; i<N; ++i)
+    for (unsigned int j=0; j<sp.row_length (i); ++j)
+      deallog << i << ' ' << j << ' ' << sp.column_number (i,j)
+              << std::endl;  
+}
+
+
+
+int main () 
+{
+  std::ofstream logfile("sparsity_pattern_01.output");
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+
+  test ();
+  return 0;
+}

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.