* \brief %Set variables * * \ingroup TaskModelSetVars */
| 125 | * \ingroup TaskModelSetVars |
| 126 | */ |
| 127 | class SetVar : public VarImpVar<Set::SetVarImp> { |
| 128 | friend class SetVarArray; |
| 129 | friend class SetVarArgs; |
| 130 | using VarImpVar<Set::SetVarImp>::x; |
| 131 | public: |
| 132 | /// \name Constructors and initialization |
| 133 | //@{ |
| 134 | /// Default constructor |
| 135 | SetVar(void); |
| 136 | /// Initialize from set variable \a y |
| 137 | SetVar(const SetVar& y); |
| 138 | /// Initialize from set view \a y |
| 139 | SetVar(const Set::SetView& y); |
| 140 | |
| 141 | /// Initialize variable with empty greatest lower and full least upper bound |
| 142 | GECODE_SET_EXPORT SetVar(Space& home); |
| 143 | |
| 144 | /** |
| 145 | * \brief Initialize variable with given bounds and cardinality |
| 146 | * |
| 147 | * The variable is created with |
| 148 | * greatest lower bound \f$\{\mathit{glbMin},\dots,\mathit{glbMax}\}\f$, |
| 149 | * least upper bound \f$\{\mathit{lubMin},\dots,\mathit{lubMax}\}\f$, and |
| 150 | * cardinality minimum \a cardMin and maximum \a cardMax. |
| 151 | * The following exceptions might be thrown: |
| 152 | * - If the bounds are no legal set bounds (between Set::Limits::min |
| 153 | * and Set::Limits::max), an exception of type |
| 154 | * Gecode::Set::OutOfLimits is thrown. |
| 155 | * - If the cardinality is greater than Set::Limits::max_set_size, an |
| 156 | * exception of type Gecode::Set::OutOfLimits is |
| 157 | * thrown. |
| 158 | * - If \a cardMin > \a cardMax, an exception of type |
| 159 | * Gecode::Set::VariableEmptyDomain is thrown. |
| 160 | */ |
| 161 | GECODE_SET_EXPORT |
| 162 | SetVar(Space& home,int glbMin,int glbMax,int lubMin,int lubMax, |
| 163 | unsigned int cardMin = 0, |
| 164 | unsigned int cardMax = Set::Limits::card); |
| 165 | |
| 166 | /** |
| 167 | * \brief Initialize variable with given bounds and cardinality |
| 168 | * |
| 169 | * The variable is created with greatest lower bound \a glbD, |
| 170 | * least upper bound \f$\{\mathit{lubMin},\dots,\mathit{lubMax}\}\f$, and |
| 171 | * cardinality minimum \a cardMin and maximum \a cardMax. |
| 172 | * The following exceptions might be thrown: |
| 173 | * - If the bounds are no legal set bounds (between Set::Limits::min |
| 174 | * and Set::Limits::max), an exception of type |
| 175 | * Gecode::Set::OutOfLimits is thrown. |
| 176 | * - If the cardinality is greater than Set::Limits::max_set_size, an |
| 177 | * exception of type Gecode::Set::OutOfLimits is |
| 178 | * thrown. |
| 179 | * - If \a cardMin > \a cardMax, an exception of type |
| 180 | * Gecode::Set::VariableEmptyDomain is thrown. |
| 181 | */ |
| 182 | GECODE_SET_EXPORT |
| 183 | SetVar(Space& home,const IntSet& glbD,int lubMin,int lubMax, |
| 184 | unsigned int cardMin = 0, |
no outgoing calls
no test coverage detected