Generated on Wed Nov 5 2014 05:18:37 for Gecode by doxygen 1.7.6.1
DominatingQueens Class Reference

Example: Dominating Queens More...

List of all members.

Public Member Functions

 DominatingQueens (const SizeOptions &opt)
 The actual problem.
virtual IntVar cost (void) const
 Return cost.
 DominatingQueens (bool share, DominatingQueens &s)
 Constructor for cloning s.
virtual Spacecopy (bool share)
 Perform copying during cloning.
virtual void print (std::ostream &os) const
 Print solution.

Protected Member Functions

int xy (int x, int y) const
 Compute coordinate pair from x and y.
int x (int xy) const
 Compute x coordinate from pair xy.
int y (int xy) const
 Compute y coordinate from pair xy.
IntSet attacked (int xy)
 Compute set of fields that can be attacked by xy.

Protected Attributes

const int n
 Size of the board.
IntVarArray b
 Fields on the board.
IntVar q
 Number of queens.

Related Functions

(Note that these are not member functions.)

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

Detailed Description

Example: Dominating Queens

Place a number of queens on a n times n chessboard such that each squares is either attacked or occupied by a queen.

The model is taken from: C. Bessiere, E. Hebrard, B. Hnich, Z. Kiziltan, and T. Walsh, Filtering Algorithms for the NValue Constraint, Constraints, 11(4), 271-293, 2006.

Definition at line 57 of file dominating-queens.cpp.


Constructor & Destructor Documentation

The actual problem.

Definition at line 90 of file dominating-queens.cpp.

DominatingQueens::DominatingQueens ( bool  share,
DominatingQueens s 
) [inline]

Constructor for cloning s.

Definition at line 120 of file dominating-queens.cpp.


Member Function Documentation

int DominatingQueens::xy ( int  x,
int  y 
) const [inline, protected]

Compute coordinate pair from x and y.

Definition at line 66 of file dominating-queens.cpp.

int DominatingQueens::x ( int  xy) const [inline, protected]

Compute x coordinate from pair xy.

Definition at line 70 of file dominating-queens.cpp.

int DominatingQueens::y ( int  xy) const [inline, protected]

Compute y coordinate from pair xy.

Definition at line 74 of file dominating-queens.cpp.

IntSet DominatingQueens::attacked ( int  xy) [inline, protected]

Compute set of fields that can be attacked by xy.

Definition at line 78 of file dominating-queens.cpp.

virtual IntVar DominatingQueens::cost ( void  ) const [inline, virtual]

Return cost.

Definition at line 115 of file dominating-queens.cpp.

virtual Space* DominatingQueens::copy ( bool  share) [inline, virtual]

Perform copying during cloning.

Definition at line 128 of file dominating-queens.cpp.

virtual void DominatingQueens::print ( std::ostream &  os) const [inline, virtual]

Print solution.

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

Definition at line 134 of file dominating-queens.cpp.


Friends And Related Function Documentation

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

Main-function.

Definition at line 160 of file dominating-queens.cpp.


Member Data Documentation

const int DominatingQueens::n [protected]

Size of the board.

Definition at line 60 of file dominating-queens.cpp.

Fields on the board.

Definition at line 62 of file dominating-queens.cpp.

Number of queens.

Definition at line 64 of file dominating-queens.cpp.


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