From 2ea76a53af6748eb408ca4f78177299443445955 Mon Sep 17 00:00:00 2001 From: bangerth Date: Thu, 15 Oct 2009 22:57:57 +0000 Subject: [PATCH] Implement indexing also for non-contiguous ranges. git-svn-id: https://svn.dealii.org/trunk@19898 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/base/index_set_10.cc | 2 +- tests/base/index_set_12.cc | 66 +++++++++++++++++++++++++++++ tests/base/index_set_12/cmp/generic | 14 ++++++ 3 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 tests/base/index_set_12.cc create mode 100644 tests/base/index_set_12/cmp/generic diff --git a/tests/base/index_set_10.cc b/tests/base/index_set_10.cc index 7c41499cdc..ea9279d515 100644 --- a/tests/base/index_set_10.cc +++ b/tests/base/index_set_10.cc @@ -11,7 +11,7 @@ // //----------------------------------------------------------------------------- -// test indexing in IndexSet variables +// test indexing in IndexSet variables for a contiguous range #include "../tests.h" #include diff --git a/tests/base/index_set_12.cc b/tests/base/index_set_12.cc new file mode 100644 index 0000000000..08ad27b543 --- /dev/null +++ b/tests/base/index_set_12.cc @@ -0,0 +1,66 @@ +//----------------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2009 by the deal.II authors +// +// 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. +// +//----------------------------------------------------------------------------- + +// test indexing in IndexSet variables for a non-contiguous range + +#include "../tests.h" +#include +#include +#include +#include + +#include + + +void test () +{ + IndexSet index_set (20); + + index_set.add_index (2); + index_set.add_index (3); + index_set.add_index (4); + + index_set.add_index (6); + index_set.add_index (7); + + index_set.compress (); + + index_set.add_index (9); + + for (unsigned int i=0; i