25
25
#include "rheolef/array.h" // for is_container_of_mpi_datatype ; TODO: move
27
27
#include <boost/serialization/set.hpp>
28
#include <boost/serialization/base_object.hpp>
28
30
#include <boost/serialization/list.hpp>
29
31
#include <boost/serialization/string.hpp>
30
32
#include <boost/serialization/version.hpp>
31
33
#include <boost/serialization/split_free.hpp>
32
34
#include <boost/serialization/split_member.hpp>
35
38
namespace rheolef {
49
class index_set : public std::set<size_t> {
52
class index_set : public std::set<std::size_t> {
54
typedef size_t size_type;
55
typedef size_type value_type;
56
typedef std::set<size_type> base;
57
typedef std::set<std::size_t> base;
58
typedef std::size_t value_type;
59
typedef std::size_t size_type;
62
65
index_set& operator= (const index_set& x);
64
67
index_set& operator= (size_type x[N]);
68
index_set& operator+= (size_type dis_i);
69
index_set& operator+= (const index_set& x);
72
void insert (size_type dis_i); // a := a union {dis_i}
73
index_set& operator+= (size_type dis_i); // idem
74
index_set& operator+= (const index_set& b); // a := a union b
77
void inplace_union (const index_set& b);
78
void inplace_intersection (const index_set& b);
81
friend void set_union (const index_set& a, const index_set& b, index_set& c);
82
friend void set_intersection (const index_set& a, const index_set& b, index_set& c);
73
86
friend std::istream& operator>> (std::istream& is, index_set& x);
74
87
friend std::ostream& operator<< (std::ostream& os, const index_set& x);
78
91
template <class Archive>
79
92
void serialize (Archive& ar, const unsigned int version);
82
// for array<index_set> and mpi:
96
// for boost mpi and array<index_set>:
84
98
struct is_container_of_mpi_datatype<index_set> : boost::mpl::true_ {
85
99
typedef boost::mpl::true_ type;
87
102
// operator += for array::assembly
88
103
template <class T1, class T2>
89
104
struct index_set_add_op : std::binary_function<T1,T2,T1> {