pub fn new(problem: &'e E) -> Self {
        let grid = Self::populate_grid(problem);

        let mut solver = Self {
            problem,

            grid,
            partial_solution: Vec::new(),
            stack: Vec::new(),
        };

        // If the grid is already solved (no primary columns), don't bother to put a
        // stack frame in
        if !Self::solution_test(&solver.grid, solver.problem) {
            let min_column = Self::choose_column(&mut solver.grid, solver.problem);
            let selected_rows = Self::select_rows_from_column(min_column);

            if !selected_rows.is_empty() {
                solver.stack.push(Frame {
                    state: FrameState::Cover,
                    min_column,
                    selected_rows,
                });
            }
        }

        solver
    }
/// Create a new `Solver` with the given instance of an exact cover problem.
Create a new `Solver` with the given instance of an exact cover problem.
Create a new ` Solver ` with the given instance of an exact cover problem .
pub fn new(problem: &'e E) -> Self {
        let grid = Self::populate_grid(problem);
        let mut solver = Self {
            problem,
            grid,
            partial_solution: Vec::new(),
            stack: Vec::new(),
        };
        // If the grid is already solved (no primary columns), don't bother to put a
        // stack frame in
        if !Self::solution_test(&solver.grid, solver.problem) {
            let min_column = Self::choose_column(&mut solver.grid, solver.problem);
            let selected_rows = Self::select_rows_from_column(min_column);
            if !selected_rows.is_empty() {
                solver.stack.push(Frame {
                    state: FrameState::Cover,
                    min_column,
                    selected_rows,
                });
            }
        }
        solver
    }
pub fn new ( problem : & ' e E ) -> Self { let grid = Self :: populate_grid ( problem ) ; let mut solver = Self { problem , grid , partial_solution : Vec :: new ( ) , stack : Vec :: new ( ) , } ; // If the grid is already solved (no primary columns), don't bother to put a // stack frame in if ! Self :: solution_test ( & solver . grid , solver . problem ) { let min_column = Self :: choose_column ( & mut solver . grid , solver . problem ) ; let selected_rows = Self :: select_rows_from_column ( min_column ) ; if ! selected_rows . is_empty ( ) { solver . stack . push ( Frame { state : FrameState :: Cover , min_column , selected_rows , } ) ; } } solver }
Create a new `Solver` with the given instance of an exact cover problem.
Create a new ` Solver ` with the given instance of an exact cover problem .
problem
&'e E
problem
&'e E