]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Mini-test for SparseMatrixEZ iterators.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 16 Apr 2003 16:25:00 +0000 (16:25 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 16 Apr 2003 16:25:00 +0000 (16:25 +0000)
git-svn-id: https://svn.dealii.org/trunk@7402 0785d39b-7218-0410-832d-ea1e28bc413d

tests/lac/Makefile
tests/lac/sparse_matrix_ez_iterator.cc [new file with mode: 0644]

index 5c0a2aa7c169efba62a3ec5736c463d8d8c34a19..7fdcc7674339e6810f5d38966e48d3c78fdd8d38 100644 (file)
@@ -30,6 +30,7 @@ sparse_matrices.exe       : sparse_matrices.g.$(OBJEXT) testmatrix.g.$(OBJEXT) $
 sparse_matrices.opt.exe   : sparse_matrices.$(OBJEXT) testmatrix.$(OBJEXT) $(libraries_o)
 sparsity_pattern.exe      : sparsity_pattern.g.$(OBJEXT) testmatrix.g.$(OBJEXT) $(libraries)
 sparse_ilu.exe            : sparse_ilu.g.$(OBJEXT) testmatrix.g.$(OBJEXT) $(libraries)
+sparse_matrix_ez_iterator.exe : sparse_matrix_ez_iterator.g.$(OBJEXT)   $(libraries)
 vector-vector.exe         : vector-vector.g.$(OBJEXT)                   $(libraries)
 #mgbase.exe               : mgbase.g.$(OBJEXT)                          $(libraries)
 #mg.exe                   : mg.g.$(OBJEXT) testmatrix.g.$(OBJEXT)       $(libraries)
@@ -38,7 +39,8 @@ vector-vector.exe         : vector-vector.g.$(OBJEXT)                   $(librar
 tests = $(sort \
           sparse_matrices block_matrices block_vector block_vector_iterator \
           full_matrix \
-          matrix_out solver sparsity_pattern sparse_ilu vector-vector)
+          matrix_out solver sparsity_pattern sparse_ilu \
+          sparse_matrix_ez_iterator vector-vector)
 
 ############################################################
 
diff --git a/tests/lac/sparse_matrix_ez_iterator.cc b/tests/lac/sparse_matrix_ez_iterator.cc
new file mode 100644 (file)
index 0000000..1bcec96
--- /dev/null
@@ -0,0 +1,27 @@
+#include <base/logstream.h>
+#include <lac/sparse_matrix_ez.h>
+
+#include <fstream>
+
+
+int main ()
+{
+  std::ofstream logfile("sparse_matrix_ez_iterator.output");
+  logfile.setf(std::ios::fixed);
+  logfile.precision(2);
+  deallog.attach(logfile);
+
+  SparseMatrixEZ<double> m (4,4,4);
+  m.set (0,0,1);
+  m.set (1,0,2);
+  m.set (2,0,3);
+  m.set (2,2,0);  // should be ignored
+  m.set (0,1,1);
+  m.set (0,2,2);
+  m.set (0,3,3);
+  
+  for (SparseMatrixEZ<double>::const_iterator i = m.begin(); i != m.end(); ++i)
+    deallog << i->row() << ' ' << i->column() << ' ' << i->value()
+           << std::endl;
+}
+

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.