Generated on Tue Feb 11 2025 17:33:26 for Gecode by doxygen 1.12.0

Example: SEND+MORE=MONEY puzzle More...

Public Types

enum  { MODEL_SINGLE , MODEL_CARRY }
 Model variants. More...
 

Public Member Functions

 Money (const Options &opt)
 Actual model.
 
virtual void print (std::ostream &os) const
 Print solution.
 
 Money (Money &s)
 Constructor for cloning s.
 
virtual Spacecopy (void)
 Copy during cloning.
 
- Public Member Functions inherited from Gecode::Driver::ScriptBase< BaseSpace >
 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.
 

Protected Attributes

IntVarArray le
 Array of letters.
 

Static Protected Attributes

static const int nl = 8
 Number of letters.
 

Related Symbols

(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< BaseSpace >
static std::ostream & select_ostream (const char *sn, std::ofstream &ofs)
 Choose output stream according to sn.
 
template<class Script , template< class > class Engine, class Options >
static void run (const Options &opt, Script *s=NULL)
 

Detailed Description

Example: SEND+MORE=MONEY puzzle

Well-known cryptoarithmetic puzzle. Henry Dudeney, Strand Magazine, July 1924.

Definition at line 49 of file money.cpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Model variants.

Enumerator
MODEL_SINGLE 

Use single linear equation.

MODEL_CARRY 

Use carries.

Definition at line 57 of file money.cpp.

Constructor & Destructor Documentation

◆ Money() [1/2]

Money::Money ( const Options & opt)
inline

Actual model.

Definition at line 62 of file money.cpp.

◆ Money() [2/2]

Money::Money ( Money & s)
inline

Constructor for cloning s.

Definition at line 115 of file money.cpp.

Member Function Documentation

◆ print()

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

Print solution.

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

Definition at line 110 of file money.cpp.

◆ copy()

virtual Space * Money::copy ( void )
inlinevirtual

Copy during cloning.

Definition at line 120 of file money.cpp.

Friends And Related Symbol Documentation

◆ main()

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

Main-function.

Definition at line 129 of file money.cpp.

Member Data Documentation

◆ nl

const int Money::nl = 8
staticprotected

Number of letters.

Definition at line 52 of file money.cpp.

◆ le

IntVarArray Money::le
protected

Array of letters.

Definition at line 54 of file money.cpp.


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