Virtual base class of solutions for the backtracking algorithm. More...
#include <backtrack.h>
Public Member Functions | |
virtual | ~Solution () |
Destructor. | |
virtual void | set_first_at (unsigned int level)=0 |
Set the element to the first sibling. | |
virtual void | set_next_at (unsigned int level)=0 |
Set the element to the next sibling. | |
virtual void | reset_at (unsigned int level)=0 |
Reset the element. | |
virtual bool | is_last_at (unsigned int level) const =0 |
Check if the element is set to the last sibling. | |
virtual bool | is_valid_at (int level) const =0 |
Check if the element is valid (following elements ignored). | |
virtual bool | is_last_level (int level) const =0 |
Check if the level is the last possible level. |
Virtual base class of solutions for the backtracking algorithm.
Definition at line 85 of file backtrack.h.
virtual BackTrack::Solution::~Solution | ( | ) | [inline, virtual] |
Destructor.
Definition at line 90 of file backtrack.h.
virtual bool BackTrack::Solution::is_last_at | ( | unsigned int | level | ) | const [pure virtual] |
Check if the element is set to the last sibling.
Implemented in Sudoku::Generator, Sudoku::Solver, and Permutation< Type, Size >.
Referenced by BackTrack::Algorithm::find_valid_sibling(), and BackTrack::Algorithm::visit_new_node().
virtual bool BackTrack::Solution::is_last_level | ( | int | level | ) | const [pure virtual] |
Check if the level is the last possible level.
Implemented in Sudoku::Generator, Sudoku::Solver, and Permutation< Type, Size >.
Referenced by BackTrack::Algorithm::find_solution().
virtual bool BackTrack::Solution::is_valid_at | ( | int | level | ) | const [pure virtual] |
Check if the element is valid (following elements ignored).
Implemented in Sudoku::Generator, Sudoku::Solver, and Permutation< Type, Size >.
Referenced by BackTrack::Algorithm::find_solution(), and BackTrack::Algorithm::find_valid_sibling().
virtual void BackTrack::Solution::reset_at | ( | unsigned int | level | ) | [pure virtual] |
Reset the element.
Implemented in Sudoku::Generator, Sudoku::Solver, and Permutation< Type, Size >.
Referenced by BackTrack::Algorithm::reset(), and BackTrack::Algorithm::visit_new_node().
virtual void BackTrack::Solution::set_first_at | ( | unsigned int | level | ) | [pure virtual] |
Set the element to the first sibling.
Implemented in Sudoku::Generator, Sudoku::Solver, and Permutation< Type, Size >.
Referenced by BackTrack::Algorithm::create_left_leaf().
virtual void BackTrack::Solution::set_next_at | ( | unsigned int | level | ) | [pure virtual] |
Set the element to the next sibling.
Implemented in Sudoku::Generator, Sudoku::Solver, and Permutation< Type, Size >.
Referenced by BackTrack::Algorithm::find_valid_sibling(), and BackTrack::Algorithm::visit_new_node().