From: Wolfgang Bangerth Date: Thu, 19 Nov 2009 04:25:56 +0000 (+0000) Subject: Another test. X-Git-Tag: v8.0.0~6798 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=73b8e65409c0546a2966952d50b28b9f7726a419;p=dealii.git Another test. git-svn-id: https://svn.dealii.org/trunk@20137 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/base/index_set_14.cc b/tests/base/index_set_14.cc new file mode 100644 index 0000000000..6df7c993de --- /dev/null +++ b/tests/base/index_set_14.cc @@ -0,0 +1,79 @@ +//----------------------------------------------------------------------------- +// $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 IndexSet::operator & + +#include "../tests.h" +#include +#include +#include +#include +#include + +#include + + +void test () +{ + IndexSet is1 (100); + IndexSet is2 (100); + + // randomly add 90 elements to each + // set, some of which may be + // repetitions of previous ones + for (unsigned int i=0; i<9*is1.size()/10; ++i) + { + is1.add_index (rand() % is1.size()); + is2.add_index (rand() % is2.size()); + } + + IndexSet is3 = is1 & is2; + + deallog << "Set sizes: " + << is1.n_elements() << ' ' + << is2.n_elements() << ' ' + << is3.n_elements() << std::endl; + + for (unsigned int i=0; i