\brief Class representing a set of tuples. * * A TupleSet is used for storing an extensional representation of a * constraint. After a TupleSet is finalized, no more tuples may be * added to it. * * \ingroup TaskModelIntExt */
| 2324 | * \ingroup TaskModelIntExt |
| 2325 | */ |
| 2326 | class TupleSet : public SharedHandle { |
| 2327 | public: |
| 2328 | /** \brief Type of a tuple |
| 2329 | * |
| 2330 | * The arity of the tuple is left implicit. |
| 2331 | */ |
| 2332 | typedef int* Tuple; |
| 2333 | /// Import bit set data type |
| 2334 | typedef Gecode::Support::BitSetData BitSetData; |
| 2335 | /// Range information |
| 2336 | class Range { |
| 2337 | public: |
| 2338 | /// Minimum value |
| 2339 | int min; |
| 2340 | /// Maximum value |
| 2341 | int max; |
| 2342 | /// Begin of supports |
| 2343 | BitSetData* s; |
| 2344 | /// Return the width |
| 2345 | unsigned int width(void) const; |
| 2346 | /// Return the supports for value \a n |
| 2347 | const BitSetData* supports(unsigned int n_words, int n) const; |
| 2348 | }; |
| 2349 | protected: |
| 2350 | /// Data about values in the table |
| 2351 | class ValueData { |
| 2352 | public: |
| 2353 | /// Number of ranges |
| 2354 | unsigned int n; |
| 2355 | /// Ranges |
| 2356 | Range* r; |
| 2357 | /// Find start range for value \a n |
| 2358 | unsigned int start(int n) const; |
| 2359 | }; |
| 2360 | /** |
| 2361 | * \brief Data stored for a Table |
| 2362 | * |
| 2363 | */ |
| 2364 | class GECODE_VTABLE_EXPORT Data : public SharedHandle::Object { |
| 2365 | protected: |
| 2366 | /// Initial number of free tuples |
| 2367 | static const int n_initial_free = 1024; |
| 2368 | public: |
| 2369 | /// Arity |
| 2370 | int arity; |
| 2371 | /// Number of words for support |
| 2372 | unsigned int n_words; |
| 2373 | /// Number of Tuples |
| 2374 | int n_tuples; |
| 2375 | /// Number of free tuple entries of arity |
| 2376 | int n_free; |
| 2377 | /// Smallest value |
| 2378 | int min; |
| 2379 | /// Largest value |
| 2380 | int max; |
| 2381 | /// Hash key |
| 2382 | std::size_t key; |
| 2383 | /// Tuple data |