|
Adobe Source Libraries 2.0.0
A collection of C++ libraries.
|
#include <dancing_links.hpp>
Public Member Functions | |
| dancing_links_t (std::size_t row_count, std::size_t column_count) | |
| void | set (std::size_t row, std::size_t col, char color=0) |
| void | set_secondary_column (std::size_t col) |
| template<typename ResultCallback, typename SearchHeuristic> | |
| std::size_t | search (std::size_t max_solutions, ResultCallback callback, SearchHeuristic heuristic) |
| std::size_t | search (std::size_t max_solutions) |
Definition at line 89 of file dancing_links.hpp.
| dancing_links_t | ( | std::size_t | row_count, |
| std::size_t | column_count ) |
Definition at line 92 of file dancing_links.hpp.
| void set | ( | std::size_t | row, |
| std::size_t | col, | ||
| char | color = 0 ) |
Establishes a 1-node at the intersection of [ row, col ].
| row | The row in which the node will be set |
| col | The column in which the node will be set |
| color | The color of the node |
Definition at line 102 of file dancing_links.hpp.
| void set_secondary_column | ( | std::size_t | col | ) |
Secondary columns take dancing links to the next step, in that they allow for a column to be optionally used zero or one times. This essentially allows for a condition that can be met once but no more than once.
| col | The column which will be made secondary |
Definition at line 106 of file dancing_links.hpp.
| std::size_t search | ( | std::size_t | max_solutions, |
| ResultCallback | callback, | ||
| SearchHeuristic | heuristic ) |
Performs a search looking for solutions to the 1-cover problem. When a solution is found the callback is called once for every row in the solution. The signature for the callback is:
| max_solutions | Maximum number of solutions to find before breaking out of the search. |
| callback | callback |
| heuristic | The search heuristic to use |
Definition at line 109 of file dancing_links.hpp.
| std::size_t search | ( | std::size_t | max_solutions | ) |
Performs a search looking for solutions to the 1-cover problem.
| max_solutions | Maximum number of solutions to find before breaking out of the search. |
Definition at line 120 of file dancing_links.hpp.