~ubuntu-branches/ubuntu/trusty/rheolef/trusty

« back to all changes in this revision

Viewing changes to skit/plib2/index_set.h

  • Committer: Package Import Robot
  • Author(s): Pierre Saramito
  • Date: 2012-04-06 09:12:21 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20120406091221-m58me99p1nxqui49
Tags: 6.0-1
* New upstream release 6.0 (major changes):
  - massively distributed and parallel support
  - full FEM characteristic method (Lagrange-Gakerkin method) support
  - enhanced users documentation 
  - source code supports g++-4.7 (closes: #667356)
* debian/control: dependencies for MPI distributed solvers added
* debian/rules: build commands simplified
* debian/librheolef-dev.install: man1/* to man9/* added
* debian/changelog: package description rewritted (closes: #661689)

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include "rheolef/array.h" // for is_container_of_mpi_datatype ; TODO: move
26
26
 
27
27
#include <boost/serialization/set.hpp>
 
28
#include <boost/serialization/base_object.hpp>
 
29
#ifdef TO_CLEAN
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
#endif // TO_CLEAN
33
36
 
34
37
 
35
38
namespace rheolef {
46
49
End:
47
50
*/
48
51
//<verbatim:
49
 
class index_set : public std::set<size_t> {
 
52
class index_set : public std::set<std::size_t> {
50
53
public:
51
54
 
52
55
// typedefs:
53
56
 
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;
57
60
 
58
61
// allocators:
59
62
 
62
65
  index_set& operator= (const index_set& x);
63
66
  template <int N>
64
67
  index_set& operator= (size_type x[N]);
 
68
  void clear ();
65
69
 
66
70
// basic algebra:
67
71
 
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
 
75
 
 
76
  // a := a union b
 
77
  void inplace_union        (const index_set& b);
 
78
  void inplace_intersection (const index_set& b);
 
79
 
 
80
  // c := a union 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);
70
83
 
71
84
// io:
72
85
 
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);
75
88
 
76
 
// msg:
 
89
// boost mpi:
77
90
 
78
91
  template <class Archive>
79
92
  void serialize (Archive& ar, const unsigned int version);
80
93
};
81
94
//>verbatim:
82
 
// for array<index_set> and mpi:
 
95
 
 
96
// for boost mpi and array<index_set>:
83
97
template <>
84
98
struct is_container_of_mpi_datatype<index_set> : boost::mpl::true_ {
85
99
  typedef boost::mpl::true_ type;
86
100
};
 
101
 
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> {
111
126
  return *this;
112
127
}
113
128
inline
 
129
void
 
130
index_set::clear ()
 
131
{
 
132
  base::clear();
 
133
}
 
134
inline
 
135
void
 
136
index_set::insert (size_type dis_i)
 
137
{
 
138
  base::insert (dis_i);
 
139
}
 
140
inline
114
141
index_set&
115
142
index_set::operator+= (size_type dis_i)
116
143
{