From 4cf212e0241ee76ed03334e79a33b73bc2de15ba Mon Sep 17 00:00:00 2001 From: wolf Date: Mon, 9 Feb 2004 22:53:07 +0000 Subject: [PATCH] New tests. git-svn-id: https://svn.dealii.org/trunk@8444 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/bits/sparse_matrix_vector_01.cc | 103 ++++++++++++++++ tests/bits/sparse_matrix_vector_02.cc | 103 ++++++++++++++++ tests/bits/sparse_matrix_vector_03.cc | 106 +++++++++++++++++ tests/bits/sparse_matrix_vector_04.cc | 106 +++++++++++++++++ tests/bits/sparse_matrix_vector_05.cc | 109 +++++++++++++++++ tests/bits/sparse_matrix_vector_06.cc | 100 ++++++++++++++++ tests/bits/sparse_matrix_vector_07.cc | 112 ++++++++++++++++++ .../bits/sparse_matrix_vector_01.output | 2 + .../bits/sparse_matrix_vector_02.output | 2 + .../bits/sparse_matrix_vector_03.output | 2 + .../bits/sparse_matrix_vector_04.output | 2 + .../bits/sparse_matrix_vector_05.output | 2 + .../bits/sparse_matrix_vector_06.output | 2 + .../bits/sparse_matrix_vector_07.output | 2 + 14 files changed, 753 insertions(+) create mode 100644 tests/bits/sparse_matrix_vector_01.cc create mode 100644 tests/bits/sparse_matrix_vector_02.cc create mode 100644 tests/bits/sparse_matrix_vector_03.cc create mode 100644 tests/bits/sparse_matrix_vector_04.cc create mode 100644 tests/bits/sparse_matrix_vector_05.cc create mode 100644 tests/bits/sparse_matrix_vector_06.cc create mode 100644 tests/bits/sparse_matrix_vector_07.cc create mode 100644 tests/results/i686-pc-linux-gnu+gcc3.2/bits/sparse_matrix_vector_01.output create mode 100644 tests/results/i686-pc-linux-gnu+gcc3.2/bits/sparse_matrix_vector_02.output create mode 100644 tests/results/i686-pc-linux-gnu+gcc3.2/bits/sparse_matrix_vector_03.output create mode 100644 tests/results/i686-pc-linux-gnu+gcc3.2/bits/sparse_matrix_vector_04.output create mode 100644 tests/results/i686-pc-linux-gnu+gcc3.2/bits/sparse_matrix_vector_05.output create mode 100644 tests/results/i686-pc-linux-gnu+gcc3.2/bits/sparse_matrix_vector_06.output create mode 100644 tests/results/i686-pc-linux-gnu+gcc3.2/bits/sparse_matrix_vector_07.output diff --git a/tests/bits/sparse_matrix_vector_01.cc b/tests/bits/sparse_matrix_vector_01.cc new file mode 100644 index 0000000000..c2af6bdda1 --- /dev/null +++ b/tests/bits/sparse_matrix_vector_01.cc @@ -0,0 +1,103 @@ +//---------------------------- sparse_matrix_vector_01.cc --------------------------- +// vector_11.cc,v 1.4 2003/07/03 10:31:46 guido Exp +// Version: +// +// Copyright (C) 2004 by the deal.II authors and Anna Schneebeli +// +// 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. +// +//---------------------------- sparse_matrix_vector_01.cc --------------------------- + + +// check SparseMatrix::vmult + +#include "../tests.h" +#include +#include +#include +#include +#include + + +void test (Vector &v, + Vector &w) +{ + // set some entries in the + // matrix. actually, set them all + SparsityPattern sp (v.size(),v.size(),v.size()); + for (unsigned int i=0; i m(sp); + for (unsigned int i=0; i v (100); + Vector w (100); + test (v,w); + } + catch (std::exception &exc) + { + std::cerr << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + std::cerr << "Exception on processing: " << std::endl + << exc.what() << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + + return 1; + } + catch (...) + { + std::cerr << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + std::cerr << "Unknown exception!" << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + return 1; + }; +} diff --git a/tests/bits/sparse_matrix_vector_02.cc b/tests/bits/sparse_matrix_vector_02.cc new file mode 100644 index 0000000000..8c82ef0dca --- /dev/null +++ b/tests/bits/sparse_matrix_vector_02.cc @@ -0,0 +1,103 @@ +//---------------------------- sparse_matrix_vector_02.cc --------------------------- +// vector_11.cc,v 1.4 2003/07/03 10:31:46 guido Exp +// Version: +// +// Copyright (C) 2004 by the deal.II authors and Anna Schneebeli +// +// 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. +// +//---------------------------- sparse_matrix_vector_02.cc --------------------------- + + +// check SparseMatrix::Tvmult + +#include "../tests.h" +#include +#include +#include +#include +#include + + +void test (Vector &v, + Vector &w) +{ + // set some entries in the + // matrix. actually, set them all + SparsityPattern sp (v.size(),v.size(),v.size()); + for (unsigned int i=0; i m(sp); + for (unsigned int i=0; i v (100); + Vector w (100); + test (v,w); + } + catch (std::exception &exc) + { + std::cerr << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + std::cerr << "Exception on processing: " << std::endl + << exc.what() << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + + return 1; + } + catch (...) + { + std::cerr << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + std::cerr << "Unknown exception!" << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + return 1; + }; +} diff --git a/tests/bits/sparse_matrix_vector_03.cc b/tests/bits/sparse_matrix_vector_03.cc new file mode 100644 index 0000000000..aac5befa8f --- /dev/null +++ b/tests/bits/sparse_matrix_vector_03.cc @@ -0,0 +1,106 @@ +//---------------------------- sparse_matrix_vector_03.cc --------------------------- +// vector_11.cc,v 1.4 2003/07/03 10:31:46 guido Exp +// Version: +// +// Copyright (C) 2004 by the deal.II authors and Anna Schneebeli +// +// 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. +// +//---------------------------- sparse_matrix_vector_03.cc --------------------------- + + +// check SparseMatrix::vmult_add + +#include "../tests.h" +#include +#include +#include +#include +#include + + +void test (Vector &v, + Vector &w) +{ + // set some entries in the + // matrix. actually, set them all + SparsityPattern sp (v.size(),v.size(),v.size()); + for (unsigned int i=0; i m(sp); + for (unsigned int i=0; i v (100); + Vector w (100); + test (v,w); + } + catch (std::exception &exc) + { + std::cerr << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + std::cerr << "Exception on processing: " << std::endl + << exc.what() << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + + return 1; + } + catch (...) + { + std::cerr << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + std::cerr << "Unknown exception!" << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + return 1; + }; +} diff --git a/tests/bits/sparse_matrix_vector_04.cc b/tests/bits/sparse_matrix_vector_04.cc new file mode 100644 index 0000000000..692fcf00f9 --- /dev/null +++ b/tests/bits/sparse_matrix_vector_04.cc @@ -0,0 +1,106 @@ +//---------------------------- sparse_matrix_vector_04.cc --------------------------- +// vector_11.cc,v 1.4 2003/07/03 10:31:46 guido Exp +// Version: +// +// Copyright (C) 2004 by the deal.II authors and Anna Schneebeli +// +// 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. +// +//---------------------------- sparse_matrix_vector_04.cc --------------------------- + + +// check SparseMatrix::Tvmult_add + +#include "../tests.h" +#include +#include +#include +#include +#include + + +void test (Vector &v, + Vector &w) +{ + // set some entries in the + // matrix. actually, set them all + SparsityPattern sp (v.size(),v.size(),v.size()); + for (unsigned int i=0; i m(sp); + for (unsigned int i=0; i v (100); + Vector w (100); + test (v,w); + } + catch (std::exception &exc) + { + std::cerr << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + std::cerr << "Exception on processing: " << std::endl + << exc.what() << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + + return 1; + } + catch (...) + { + std::cerr << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + std::cerr << "Unknown exception!" << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + return 1; + }; +} diff --git a/tests/bits/sparse_matrix_vector_05.cc b/tests/bits/sparse_matrix_vector_05.cc new file mode 100644 index 0000000000..27ab5b0cbf --- /dev/null +++ b/tests/bits/sparse_matrix_vector_05.cc @@ -0,0 +1,109 @@ +//---------------------------- sparse_matrix_vector_05.cc --------------------------- +// vector_11.cc,v 1.4 2003/07/03 10:31:46 guido Exp +// Version: +// +// Copyright (C) 2004 by the deal.II authors and Anna Schneebeli +// +// 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. +// +//---------------------------- sparse_matrix_vector_05.cc --------------------------- + + +// check SparseMatrix::matrix_scalar_product + +#include "../tests.h" +#include +#include +#include +#include +#include + + +void test (Vector &v, + Vector &w) +{ + // set some entries in the + // matrix. actually, set them all + SparsityPattern sp (v.size(),v.size(),v.size()); + for (unsigned int i=0; i m(sp); + for (unsigned int i=0; i + const double s = m.matrix_scalar_product (w,v); + + // make sure we get the expected result + for (unsigned int i=0; i v (100); + Vector w (100); + test (v,w); + } + catch (std::exception &exc) + { + std::cerr << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + std::cerr << "Exception on processing: " << std::endl + << exc.what() << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + + return 1; + } + catch (...) + { + std::cerr << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + std::cerr << "Unknown exception!" << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + return 1; + }; +} diff --git a/tests/bits/sparse_matrix_vector_06.cc b/tests/bits/sparse_matrix_vector_06.cc new file mode 100644 index 0000000000..35489cca6d --- /dev/null +++ b/tests/bits/sparse_matrix_vector_06.cc @@ -0,0 +1,100 @@ +//---------------------------- sparse_matrix_vector_06.cc --------------------------- +// vector_11.cc,v 1.4 2003/07/03 10:31:46 guido Exp +// Version: +// +// Copyright (C) 2004 by the deal.II authors and Anna Schneebeli +// +// 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. +// +//---------------------------- sparse_matrix_vector_06.cc --------------------------- + + +// check SparseMatrix::matrix_norm_square + +#include "../tests.h" +#include +#include +#include +#include +#include + + +void test (Vector &v) +{ + // set some entries in the + // matrix. actually, set them all + SparsityPattern sp (v.size(),v.size(),v.size()); + for (unsigned int i=0; i m(sp); + for (unsigned int i=0; i + const double s = m.matrix_norm_square (v); + + // make sure we get the expected result + for (unsigned int i=0; i v (100); + test (v); + } + catch (std::exception &exc) + { + std::cerr << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + std::cerr << "Exception on processing: " << std::endl + << exc.what() << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + + return 1; + } + catch (...) + { + std::cerr << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + std::cerr << "Unknown exception!" << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + return 1; + }; +} diff --git a/tests/bits/sparse_matrix_vector_07.cc b/tests/bits/sparse_matrix_vector_07.cc new file mode 100644 index 0000000000..f4548c3b13 --- /dev/null +++ b/tests/bits/sparse_matrix_vector_07.cc @@ -0,0 +1,112 @@ +//---------------------------- sparse_matrix_vector_07.cc --------------------------- +// vector_11.cc,v 1.4 2003/07/03 10:31:46 guido Exp +// Version: +// +// Copyright (C) 2004 by the deal.II authors and Anna Schneebeli +// +// 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. +// +//---------------------------- sparse_matrix_vector_07.cc --------------------------- + + +// check SparseMatrix::matrix_norm_square + +#include "../tests.h" +#include +#include +#include +#include +#include + + +void test (Vector &v, + Vector &w, + Vector &x) +{ + // set some entries in the + // matrix. actually, set them all + SparsityPattern sp (v.size(),v.size(),v.size()); + for (unsigned int i=0; i m(sp); + for (unsigned int i=0; i v (100); + Vector w (100); + Vector x (100); + test (v,w,x); + } + catch (std::exception &exc) + { + std::cerr << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + std::cerr << "Exception on processing: " << std::endl + << exc.what() << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + + return 1; + } + catch (...) + { + std::cerr << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + std::cerr << "Unknown exception!" << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + return 1; + }; +} diff --git a/tests/results/i686-pc-linux-gnu+gcc3.2/bits/sparse_matrix_vector_01.output b/tests/results/i686-pc-linux-gnu+gcc3.2/bits/sparse_matrix_vector_01.output new file mode 100644 index 0000000000..0fd8fc12f0 --- /dev/null +++ b/tests/results/i686-pc-linux-gnu+gcc3.2/bits/sparse_matrix_vector_01.output @@ -0,0 +1,2 @@ + +DEAL::OK diff --git a/tests/results/i686-pc-linux-gnu+gcc3.2/bits/sparse_matrix_vector_02.output b/tests/results/i686-pc-linux-gnu+gcc3.2/bits/sparse_matrix_vector_02.output new file mode 100644 index 0000000000..0fd8fc12f0 --- /dev/null +++ b/tests/results/i686-pc-linux-gnu+gcc3.2/bits/sparse_matrix_vector_02.output @@ -0,0 +1,2 @@ + +DEAL::OK diff --git a/tests/results/i686-pc-linux-gnu+gcc3.2/bits/sparse_matrix_vector_03.output b/tests/results/i686-pc-linux-gnu+gcc3.2/bits/sparse_matrix_vector_03.output new file mode 100644 index 0000000000..0fd8fc12f0 --- /dev/null +++ b/tests/results/i686-pc-linux-gnu+gcc3.2/bits/sparse_matrix_vector_03.output @@ -0,0 +1,2 @@ + +DEAL::OK diff --git a/tests/results/i686-pc-linux-gnu+gcc3.2/bits/sparse_matrix_vector_04.output b/tests/results/i686-pc-linux-gnu+gcc3.2/bits/sparse_matrix_vector_04.output new file mode 100644 index 0000000000..0fd8fc12f0 --- /dev/null +++ b/tests/results/i686-pc-linux-gnu+gcc3.2/bits/sparse_matrix_vector_04.output @@ -0,0 +1,2 @@ + +DEAL::OK diff --git a/tests/results/i686-pc-linux-gnu+gcc3.2/bits/sparse_matrix_vector_05.output b/tests/results/i686-pc-linux-gnu+gcc3.2/bits/sparse_matrix_vector_05.output new file mode 100644 index 0000000000..0fd8fc12f0 --- /dev/null +++ b/tests/results/i686-pc-linux-gnu+gcc3.2/bits/sparse_matrix_vector_05.output @@ -0,0 +1,2 @@ + +DEAL::OK diff --git a/tests/results/i686-pc-linux-gnu+gcc3.2/bits/sparse_matrix_vector_06.output b/tests/results/i686-pc-linux-gnu+gcc3.2/bits/sparse_matrix_vector_06.output new file mode 100644 index 0000000000..0fd8fc12f0 --- /dev/null +++ b/tests/results/i686-pc-linux-gnu+gcc3.2/bits/sparse_matrix_vector_06.output @@ -0,0 +1,2 @@ + +DEAL::OK diff --git a/tests/results/i686-pc-linux-gnu+gcc3.2/bits/sparse_matrix_vector_07.output b/tests/results/i686-pc-linux-gnu+gcc3.2/bits/sparse_matrix_vector_07.output new file mode 100644 index 0000000000..0fd8fc12f0 --- /dev/null +++ b/tests/results/i686-pc-linux-gnu+gcc3.2/bits/sparse_matrix_vector_07.output @@ -0,0 +1,2 @@ + +DEAL::OK -- 2.39.5