GolombRuler Class Reference
[Scripts for problems]
Example: Finding optimal Golomb rulers More...
Public Types | |
| enum | { MODEL_NONE, MODEL_SUM, MODEL_RULER } |
Model variants. More... | |
| enum | { SEARCH_BAB, SEARCH_RESTART } |
Search variants. More... | |
Public Member Functions | |
| int | diag (int i, int j) |
| Return index for mark difference between mark i and mark j. | |
| GolombRuler (const SizeOptions &opt) | |
| Actual model. | |
| virtual IntVar | cost (void) const |
| Return cost. | |
| virtual void | print (std::ostream &os) const |
| Print solution. | |
| GolombRuler (bool share, GolombRuler &s) | |
| Constructor for cloning s. | |
| virtual Space * | copy (bool share) |
| Copy during cloning. | |
Protected Attributes | |
| const int | n |
| Number of marks. | |
| IntVarArray | m |
| Array for ruler marks. | |
Detailed Description
Example: Finding optimal Golomb rulers
The script makes use of two lower bounds taken from: Barbara Smith, Kostas Stergiou, Toby Walsh, Modelling the Golomb Ruler Problem. In IJCAI 99 Workshop on Non-binary Constraints, 1999.
See also problem 6 at http://www.csplib.org/.
Definition at line 60 of file golomb-ruler.cpp.
Member Enumeration Documentation
| anonymous enum |
Model variants.
- Enumerator:
MODEL_NONE No lower bound.
MODEL_SUM Use sum of ticks as lower bound.
MODEL_RULER Use size of smaller rulers as lower bound.
Definition at line 68 of file golomb-ruler.cpp.
| anonymous enum |
Search variants.
Definition at line 74 of file golomb-ruler.cpp.
Constructor & Destructor Documentation
| GolombRuler::GolombRuler | ( | const SizeOptions & | opt | ) | [inline] |
Actual model.
Definition at line 85 of file golomb-ruler.cpp.
| GolombRuler::GolombRuler | ( | bool | share, | |
| GolombRuler & | s | |||
| ) | [inline] |
Constructor for cloning s.
Definition at line 148 of file golomb-ruler.cpp.
Member Function Documentation
| int GolombRuler::diag | ( | int | i, | |
| int | j | |||
| ) | [inline] |
Return index for mark difference between mark i and mark j.
Definition at line 80 of file golomb-ruler.cpp.
| virtual IntVar GolombRuler::cost | ( | void | ) | const [inline, virtual] |
Return cost.
Implements Gecode::MiniModel::OptimizeSpace< IRT_LE >.
Definition at line 137 of file golomb-ruler.cpp.
| virtual void GolombRuler::print | ( | std::ostream & | os | ) | const [inline, virtual] |
Print solution.
Reimplemented from Gecode::Driver::ScriptBase< MinimizeSpace >.
Definition at line 143 of file golomb-ruler.cpp.
| virtual Space* GolombRuler::copy | ( | bool | share | ) | [inline, virtual] |
Member Data Documentation
const int GolombRuler::n [protected] |
Number of marks.
Definition at line 63 of file golomb-ruler.cpp.
IntVarArray GolombRuler::m [protected] |
Array for ruler marks.
Definition at line 65 of file golomb-ruler.cpp.
The documentation for this class was generated from the following file:
- examples/golomb-ruler.cpp (Revision: 9006)
