--- /dev/null
+//-----------------------------------------------------------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2010 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::n_intervals
+
+#include "../tests.h"
+#include <iomanip>
+#include <iomanip>
+#include <fstream>
+#include <cmath>
+#include <stdlib.h>
+
+#include <base/index_set.h>
+
+
+void test ()
+{
+ IndexSet is1 (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());
+ }
+
+ is1.compress();
+
+ deallog << "Number of intervals: "
+ << is1.n_intervals() << std::endl;
+
+ is1.print(deallog);
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+
+int main()
+{
+ std::ofstream logfile("index_set_17/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ test ();
+}
--- /dev/null
+
+DEAL::Number of intervals: 24
+DEAL::{[2,3], 5, 8, 11, [13,15], 19, [21,27], [29,30], [34,37], 40, [42,43], [45,46], [49,51], 54, [56,59], [62,64], [67,70], [72,73], [76,78], [80,84], [86,88], [90,93], [95,96], [98,99]}
+DEAL::OK
--- /dev/null
+//-----------------------------------------------------------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2010 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::get_view
+
+#include "../tests.h"
+#include <iomanip>
+#include <iomanip>
+#include <fstream>
+#include <cmath>
+#include <stdlib.h>
+
+#include <base/index_set.h>
+
+
+void test ()
+{
+ IndexSet is1 (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());
+
+ is1.compress();
+
+ IndexSet is2 = is1.get_view (20, 50);
+
+ deallog << "Original index set: " << std::endl;
+ is1.print(deallog);
+ deallog << "View of index set between 20 and 50: " << std::endl;
+ is2.print(deallog);
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+
+int main()
+{
+ std::ofstream logfile("index_set_18/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ test ();
+}
--- /dev/null
+
+DEAL::Original index set:
+DEAL::{[2,3], 5, 8, 11, [13,15], 19, [21,27], [29,30], [34,37], 40, [42,43], [45,46], [49,51], 54, [56,59], [62,64], [67,70], [72,73], [76,78], [80,84], [86,88], [90,93], [95,96], [98,99]}
+DEAL::View of index set between 20 and 50:
+DEAL::{[1,7], [9,10], [14,17], 20, [22,23], [25,26], 29}
+DEAL::OK
--- /dev/null
+//-----------------------------------------------------------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2010 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::fill_index_vector
+
+#include "../tests.h"
+#include <iomanip>
+#include <iomanip>
+#include <fstream>
+#include <cmath>
+#include <stdlib.h>
+
+#include <base/index_set.h>
+
+
+void test ()
+{
+ IndexSet is1 (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());
+
+ std::vector<unsigned int> indices;
+ is1.fill_index_vector (indices);
+
+ deallog << "Original index set: " << std::endl;
+ is1.print(deallog);
+
+ deallog << "List of indices: " << std::endl;
+ for (unsigned int i=0; i<indices.size(); i++)
+ deallog << indices[i] << ' ';
+ deallog << std::endl;
+
+ for (unsigned int i=0; i<indices.size(); i++)
+ Assert(is1.index_within_set(indices[i])==i, ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+
+int main()
+{
+ std::ofstream logfile("index_set_19/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ test ();
+}
--- /dev/null
+
+DEAL::Original index set:
+DEAL::{[2,3], 5, 8, 11, [13,15], 19, [21,27], [29,30], [34,37], 40, [42,43], [45,46], [49,51], 54, [56,59], [62,64], [67,70], [72,73], [76,78], [80,84], [86,88], [90,93], [95,96], [98,99]}
+DEAL::List of indices:
+DEAL::2 3 5 8 11 13 14 15 19 21 22 23 24 25 26 27 29 30 34 35 36 37 40 42 43 45 46 49 50 51 54 56 57 58 59 62 63 64 67 68 69 70 72 73 76 77 78 80 81 82 83 84 86 87 88 90 91 92 93 95 96 98 99
+DEAL::OK