From 0afec0c4b71298bb797ba1595f89ab07954cc3f3 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 9 Feb 2004 13:38:14 +0000 Subject: [PATCH] More tests. git-svn-id: https://svn.dealii.org/trunk@8432 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/bits/petsc_03a.cc | 1 + tests/bits/petsc_17.cc | 82 +++++++++++++++++++++++++ tests/bits/petsc_18.cc | 82 +++++++++++++++++++++++++ tests/bits/petsc_19.cc | 82 +++++++++++++++++++++++++ tests/bits/petsc_20.cc | 91 ++++++++++++++++++++++++++++ tests/bits/petsc_21.cc | 91 ++++++++++++++++++++++++++++ tests/bits/petsc_22.cc | 86 ++++++++++++++++++++++++++ tests/bits/petsc_23.cc | 93 ++++++++++++++++++++++++++++ tests/bits/petsc_24.cc | 83 +++++++++++++++++++++++++ tests/bits/petsc_25.cc | 83 +++++++++++++++++++++++++ tests/bits/petsc_26.cc | 82 +++++++++++++++++++++++++ tests/bits/petsc_27.cc | 86 ++++++++++++++++++++++++++ tests/bits/petsc_28.cc | 88 +++++++++++++++++++++++++++ tests/bits/petsc_29.cc | 74 +++++++++++++++++++++++ tests/bits/petsc_30.cc | 82 +++++++++++++++++++++++++ tests/bits/petsc_31.cc | 83 +++++++++++++++++++++++++ tests/bits/petsc_32.cc | 83 +++++++++++++++++++++++++ tests/bits/petsc_33.cc | 84 ++++++++++++++++++++++++++ tests/bits/petsc_34.cc | 85 ++++++++++++++++++++++++++ tests/bits/petsc_35.cc | 102 +++++++++++++++++++++++++++++++ tests/bits/petsc_36.cc | 102 +++++++++++++++++++++++++++++++ tests/bits/petsc_37.cc | 81 +++++++++++++++++++++++++ tests/bits/petsc_38.cc | 90 ++++++++++++++++++++++++++++ tests/bits/petsc_39.cc | 90 ++++++++++++++++++++++++++++ tests/bits/petsc_40.cc | 95 +++++++++++++++++++++++++++++ tests/bits/petsc_41.cc | 90 ++++++++++++++++++++++++++++ tests/bits/petsc_42.cc | 90 ++++++++++++++++++++++++++++ tests/bits/petsc_43.cc | 95 +++++++++++++++++++++++++++++ tests/bits/petsc_44.cc | 100 +++++++++++++++++++++++++++++++ tests/bits/petsc_45.cc | 90 ++++++++++++++++++++++++++++ tests/bits/petsc_46.cc | 90 ++++++++++++++++++++++++++++ tests/bits/petsc_47.cc | 95 +++++++++++++++++++++++++++++ tests/bits/petsc_48.cc | 96 +++++++++++++++++++++++++++++ tests/bits/sparse_matrix_03a.cc | 103 ++++++++++++++++++++++++++++++++ tests/bits/sparse_matrix_03b.cc | 103 ++++++++++++++++++++++++++++++++ tests/bits/vector_11.cc | 73 ++++++++++++++++++++++ tests/bits/vector_12.cc | 86 ++++++++++++++++++++++++++ tests/bits/vector_13.cc | 86 ++++++++++++++++++++++++++ tests/bits/vector_14.cc | 92 ++++++++++++++++++++++++++++ tests/bits/vector_15.cc | 89 +++++++++++++++++++++++++++ tests/bits/vector_16.cc | 91 ++++++++++++++++++++++++++++ tests/bits/vector_17.cc | 78 ++++++++++++++++++++++++ tests/bits/vector_18.cc | 78 ++++++++++++++++++++++++ tests/bits/vector_19.cc | 78 ++++++++++++++++++++++++ tests/bits/vector_20.cc | 87 +++++++++++++++++++++++++++ tests/bits/vector_21.cc | 87 +++++++++++++++++++++++++++ tests/bits/vector_22.cc | 82 +++++++++++++++++++++++++ tests/bits/vector_23.cc | 89 +++++++++++++++++++++++++++ tests/bits/vector_24.cc | 79 ++++++++++++++++++++++++ tests/bits/vector_25.cc | 77 ++++++++++++++++++++++++ tests/bits/vector_26.cc | 76 +++++++++++++++++++++++ tests/bits/vector_27.cc | 82 +++++++++++++++++++++++++ tests/bits/vector_28.cc | 84 ++++++++++++++++++++++++++ tests/bits/vector_29.cc | 70 ++++++++++++++++++++++ tests/bits/vector_30.cc | 78 ++++++++++++++++++++++++ tests/bits/vector_31.cc | 79 ++++++++++++++++++++++++ tests/bits/vector_32.cc | 79 ++++++++++++++++++++++++ tests/bits/vector_33.cc | 80 +++++++++++++++++++++++++ tests/bits/vector_34.cc | 81 +++++++++++++++++++++++++ tests/bits/vector_35.cc | 98 ++++++++++++++++++++++++++++++ tests/bits/vector_36.cc | 98 ++++++++++++++++++++++++++++++ tests/bits/vector_37.cc | 77 ++++++++++++++++++++++++ tests/bits/vector_38.cc | 86 ++++++++++++++++++++++++++ tests/bits/vector_39.cc | 86 ++++++++++++++++++++++++++ tests/bits/vector_40.cc | 91 ++++++++++++++++++++++++++++ tests/bits/vector_41.cc | 86 ++++++++++++++++++++++++++ tests/bits/vector_42.cc | 86 ++++++++++++++++++++++++++ tests/bits/vector_43.cc | 91 ++++++++++++++++++++++++++++ tests/bits/vector_44.cc | 96 +++++++++++++++++++++++++++++ tests/bits/vector_45.cc | 86 ++++++++++++++++++++++++++ tests/bits/vector_46.cc | 86 ++++++++++++++++++++++++++ tests/bits/vector_47.cc | 91 ++++++++++++++++++++++++++++ tests/bits/vector_48.cc | 92 ++++++++++++++++++++++++++++ 73 files changed, 6244 insertions(+) create mode 100644 tests/bits/petsc_17.cc create mode 100644 tests/bits/petsc_18.cc create mode 100644 tests/bits/petsc_19.cc create mode 100644 tests/bits/petsc_20.cc create mode 100644 tests/bits/petsc_21.cc create mode 100644 tests/bits/petsc_22.cc create mode 100644 tests/bits/petsc_23.cc create mode 100644 tests/bits/petsc_24.cc create mode 100644 tests/bits/petsc_25.cc create mode 100644 tests/bits/petsc_26.cc create mode 100644 tests/bits/petsc_27.cc create mode 100644 tests/bits/petsc_28.cc create mode 100644 tests/bits/petsc_29.cc create mode 100644 tests/bits/petsc_30.cc create mode 100644 tests/bits/petsc_31.cc create mode 100644 tests/bits/petsc_32.cc create mode 100644 tests/bits/petsc_33.cc create mode 100644 tests/bits/petsc_34.cc create mode 100644 tests/bits/petsc_35.cc create mode 100644 tests/bits/petsc_36.cc create mode 100644 tests/bits/petsc_37.cc create mode 100644 tests/bits/petsc_38.cc create mode 100644 tests/bits/petsc_39.cc create mode 100644 tests/bits/petsc_40.cc create mode 100644 tests/bits/petsc_41.cc create mode 100644 tests/bits/petsc_42.cc create mode 100644 tests/bits/petsc_43.cc create mode 100644 tests/bits/petsc_44.cc create mode 100644 tests/bits/petsc_45.cc create mode 100644 tests/bits/petsc_46.cc create mode 100644 tests/bits/petsc_47.cc create mode 100644 tests/bits/petsc_48.cc create mode 100644 tests/bits/sparse_matrix_03a.cc create mode 100644 tests/bits/sparse_matrix_03b.cc create mode 100644 tests/bits/vector_11.cc create mode 100644 tests/bits/vector_12.cc create mode 100644 tests/bits/vector_13.cc create mode 100644 tests/bits/vector_14.cc create mode 100644 tests/bits/vector_15.cc create mode 100644 tests/bits/vector_16.cc create mode 100644 tests/bits/vector_17.cc create mode 100644 tests/bits/vector_18.cc create mode 100644 tests/bits/vector_19.cc create mode 100644 tests/bits/vector_20.cc create mode 100644 tests/bits/vector_21.cc create mode 100644 tests/bits/vector_22.cc create mode 100644 tests/bits/vector_23.cc create mode 100644 tests/bits/vector_24.cc create mode 100644 tests/bits/vector_25.cc create mode 100644 tests/bits/vector_26.cc create mode 100644 tests/bits/vector_27.cc create mode 100644 tests/bits/vector_28.cc create mode 100644 tests/bits/vector_29.cc create mode 100644 tests/bits/vector_30.cc create mode 100644 tests/bits/vector_31.cc create mode 100644 tests/bits/vector_32.cc create mode 100644 tests/bits/vector_33.cc create mode 100644 tests/bits/vector_34.cc create mode 100644 tests/bits/vector_35.cc create mode 100644 tests/bits/vector_36.cc create mode 100644 tests/bits/vector_37.cc create mode 100644 tests/bits/vector_38.cc create mode 100644 tests/bits/vector_39.cc create mode 100644 tests/bits/vector_40.cc create mode 100644 tests/bits/vector_41.cc create mode 100644 tests/bits/vector_42.cc create mode 100644 tests/bits/vector_43.cc create mode 100644 tests/bits/vector_44.cc create mode 100644 tests/bits/vector_45.cc create mode 100644 tests/bits/vector_46.cc create mode 100644 tests/bits/vector_47.cc create mode 100644 tests/bits/vector_48.cc diff --git a/tests/bits/petsc_03a.cc b/tests/bits/petsc_03a.cc index acc9649b60..770d55b3d6 100644 --- a/tests/bits/petsc_03a.cc +++ b/tests/bits/petsc_03a.cc @@ -32,6 +32,7 @@ void test (petsc_wrappers::SparseMatrix &m) for (unsigned int j=0; j +#include +#include +#include + + +void test (petsc_wrappers::Vector &v) +{ + // set some elements of the vector + double norm = 0; + for (unsigned int i=0; i +#include +#include +#include + + +void test (petsc_wrappers::Vector &v) +{ + // set some elements of the vector + double norm = 0; + for (unsigned int i=0; i +#include +#include +#include + + +void test (petsc_wrappers::Vector &v) +{ + // set some elements of the vector + double norm = 0; + for (unsigned int i=0; i +#include +#include +#include + + +void test (petsc_wrappers::Vector &v) +{ + // set only certain elements of the + // vector. have a bit pattern of where we + // actually wrote elements to + std::vector pattern (v.size(), false); + for (unsigned int i=0; i +#include +#include +#include + + +void test (petsc_wrappers::Vector &v) +{ + // set only certain elements of the + // vector. have a bit pattern of where we + // actually wrote elements to + std::vector pattern (v.size(), false); + for (unsigned int i=0; i +#include +#include +#include + + +void test (petsc_wrappers::Vector &v, + petsc_wrappers::Vector &w) +{ + // set only certain elements of each + // vector, but disjoint sets of elements + for (unsigned int i=0; i +#include +#include +#include + + +void test (petsc_wrappers::Vector &v, + petsc_wrappers::Vector &w) +{ + // set only certain elements of each + // vector, and record the expected scalar + // product + double product = 0; + for (unsigned int i=0; i +#include +#include +#include + + +void test (petsc_wrappers::Vector &v) +{ + // set some entries of the vector + for (unsigned int i=0; i +#include +#include +#include + + +void test (petsc_wrappers::Vector &v) +{ + // set some entries of the vector + for (unsigned int i=0; i +#include +#include +#include + + +void test (petsc_wrappers::Vector &v) +{ + // set some entries of the vector + for (unsigned int i=0; i +#include +#include +#include + + +void test (petsc_wrappers::Vector &v) +{ + // set some entries of the vector + for (unsigned int i=0; i +#include +#include +#include + + +void test (petsc_wrappers::Vector &v) +{ + // set some entries of the vector + for (unsigned int i=0; i +#include +#include +#include + + +void test (petsc_wrappers::Vector &v) +{ + v.reinit (13, true); + + Assert (v.size() == 13, ExcInternalError()); + + deallog << "OK" << std::endl; +} + + + +int main (int argc,char **argv) +{ + std::ofstream logfile("petsc_29.output"); + deallog.attach(logfile); + deallog.depth_console(0); + + try + { + PetscInitialize(&argc,&argv,0,0); + { + petsc_wrappers::Vector v (100); + test (v); + } + PetscFinalize(); + } + 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/petsc_30.cc b/tests/bits/petsc_30.cc new file mode 100644 index 0000000000..883d60edcc --- /dev/null +++ b/tests/bits/petsc_30.cc @@ -0,0 +1,82 @@ +//---------------------------- petsc_30.cc --------------------------- +// petsc_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. +// +//---------------------------- petsc_30.cc --------------------------- + + +// check petsc_wrapper::Vector::reinit(!fast) + +#include "../tests.h" +#include +#include +#include +#include + + +void test (petsc_wrappers::Vector &v) +{ + // set some entries of the vector + for (unsigned int i=0; i +#include +#include +#include + + +void test (petsc_wrappers::Vector &v) +{ + // set some elements of the vector + double norm = 0; + for (unsigned int i=0; i +#include +#include +#include + + +void test (petsc_wrappers::Vector &v) +{ + // set some elements of the vector + double sum = 0; + for (unsigned int i=0; i +#include +#include +#include + + +void test (petsc_wrappers::Vector &v) +{ + // set some elements of the vector + double sum = 0; + for (unsigned int i=0; i +#include +#include +#include + + +void test (petsc_wrappers::Vector &v) +{ + // set some elements of the vector + double sum = 0; + for (unsigned int i=0; i +#include +#include +#include + + +void test (petsc_wrappers::Vector &v, + petsc_wrappers::Vector &w) +{ + // set only certain elements of each + // vector + for (unsigned int i=0; i +#include +#include +#include + + +void test (petsc_wrappers::Vector &v, + petsc_wrappers::Vector &w) +{ + // set only certain elements of each + // vector + for (unsigned int i=0; i +#include +#include +#include + + +void test (petsc_wrappers::Vector &v) +{ + for (unsigned int i=0; i +#include +#include +#include + + +void test (petsc_wrappers::Vector &v, + petsc_wrappers::Vector &w) +{ + for (unsigned int i=0; i +#include +#include +#include + + +void test (petsc_wrappers::Vector &v, + petsc_wrappers::Vector &w) +{ + for (unsigned int i=0; i +#include +#include +#include + + +void test (petsc_wrappers::Vector &v, + petsc_wrappers::Vector &w, + petsc_wrappers::Vector &x) +{ + for (unsigned int i=0; i +#include +#include +#include + + +void test (petsc_wrappers::Vector &v, + petsc_wrappers::Vector &w) +{ + for (unsigned int i=0; i +#include +#include +#include + + +void test (petsc_wrappers::Vector &v, + petsc_wrappers::Vector &w) +{ + for (unsigned int i=0; i +#include +#include +#include + + +void test (petsc_wrappers::Vector &v, + petsc_wrappers::Vector &w, + petsc_wrappers::Vector &x) +{ + for (unsigned int i=0; i +#include +#include +#include + + +void test (petsc_wrappers::Vector &v, + petsc_wrappers::Vector &w, + petsc_wrappers::Vector &x, + petsc_wrappers::Vector &y) +{ + for (unsigned int i=0; i +#include +#include +#include + + +void test (petsc_wrappers::Vector &v, + petsc_wrappers::Vector &w) +{ + for (unsigned int i=0; i +#include +#include +#include + + +void test (petsc_wrappers::Vector &v, + petsc_wrappers::Vector &w) +{ + for (unsigned int i=0; i +#include +#include +#include + + +void test (petsc_wrappers::Vector &v, + petsc_wrappers::Vector &w, + petsc_wrappers::Vector &x) +{ + for (unsigned int i=0; i +#include +#include +#include + + +void test (petsc_wrappers::Vector &v, + petsc_wrappers::Vector &w, + petsc_wrappers::Vector &x) +{ + for (unsigned int i=0; i +#include + + +void test () +{ + SparsityPattern sp (5,5,3); + for (unsigned int i=0; i<5; ++i) + for (unsigned int j=0; j<5; ++j) + if ((i+2*j+1) % 3 == 0) + sp.add (i,j); + sp.compress (); + + SparseMatrix m(sp); + + // first set a few entries + for (unsigned int i=0; i +#include + + +void test () +{ + SparsityPattern sp (5,5,3); + for (unsigned int i=0; i<5; ++i) + for (unsigned int j=0; j<5; ++j) + if ((i+2*j+1) % 3 == 0) + sp.add (i,j); + sp.compress (); + + SparseMatrix m(sp); + + // first set a few entries + for (unsigned int i=0; i::size() + +#include "../tests.h" +#include +#include +#include + + +void test (Vector &v) +{ + // set only certain elements of the vector + 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/vector_12.cc b/tests/bits/vector_12.cc new file mode 100644 index 0000000000..ac05ed91bc --- /dev/null +++ b/tests/bits/vector_12.cc @@ -0,0 +1,86 @@ +//---------------------------- vector_12.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. +// +//---------------------------- vector_12.cc --------------------------- + + +// check Vector::operator() in set-mode + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v) +{ + // set only certain elements of the + // vector. have a bit pattern of where we + // actually wrote elements to + std::vector pattern (v.size(), false); + 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/vector_13.cc b/tests/bits/vector_13.cc new file mode 100644 index 0000000000..0efed5102f --- /dev/null +++ b/tests/bits/vector_13.cc @@ -0,0 +1,86 @@ +//---------------------------- vector_13.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. +// +//---------------------------- vector_13.cc --------------------------- + + +// check Vector::operator() in add-mode + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v) +{ + // set only certain elements of the + // vector. have a bit pattern of where we + // actually wrote elements to + std::vector pattern (v.size(), false); + 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/vector_14.cc b/tests/bits/vector_14.cc new file mode 100644 index 0000000000..a7aa45af44 --- /dev/null +++ b/tests/bits/vector_14.cc @@ -0,0 +1,92 @@ +//---------------------------- vector_14.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. +// +//---------------------------- vector_14.cc --------------------------- + + +// check Vector::operator() in set/add-mode alternatingly + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v) +{ + // set only certain elements of the + // vector. have a bit pattern of where we + // actually wrote elements to + std::vector pattern (v.size(), false); + bool flag = false; + 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/vector_15.cc b/tests/bits/vector_15.cc new file mode 100644 index 0000000000..852a3bef3c --- /dev/null +++ b/tests/bits/vector_15.cc @@ -0,0 +1,89 @@ +//---------------------------- vector_15.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. +// +//---------------------------- vector_15.cc --------------------------- + + +// check Vector::operator() in set/add-mode alternatingly, but +// writing to the same elements + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v) +{ + // set only certain elements of the + // vector. have a bit pattern of where we + // actually wrote elements to + std::vector pattern (v.size(), false); + 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/vector_16.cc b/tests/bits/vector_16.cc new file mode 100644 index 0000000000..886f5b3155 --- /dev/null +++ b/tests/bits/vector_16.cc @@ -0,0 +1,91 @@ +//---------------------------- vector_16.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. +// +//---------------------------- vector_16.cc --------------------------- + + +// check Vector::operator() in set/add-mode alternatingly, but +// writing and overwriting the same elements + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v) +{ + // set only certain elements of the + // vector. have a bit pattern of where we + // actually wrote elements to + std::vector pattern (v.size(), false); + 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/vector_17.cc b/tests/bits/vector_17.cc new file mode 100644 index 0000000000..2990fd4d69 --- /dev/null +++ b/tests/bits/vector_17.cc @@ -0,0 +1,78 @@ +//---------------------------- vector_17.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. +// +//---------------------------- vector_17.cc --------------------------- + + +// check Vector::l1_norm() + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v) +{ + // set some elements of the vector + double norm = 0; + 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/vector_18.cc b/tests/bits/vector_18.cc new file mode 100644 index 0000000000..bf22c28b4e --- /dev/null +++ b/tests/bits/vector_18.cc @@ -0,0 +1,78 @@ +//---------------------------- vector_18.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. +// +//---------------------------- vector_18.cc --------------------------- + + +// check Vector::l2_norm() + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v) +{ + // set some elements of the vector + double norm = 0; + 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/vector_19.cc b/tests/bits/vector_19.cc new file mode 100644 index 0000000000..4daaac5258 --- /dev/null +++ b/tests/bits/vector_19.cc @@ -0,0 +1,78 @@ +//---------------------------- vector_19.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. +// +//---------------------------- vector_19.cc --------------------------- + + +// check Vector::linfty_norm() + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v) +{ + // set some elements of the vector + double norm = 0; + 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/vector_20.cc b/tests/bits/vector_20.cc new file mode 100644 index 0000000000..9feab0c445 --- /dev/null +++ b/tests/bits/vector_20.cc @@ -0,0 +1,87 @@ +//---------------------------- vector_20.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. +// +//---------------------------- vector_20.cc --------------------------- + + +// check Vector::operator *= + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v) +{ + // set only certain elements of the + // vector. have a bit pattern of where we + // actually wrote elements to + std::vector pattern (v.size(), false); + 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/vector_21.cc b/tests/bits/vector_21.cc new file mode 100644 index 0000000000..e16972381d --- /dev/null +++ b/tests/bits/vector_21.cc @@ -0,0 +1,87 @@ +//---------------------------- vector_21.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. +// +//---------------------------- vector_21.cc --------------------------- + + +// check Vector::operator /= + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v) +{ + // set only certain elements of the + // vector. have a bit pattern of where we + // actually wrote elements to + std::vector pattern (v.size(), false); + 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/vector_22.cc b/tests/bits/vector_22.cc new file mode 100644 index 0000000000..bc92ef2759 --- /dev/null +++ b/tests/bits/vector_22.cc @@ -0,0 +1,82 @@ +//---------------------------- vector_22.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. +// +//---------------------------- vector_22.cc --------------------------- + + +// check Vector::operator*(Vector) on two vectors that are +// orthogonal + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v, + Vector &w) +{ + // set only certain elements of each + // vector, but disjoint sets of elements + 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/vector_23.cc b/tests/bits/vector_23.cc new file mode 100644 index 0000000000..96ff0103ea --- /dev/null +++ b/tests/bits/vector_23.cc @@ -0,0 +1,89 @@ +//---------------------------- vector_23.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. +// +//---------------------------- vector_23.cc --------------------------- + + +// check Vector::operator*(Vector) on two vectors that are +// not orthogonal + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v, + Vector &w) +{ + // set only certain elements of each + // vector, and record the expected scalar + // product + double product = 0; + 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/vector_24.cc b/tests/bits/vector_24.cc new file mode 100644 index 0000000000..19bee2412a --- /dev/null +++ b/tests/bits/vector_24.cc @@ -0,0 +1,79 @@ +//---------------------------- vector_24.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. +// +//---------------------------- vector_24.cc --------------------------- + + +// check Vector::clear() + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v) +{ + // set some entries of the vector + 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/vector_25.cc b/tests/bits/vector_25.cc new file mode 100644 index 0000000000..53cd8ee09b --- /dev/null +++ b/tests/bits/vector_25.cc @@ -0,0 +1,77 @@ +//---------------------------- vector_25.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. +// +//---------------------------- vector_25.cc --------------------------- + +// check Vector::operator = (Scalar) with setting to zero + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v) +{ + // set some entries of the vector + 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/vector_26.cc b/tests/bits/vector_26.cc new file mode 100644 index 0000000000..49dad76336 --- /dev/null +++ b/tests/bits/vector_26.cc @@ -0,0 +1,76 @@ +//---------------------------- vector_26.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. +// +//---------------------------- vector_26.cc --------------------------- + +// check Vector::operator = (scalar) with setting to a +// nonzero value + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v) +{ + // set some entries of the vector + 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/vector_27.cc b/tests/bits/vector_27.cc new file mode 100644 index 0000000000..8cf9ef3d79 --- /dev/null +++ b/tests/bits/vector_27.cc @@ -0,0 +1,82 @@ +//---------------------------- vector_27.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. +// +//---------------------------- vector_27.cc --------------------------- + + +// check Vector::operator = (Vector) + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v) +{ + // set some entries of the vector + for (unsigned int i=0; i w (v.size()); + w = v; + + // make sure they're equal + deallog << v*w << ' ' << v.l2_norm() * w.l2_norm() + << ' ' << v*w - v.l2_norm() * w.l2_norm() << std::endl; + Assert (std::fabs(v*w - v.l2_norm() * w.l2_norm()) < 1e-14*(v*w), + ExcInternalError()); + + deallog << "OK" << std::endl; +} + + + +int main () +{ + std::ofstream logfile("vector_27.output"); + deallog.attach(logfile); + deallog.depth_console(0); + + try + { + Vector 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/vector_28.cc b/tests/bits/vector_28.cc new file mode 100644 index 0000000000..4f3ae5c952 --- /dev/null +++ b/tests/bits/vector_28.cc @@ -0,0 +1,84 @@ +//---------------------------- vector_28.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. +// +//---------------------------- vector_28.cc --------------------------- + + +// check Vector::operator = (Vector), except that we don't +// resize the vector to be copied to beforehand + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v) +{ + // set some entries of the vector + for (unsigned int i=0; i w (1); + w = v; + + // make sure they're equal + deallog << v*w << ' ' << v.l2_norm() * w.l2_norm() + << ' ' << v*w - v.l2_norm() * w.l2_norm() << std::endl; + Assert (std::fabs(v*w - v.l2_norm() * w.l2_norm()) < 1e-14*(v*w), + ExcInternalError()); + + deallog << "OK" << std::endl; +} + + + +int main () +{ + std::ofstream logfile("vector_28.output"); + deallog.attach(logfile); + deallog.depth_console(0); + + try + { + Vector 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/vector_29.cc b/tests/bits/vector_29.cc new file mode 100644 index 0000000000..948cef46d8 --- /dev/null +++ b/tests/bits/vector_29.cc @@ -0,0 +1,70 @@ +//---------------------------- vector_29.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. +// +//---------------------------- vector_29.cc --------------------------- + + +// check Vector::reinit(fast) + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v) +{ + v.reinit (13, true); + + Assert (v.size() == 13, ExcInternalError()); + + deallog << "OK" << std::endl; +} + + + +int main () +{ + std::ofstream logfile("vector_29.output"); + deallog.attach(logfile); + deallog.depth_console(0); + + try + { + Vector 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/vector_30.cc b/tests/bits/vector_30.cc new file mode 100644 index 0000000000..449f82b7b7 --- /dev/null +++ b/tests/bits/vector_30.cc @@ -0,0 +1,78 @@ +//---------------------------- vector_30.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. +// +//---------------------------- vector_30.cc --------------------------- + + +// check Vector::reinit(!fast) + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v) +{ + // set some entries of the vector + 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/vector_31.cc b/tests/bits/vector_31.cc new file mode 100644 index 0000000000..cb654be75c --- /dev/null +++ b/tests/bits/vector_31.cc @@ -0,0 +1,79 @@ +//---------------------------- vector_31.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. +// +//---------------------------- vector_31.cc --------------------------- + + +// check Vector::l2_norm() + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v) +{ + // set some elements of the vector + double norm = 0; + 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/vector_32.cc b/tests/bits/vector_32.cc new file mode 100644 index 0000000000..418fbd9c52 --- /dev/null +++ b/tests/bits/vector_32.cc @@ -0,0 +1,79 @@ +//---------------------------- vector_32.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. +// +//---------------------------- vector_32.cc --------------------------- + + +// check Vector::l2_norm() + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v) +{ + // set some elements of the vector + double sum = 0; + 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/vector_33.cc b/tests/bits/vector_33.cc new file mode 100644 index 0000000000..d605f112e5 --- /dev/null +++ b/tests/bits/vector_33.cc @@ -0,0 +1,80 @@ +//---------------------------- vector_33.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. +// +//---------------------------- vector_33.cc --------------------------- + + +// check Vector::lp_norm(3) + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v) +{ + // set some elements of the vector + double sum = 0; + 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/vector_34.cc b/tests/bits/vector_34.cc new file mode 100644 index 0000000000..41b4cde9cb --- /dev/null +++ b/tests/bits/vector_34.cc @@ -0,0 +1,81 @@ +//---------------------------- vector_34.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. +// +//---------------------------- vector_34.cc --------------------------- + + +// check Vector::all_zero + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v) +{ + // set some elements of the vector + double sum = 0; + 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/vector_35.cc b/tests/bits/vector_35.cc new file mode 100644 index 0000000000..188e63357a --- /dev/null +++ b/tests/bits/vector_35.cc @@ -0,0 +1,98 @@ +//---------------------------- vector_35.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. +// +//---------------------------- vector_35.cc --------------------------- + + +// check Vector::operator+=(Vector) + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v, + Vector &w) +{ + // set only certain elements of each + // vector + 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/vector_36.cc b/tests/bits/vector_36.cc new file mode 100644 index 0000000000..649dd8cc36 --- /dev/null +++ b/tests/bits/vector_36.cc @@ -0,0 +1,98 @@ +//---------------------------- vector_36.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. +// +//---------------------------- vector_36.cc --------------------------- + + +// check Vector::operator-=(Vector) + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v, + Vector &w) +{ + // set only certain elements of each + // vector + 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/vector_37.cc b/tests/bits/vector_37.cc new file mode 100644 index 0000000000..8332e9adba --- /dev/null +++ b/tests/bits/vector_37.cc @@ -0,0 +1,77 @@ +//---------------------------- vector_37.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. +// +//---------------------------- vector_37.cc --------------------------- + + +// check Vector::add (scalar) + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v) +{ + 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/vector_38.cc b/tests/bits/vector_38.cc new file mode 100644 index 0000000000..af3d9f2c42 --- /dev/null +++ b/tests/bits/vector_38.cc @@ -0,0 +1,86 @@ +//---------------------------- vector_38.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. +// +//---------------------------- vector_38.cc --------------------------- + + +// check Vector::add(Vector) + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v, + Vector &w) +{ + 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/vector_39.cc b/tests/bits/vector_39.cc new file mode 100644 index 0000000000..e1345b0519 --- /dev/null +++ b/tests/bits/vector_39.cc @@ -0,0 +1,86 @@ +//---------------------------- vector_39.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. +// +//---------------------------- vector_39.cc --------------------------- + + +// check Vector::add(scalar, Vector) + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v, + Vector &w) +{ + 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/vector_40.cc b/tests/bits/vector_40.cc new file mode 100644 index 0000000000..d978c907e6 --- /dev/null +++ b/tests/bits/vector_40.cc @@ -0,0 +1,91 @@ +//---------------------------- vector_40.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. +// +//---------------------------- vector_40.cc --------------------------- + + +// check Vector::add(s,V,s,V) + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v, + Vector &w, + Vector &x) +{ + 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/bits/vector_41.cc b/tests/bits/vector_41.cc new file mode 100644 index 0000000000..ae5e38f92f --- /dev/null +++ b/tests/bits/vector_41.cc @@ -0,0 +1,86 @@ +//---------------------------- vector_41.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. +// +//---------------------------- vector_41.cc --------------------------- + + +// check Vector::sadd(s, Vector) + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v, + Vector &w) +{ + 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/vector_42.cc b/tests/bits/vector_42.cc new file mode 100644 index 0000000000..30ef15cd70 --- /dev/null +++ b/tests/bits/vector_42.cc @@ -0,0 +1,86 @@ +//---------------------------- vector_42.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. +// +//---------------------------- vector_42.cc --------------------------- + + +// check Vector::sadd(scalar, scalar, Vector) + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v, + Vector &w) +{ + 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/vector_43.cc b/tests/bits/vector_43.cc new file mode 100644 index 0000000000..16b51c15dd --- /dev/null +++ b/tests/bits/vector_43.cc @@ -0,0 +1,91 @@ +//---------------------------- vector_43.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. +// +//---------------------------- vector_43.cc --------------------------- + + +// check Vector::sadd(s,s,V,s,V) + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v, + Vector &w, + Vector &x) +{ + 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/bits/vector_44.cc b/tests/bits/vector_44.cc new file mode 100644 index 0000000000..afb7c15627 --- /dev/null +++ b/tests/bits/vector_44.cc @@ -0,0 +1,96 @@ +//---------------------------- vector_44.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. +// +//---------------------------- vector_44.cc --------------------------- + + +// check Vector::sadd(s,s,V,s,V,s,V) + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v, + Vector &w, + Vector &x, + Vector &y) +{ + for (unsigned int i=0; i v (100); + Vector w (100); + Vector x (100); + Vector y (100); + test (v,w,x,y); + } + 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/vector_45.cc b/tests/bits/vector_45.cc new file mode 100644 index 0000000000..892ddb9553 --- /dev/null +++ b/tests/bits/vector_45.cc @@ -0,0 +1,86 @@ +//---------------------------- vector_45.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. +// +//---------------------------- vector_45.cc --------------------------- + + +// check Vector::scale + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v, + Vector &w) +{ + 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/vector_46.cc b/tests/bits/vector_46.cc new file mode 100644 index 0000000000..4a6b5ca2e0 --- /dev/null +++ b/tests/bits/vector_46.cc @@ -0,0 +1,86 @@ +//---------------------------- vector_46.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. +// +//---------------------------- vector_46.cc --------------------------- + + +// check Vector::equ (s,V) + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v, + Vector &w) +{ + 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/vector_47.cc b/tests/bits/vector_47.cc new file mode 100644 index 0000000000..516b204638 --- /dev/null +++ b/tests/bits/vector_47.cc @@ -0,0 +1,91 @@ +//---------------------------- vector_47.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. +// +//---------------------------- vector_47.cc --------------------------- + + +// check Vector::equ (s,V,s,V) + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v, + Vector &w, + Vector &x) +{ + 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/bits/vector_48.cc b/tests/bits/vector_48.cc new file mode 100644 index 0000000000..bed090bac9 --- /dev/null +++ b/tests/bits/vector_48.cc @@ -0,0 +1,92 @@ +//---------------------------- vector_48.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. +// +//---------------------------- vector_48.cc --------------------------- + + +// check Vector::ratio + +#include "../tests.h" +#include +#include +#include +#include + + +void test (Vector &v, + Vector &w, + Vector &x) +{ + 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; + }; +} -- 2.39.5