Generated on Sat Feb 7 2015 02:01:38 for Gecode by doxygen 1.8.9.1
GolombRuler Class Reference

Example: Finding optimal Golomb rulers More...

Public Member Functions

 GolombRuler (const SizeOptions &opt)
 Actual model. More...
 
virtual IntVar cost (void) const
 Return cost. More...
 
virtual void print (std::ostream &os) const
 Print solution. More...
 
 GolombRuler (bool share, GolombRuler &s)
 Constructor for cloning s. More...
 
virtual Spacecopy (bool share)
 Copy during cloning. More...
 
- Public Member Functions inherited from Gecode::Driver::ScriptBase< BaseSpace >
 ScriptBase (void)
 Default constructor. More...
 
 ScriptBase (bool share, ScriptBase &e)
 Constructor used for cloning. More...
 
virtual void compare (const Space &, std::ostream &os) const
 Compare with s. More...
 

Protected Attributes

IntVarArray m
 Array for ruler marks. More...
 

Related Functions

(Note that these are not member functions.)

int main (int argc, char *argv[])
 Main-function. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Gecode::Driver::ScriptBase< BaseSpace >
static std::ostream & select_ostream (const char *name, std::ofstream &ofs)
 Choose output stream according to name. More...
 
template<class Script , template< class > class Engine, class Options >
static void run (const Options &opt, Script *s=NULL)
 

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/.

The upper bound used is from the trivial construction where distances between consecutive marks are increasing powers of two.

Note that "Modeling and Programming with Gecode" uses this example as a case study.

Definition at line 66 of file golomb-ruler.cpp.

Constructor & Destructor Documentation

GolombRuler::GolombRuler ( const SizeOptions opt)
inline

Actual model.

Definition at line 72 of file golomb-ruler.cpp.

GolombRuler::GolombRuler ( bool  share,
GolombRuler s 
)
inline

Constructor for cloning s.

Definition at line 117 of file golomb-ruler.cpp.

Member Function Documentation

virtual IntVar GolombRuler::cost ( void  ) const
inlinevirtual

Return cost.

Definition at line 106 of file golomb-ruler.cpp.

virtual void GolombRuler::print ( std::ostream &  os) const
inlinevirtual

Print solution.

Reimplemented from Gecode::Driver::ScriptBase< BaseSpace >.

Definition at line 112 of file golomb-ruler.cpp.

virtual Space* GolombRuler::copy ( bool  share)
inlinevirtual

Copy during cloning.

Definition at line 123 of file golomb-ruler.cpp.

Friends And Related Function Documentation

int main ( int  argc,
char *  argv[] 
)
related

Main-function.

Definition at line 132 of file golomb-ruler.cpp.

Member Data Documentation

IntVarArray GolombRuler::m
protected

Array for ruler marks.

Definition at line 69 of file golomb-ruler.cpp.


The documentation for this class was generated from the following file: