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

Example: Word-square puzzle More...

Public Types

enum  { BRANCH_WORDS , BRANCH_LETTERS }
 Branching variants. More...

Public Member Functions

 WordSquare (const SizeOptions &opt)
 Actual model.
 WordSquare (WordSquare &s)
 Constructor for cloning s.
virtual Spacecopy (void)
 Copy during cloning.
virtual void print (std::ostream &os) const
 Print solution.
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

const int w_l
 Length of words.
IntVarArray letters
 The array of letters.

(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: Word-square puzzle

From http://en.wikipedia.org/wiki/Word_square: A word square is a special case of acrostic. It consists of a set of words, all having the same number of letters as the total number of words (the "order" of the square); when the words are written out in a square grid horizontally, the same set of words can be read vertically.

Definition at line 59 of file word-square.cpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Branching variants.

Enumerator
BRANCH_WORDS 

Branch on word variables.

BRANCH_LETTERS 

Branch on letter variables.

Definition at line 67 of file word-square.cpp.

Constructor & Destructor Documentation

◆ WordSquare() [1/2]

WordSquare::WordSquare ( const SizeOptions & opt)
inline

Actual model.

Definition at line 72 of file word-square.cpp.

◆ WordSquare() [2/2]

WordSquare::WordSquare ( WordSquare & s)
inline

Constructor for cloning s.

Definition at line 115 of file word-square.cpp.

Member Function Documentation

◆ copy()

virtual Space * WordSquare::copy ( void )
inlinevirtual

Copy during cloning.

Definition at line 121 of file word-square.cpp.

◆ print()

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

Print solution.

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

Definition at line 126 of file word-square.cpp.

◆ main()

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

Main-function.

Definition at line 147 of file word-square.cpp.

Member Data Documentation

◆ w_l

const int WordSquare::w_l
protected

Length of words.

Definition at line 62 of file word-square.cpp.

◆ letters

IntVarArray WordSquare::letters
protected

The array of letters.

Definition at line 64 of file word-square.cpp.


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