Skip to main content

CoverMap

Struct CoverMap 

Source
pub struct CoverMap { /* private fields */ }
Expand description

A Caching implementation keyed by the depth and the instances of a subproblem: paths reaching the same instances at the same depth share one entry.

Entries live in an arena, found by depth, then number of instances, then instances. Each entry keeps its instances, one word per 64 rows, so the memory grows with the size of the dataset.

Trait Implementations§

Source§

impl Caching for CoverMap

Source§

fn init(&mut self) -> Index

Clears the cache and creates the root entry.
Source§

fn root_index(&mut self) -> Index

Index of the root entry.
Source§

fn root(&self) -> Option<&CacheEntry>

The root entry.
Source§

fn insert(&mut self, path: &[usize], cover: &Cover) -> Index

Finds the entry of the subproblem, creating it if needed. The index is New for an entry that has not been evaluated yet.
Source§

fn find(&self, path: &[usize], cover: &Cover) -> Option<&CacheEntry>

The entry of the subproblem, if cached.
Source§

fn keyed_by_cover(&self) -> bool

Whether lookups use cover.
Source§

fn node(&self, key: &CacheKey) -> Option<&CacheEntry>

The entry for key.
Source§

fn contains(&self, key: &CacheKey) -> bool

Whether the cache has an entry for key.
Source§

fn update_root(&mut self) -> Option<CacheEntryUpdater<'_>>

An updater for the root entry.
Source§

fn update_node(&mut self, key: &CacheKey) -> Option<CacheEntryUpdater<'_>>

An updater for the entry of key.
Source§

fn size(&self) -> usize

Number of entries.
Source§

fn is_empty(&self) -> bool

Whether the cache has no entry.
Source§

impl Default for CoverMap

Source§

fn default() -> CoverMap

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.