]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
test conjugate_add
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 25 Jun 2003 12:25:22 +0000 (12:25 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 25 Jun 2003 12:25:22 +0000 (12:25 +0000)
git-svn-id: https://svn.dealii.org/trunk@7811 0785d39b-7218-0410-832d-ea1e28bc413d

tests/lac/sparse_matrices.cc
tests/results/i686-pc-linux-gnu+gcc3.2/lac/sparse_matrices.output

index 981fe3ff1492c7cc398374677d1383aeb8d6df63..8f8ffc379e1753603a53b00e16af6b149e7b1199 100644 (file)
@@ -168,6 +168,47 @@ void check_ez_iterator()
 }
 
 
+void check_conjugate(std::ostream& out)
+{
+  SparseMatrixEZ<double> B(3,2);
+  SparseMatrixEZ<float>  A1(2,2);
+  SparseMatrixEZ<float>  A2(3,3);
+  SparseMatrixEZ<double> C1(3,3);
+  SparseMatrixEZ<double> C2(2,2);
+
+  B.set(0, 0, 0.);
+  B.set(0, 1, 1.);
+  B.set(1, 0, 2.);
+  B.set(1, 1, 3.);
+  B.set(2, 0, 4.);
+  B.set(2, 1, 5.);
+
+  A1.set(0, 0, 1.);
+  A1.set(0, 1, 2.);
+  A1.set(1, 0, 3.);
+  A1.set(1, 1, 4.);
+
+  A2.set(0, 0, 1.);
+  A2.set(0, 1, 2.);
+  A2.set(0, 2, 3.);
+  A2.set(1, 0, 4.);
+  A2.set(1, 1, 5.);
+  A2.set(1, 2, 6.);
+  A2.set(2, 0, 7.);
+  A2.set(2, 1, 8.);
+  A2.set(2, 2, 9.);
+
+  C1.conjugate_add(A1,B);
+  C2.conjugate_add(A2,B,true);
+
+  out << "First conjugate" << std::endl;
+  C1.print(out);
+  
+  out << "Second conjugate" << std::endl;
+  C2.print(out);
+}
+
+
 int main()
 {
   std::ofstream logfile("sparse_matrices.output");
@@ -190,6 +231,7 @@ int main()
 #endif
   
   check_ez_iterator();
+  check_conjugate(logfile);
   
   FDMatrix testproblem (size, size);
   unsigned int dim = (size-1)*(size-1);
index d0fcd083aa3013ed538886bcad837b336b438539..0e2be7d4ddb26f830ef64b36aa0edc6d353c5d21 100644 (file)
@@ -47,6 +47,21 @@ DEAL::       2       0       0       3.0
 DEAL:: 4       0       3       17.
 DEAL::Repeat row 2
 DEAL:: 2       0       0       3.0
+First conjugate
+0      0       4.0
+0      1       18.
+0      2       32.
+1      0       16.
+1      1       70.
+1      2       1.2e+02
+2      0       28.
+2      1       1.2e+02
+2      2       2.2e+02
+Second conjugate
+0      0       2.8e+02
+0      1       4.0e+02
+1      0       3.8e+02
+1      1       5.5e+02
 DEAL::Structure
 DEAL::Assemble
 DEAL:5-SparseMatrix<double>:Richardson::Starting value 4.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.