Generated on Thu Jan 16 2025 00:00:00 for Gecode by doxygen 1.14.0

Example: Schur's lemma More...

Public Member Functions

 Schur (const SchurOptions &opt)
 Actual model.
virtual void print (std::ostream &os) const
 Print solution.
 Schur (Schur &s)
 Constructor for cloning s.
virtual Spacecopy (void)
 Copy during cloning.
Public Member Functions inherited from Gecode::Driver::ScriptBase< Driver::IgnoreStepOption< Space > >
 ScriptBase (const Options &opt)
 Constructor.
 ScriptBase (ScriptBase &e)
 Constructor used for cloning.
virtual void compare (const Space &home, std::ostream &os) const
 Compare with s.
Public Member Functions inherited from Gecode::Driver::IgnoreStepOption< BaseSpace >
 IgnoreStepOption (const Options &)
 Constructor.
 IgnoreStepOption (BaseSpace &e)
 Constructor used for cloning.

Protected Attributes

IntVarArray box
 Array of box per ball.

(Note that these are not member symbols.)

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

Additional Inherited Members

Static Public Member Functions inherited from Gecode::Driver::ScriptBase< Driver::IgnoreStepOption< Space > >
static std::ostream & select_ostream (const char *sn, std::ofstream &ofs)
 Choose output stream according to sn.
static void run (const Options &opt, Script *s=NULL)

Detailed Description

Example: Schur's lemma

Put $n$ balls labeled ${1,\ldots,n}$ into $c$ boxes such that for any triple of balls $\langle x, y, z\rangle$ with $x+y = z$, not all are in the same box.

This problem has a solution for $c=3$ if $n < 14$.

See also problem 15 at http://www.csplib.org/.

Definition at line 83 of file schurs-lemma.cpp.

Constructor & Destructor Documentation

◆ Schur() [1/2]

Schur::Schur ( const SchurOptions & opt)
inline

Actual model.

Definition at line 89 of file schurs-lemma.cpp.

◆ Schur() [2/2]

Schur::Schur ( Schur & s)
inline

Constructor for cloning s.

Definition at line 110 of file schurs-lemma.cpp.

Member Function Documentation

◆ print()

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

Print solution.

Reimplemented from Gecode::Driver::ScriptBase< Driver::IgnoreStepOption< Space > >.

Definition at line 105 of file schurs-lemma.cpp.

◆ copy()

virtual Space * Schur::copy ( void )
inlinevirtual

Copy during cloning.

Definition at line 115 of file schurs-lemma.cpp.

◆ main()

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

Main-function.

Definition at line 124 of file schurs-lemma.cpp.

Member Data Documentation

◆ box

IntVarArray Schur::box
protected

Array of box per ball.

Definition at line 86 of file schurs-lemma.cpp.


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