dlx: nicer iteration
This commit is contained in:
@@ -7,30 +7,9 @@
|
||||
|
||||
namespace dlx {
|
||||
|
||||
struct Cell;
|
||||
|
||||
class Dlx final {
|
||||
|
||||
struct Cell {
|
||||
Cell *U, *D, *L, *R;
|
||||
std::size_t n;
|
||||
union {
|
||||
Cell* c;
|
||||
std::size_t s;
|
||||
};
|
||||
|
||||
auto LR_self() -> void;
|
||||
auto UD_self() -> void;
|
||||
auto LR_delete() -> void;
|
||||
auto UD_delete() -> void;
|
||||
auto UD_restore() -> void;
|
||||
auto LR_restore() -> void;
|
||||
auto LR_insert(Cell* k) -> void;
|
||||
auto UD_insert(Cell* k) -> void;
|
||||
auto CoverCol() -> void;
|
||||
auto UncoverCol() -> void;
|
||||
auto ColAdd(std::size_t row_id) -> Cell*;
|
||||
static Cell* ColNew();
|
||||
};
|
||||
|
||||
std::vector<Cell*> ctab_;
|
||||
std::vector<Cell*> rtab_;
|
||||
Cell* root_;
|
||||
|
Reference in New Issue
Block a user