From: Guido Kanschat Date: Wed, 25 Jun 2003 12:25:22 +0000 (+0000) Subject: test conjugate_add X-Git-Tag: v8.0.0~16398 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f13291e73b70217d2cb94da151f0c24b22c3e1b;p=dealii.git test conjugate_add git-svn-id: https://svn.dealii.org/trunk@7811 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/lac/sparse_matrices.cc b/tests/lac/sparse_matrices.cc index 981fe3ff14..8f8ffc379e 100644 --- a/tests/lac/sparse_matrices.cc +++ b/tests/lac/sparse_matrices.cc @@ -168,6 +168,47 @@ void check_ez_iterator() } +void check_conjugate(std::ostream& out) +{ + SparseMatrixEZ B(3,2); + SparseMatrixEZ A1(2,2); + SparseMatrixEZ A2(3,3); + SparseMatrixEZ C1(3,3); + SparseMatrixEZ 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);