60 unsigned int size = 0;
66 IntSet::IntSetObject* o = IntSet::IntSetObject::allocate(
n);
67 for (
int j=0; j<
n; j++)
112 int n = static_cast<int>(
r.size());
115 Range* dr = reg.
alloc<Range>(
n);
116 for (
int i=0;
i<
n;
i++)
117 dr[
i].
min=dr[
i].
max=
r[static_cast<unsigned int>(
i)];
130 int n = static_cast<int>(
r.size());
133 Range* dr = reg.
alloc<Range>(
n);
135 for (
int i=0;
i<
n;
i++)
136 if (
r[static_cast<unsigned int>(
i)].first <=
137 r[static_cast<unsigned int>(
i)].second) {
138 dr[j].min=
r[static_cast<unsigned int>(
i)].first;
139 dr[j].max=
r[static_cast<unsigned int>(
i)].second;
153 assert(
object() != NULL);
154 return static_cast<IntSetObject*>(
object())->r[
i].min;
159 assert(
object() != NULL);
160 return static_cast<IntSetObject*>(
object())->r[
i].max;
165 assert(
object() != NULL);
166 IntSetObject* o = static_cast<IntSetObject*>(
object());
167 return static_cast<unsigned int>(o->r[
i].max-o->r[
i].min)+1;
172 IntSetObject* o = static_cast<IntSetObject*>(
object());
173 return (o == NULL) ? 0 : o->n;
178 IntSetObject* o = static_cast<IntSetObject*>(
object());
179 if ((o == NULL) || (n < o->
r[0].
min) || (
n > o->r[o->n-1].max))
187 IntSetObject* o = static_cast<IntSetObject*>(
object());
193 IntSetObject* o = static_cast<IntSetObject*>(
object());
199 IntSetObject* o = static_cast<IntSetObject*>(
object());
200 return (o == NULL) ? 0U : o->size;
205 IntSetObject* o = static_cast<IntSetObject*>(
object());
206 return (o == NULL) ? 0U : static_cast<unsigned int>(
max()-
min()+1);
211 IntSetObject* o1 = static_cast<IntSetObject*>(
object());
212 IntSetObject* o2 = static_cast<IntSetObject*>(s.
object());
215 if ((o1 ==
nullptr) || (o2 ==
nullptr))
217 if ((o1->size != o2->size) || (o1->n != o2->n))
219 return o1->equal(*o2);
224 return !(*
this == s);
240 i = &static_cast<IntSet::IntSetObject*>(s.
object())->
r[0]; e = i+
n;
268 return static_cast<unsigned int>(i->max - i->min) + 1;
290 template<
class Char,
class Traits>
291 std::basic_ostream<Char,Traits>&
293 std::basic_ostringstream<Char,Traits> s;
294 s.copyfmt(os); s.width(0);
296 for (
int i = 0;
i < is.
ranges(); ) {
308 return os << s.str();