[][src]Struct dancing_links::grid::Grid

pub struct Grid { /* fields omitted */ }

Dancing links grid, support efficient removal of rows and columns.

Implementations

impl Grid[src]

pub fn new(
    num_columns: usize,
    coordinates: impl IntoIterator<Item = (usize, usize)>
) -> Self
[src]

Create a new grid with a specified number of columns, and the given coordinates filled.

Rows and columns are based 1 indexed for this grid, matching the indexing notation for matrices in general.

pub fn to_dense(&self) -> Box<[Box<[bool]>]>[src]

Convert the grid to a dense representation.

This takes the original size of the grid, and only put true values for locations that are still present in the grid (not covered).

pub fn uncovered_columns(&self) -> impl Iterator<Item = *const Column>[src]

Return an iterator of pointers to columns that are uncovered.

pub fn uncovered_columns_mut(&mut self) -> impl Iterator<Item = *mut Column>[src]

Return an iterator of mut pointers to columns that are uncovered.

pub fn all_columns_mut(
    &mut self
) -> impl Iterator<Item = *mut Column> + DoubleEndedIterator + '_
[src]

Return an iterator over all columns that are in the grid (covered and uncovered).

pub fn get_column(&self, index: usize) -> Option<*const Column>[src]

Return a pointer to a specific Column, if it exists.

pub fn get_column_mut(&mut self, index: usize) -> Option<*mut Column>[src]

Return a mut pointer to a specific Column, if it exists.

pub fn is_empty(&self) -> bool[src]

Return true if there are no uncovered columns in the grid.

Trait Implementations

impl Debug for Grid[src]

Auto Trait Implementations

impl !RefUnwindSafe for Grid

impl !Send for Grid

impl !Sync for Grid

impl Unpin for Grid

impl !UnwindSafe for Grid

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.