Skip to main content

Solver

Struct Solver 

Source
pub struct Solver {
    pub array: Vec<TSet>,
    /* private fields */
}

Fields§

§array: Vec<TSet>

Implementations§

Source§

impl Solver

Source

pub fn new() -> Solver

Source

pub fn get_set(&self, set_id: TSetId) -> TSet

Source

pub fn get_set_ref(&self, set_id: TSetId) -> &TSet

Source

pub fn get_id(&mut self, inst: TSet) -> TSetId

Source

pub fn has_bit_set(&mut self, set_id: TSetId, idx: usize, bit: u64) -> bool

Source

pub fn pp_collect_ranges(tset: &TSet) -> BTreeSet<(u8, u8)>

Source

pub fn pp_first(&self, tset: &TSet) -> char

pretty print a character from the set

Source

pub fn byte_ranges(&self, tset: TSetId) -> Vec<(u8, u8)>

Source

pub fn pp(&self, tset: TSetId) -> String

Source§

impl Solver

Source

pub fn full() -> TSet

Source

pub fn empty() -> TSet

Source

pub fn or_id(&mut self, set1: TSetId, set2: TSetId) -> TSetId

Source

pub fn and_id(&mut self, set1: TSetId, set2: TSetId) -> TSetId

Source

pub fn not_id(&mut self, set_id: TSetId) -> TSetId

Source

pub fn is_sat_id(&mut self, set1: TSetId, set2: TSetId) -> bool

Source

pub fn unsat_id(&mut self, set1: TSetId, set2: TSetId) -> bool

Source

pub fn single_byte(&self, set_id: TSetId) -> Option<u8>

if the set contains exactly one byte, return it

Source

pub fn is_empty_id(&self, set1: TSetId) -> bool

Source

pub fn is_full_id(&self, set1: TSetId) -> bool

Source

pub fn contains_id(&mut self, large_id: TSetId, small_id: TSetId) -> bool

Source

pub fn u8_to_set_id(&mut self, byte: u8) -> TSetId

Source

pub fn range_to_set_id(&mut self, start: u8, end: u8) -> TSetId

Source

pub fn and(set1: &TSet, set2: &TSet) -> TSet

Source

pub fn is_sat(set1: &TSet, set2: &TSet) -> bool

Source

pub fn or(set1: &TSet, set2: &TSet) -> TSet

Source

pub fn not(set: &TSet) -> TSet

Source

pub fn is_full(set: &TSet) -> bool

Source

pub fn is_empty(set: &TSet) -> bool

Source

pub fn contains(large: &TSet, small: &TSet) -> bool

Source

pub fn u8_to_set(byte: u8) -> TSet

Source

pub fn range_to_set(start: u8, end: u8) -> TSet

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.