38namespace Gecode {
namespace Set {
41 template<
class Char,
class Traits,
class I>
46 if (
r.min() ==
r.max()) {
48 }
else if (
r.min()+1 ==
r.max()) {
49 s <<
r.min() <<
"," <<
r.max();
51 s <<
r.min() <<
".." <<
r.max();
61 template<
class Char,
class Traits,
class IL,
class IU>
63 print(std::basic_ostream<Char,Traits>& s,
bool assigned, IL& lb, IU& ub,
64 unsigned int cardMin,
unsigned int cardMax) {
71 if (cardMin==cardMax) {
72 s <<
"#(" << cardMin <<
")";
74 s <<
"#(" << cardMin <<
"," << cardMax <<
")";
79 template<
class Char,
class Traits>
80 std::basic_ostream<Char,Traits>&
82 std::basic_ostringstream<Char,Traits> s;
83 s.copyfmt(os); s.width(0);
90 template<
class Char,
class Traits>
91 inline std::basic_ostream<Char,Traits>&
96 template<
class Char,
class Traits>
97 std::basic_ostream<Char,Traits>&
98 operator <<(std::basic_ostream<Char,Traits>& os,
const UniverseView&) {
99 std::basic_ostringstream<Char,Traits> s;
100 s.copyfmt(os); s.width(0);
104 return os << s.str();
107 template<
class Char,
class Traits>
108 std::basic_ostream<Char,Traits>&
109 operator <<(std::basic_ostream<Char,Traits>& os,
const ConstSetView&
x) {
110 std::basic_ostringstream<Char,Traits> s;
111 s.copyfmt(os); s.width(0);
112 LubRanges<ConstSetView> ub(
x);
115 return os << s.str();
118 template<
class Char,
class Traits>
119 std::basic_ostream<Char,Traits>&
120 operator <<(std::basic_ostream<Char,Traits>& os,
const SingletonView&
x) {
121 std::basic_ostringstream<Char,Traits> s;
122 s.copyfmt(os); s.width(0);
124 s <<
"{" <<
x.
glbMin() <<
"}#(1)";
126 LubRanges<SingletonView> ub(
x);
131 return os << s.str();
unsigned int cardMax(void) const
Return cardinality maximum.
int glbMin(void) const
Return minimum element of greatest lower bound.
unsigned int cardMin(void) const
Return cardinality minimum.
Constant view for the empty set.
Range iterator for the greatest lower bound.
Range iterator for the least upper bound.
Set view for set variables
bool assigned(void) const
Test whether view is assigned.
std::basic_ostream< Char, Traits > & operator<<(std::basic_ostream< Char, Traits > &os, const IdxViewArray< View > &x)
const int min
Smallest allowed integer in integer set.
const unsigned int card
Maximum cardinality of an integer set.
const int max
Largest allowed integer in integer set.
void printBound(std::basic_ostream< Char, Traits > &s, I &r)
Print bound of a set view or variable.
void print(std::basic_ostream< Char, Traits > &s, bool assigned, IL &lb, IU &ub, unsigned int cardMin, unsigned int cardMax)
Print set view.
Gecode toplevel namespace
Post propagator for SetVar SetOpType SetVar SetRelType r
Post propagator for SetVar x