[−][src]Struct rate_common::clausedatabase::ClauseDatabase
Stores clauses in a flat buffer
Methods
impl ClauseDatabase[src]
pub fn new() -> ClauseDatabase[src]
Create an empty clause database.
pub fn number_of_clauses(&self) -> ClauseIdentifierType[src]
Returns the total number that are stored.
pub fn last_clause(&self) -> Clause[src]
Returns the clause that was added last.
pub fn push_literal(&mut self, literal: Literal)[src]
Add a literal to the current clause. Finish the clause if the literal is 0.
This must be called after a call to open_clause()
but before the call to close_clause().
pub fn open_clause(&mut self) -> Clause[src]
Make a new clause.
pub fn pop_clause(&mut self)[src]
Delete the last clause.
pub fn clause_to_string(&self, clause: Clause) -> String[src]
Give the DIMACS representation of a clause.
FIXME: possibly inefficient, use clause::write_clause() instead.
pub fn clause(&self, clause: Clause) -> &[Literal][src]
The literals in the the clause.
pub fn clause_range(&self, clause: Clause) -> Range<usize>[src]
The internal offsets of the literals in the the clause.
pub fn watches(&self, head: usize) -> [Literal; 2][src]
The first two literals in the clause.
pub fn clause2offset(&self, clause: Clause) -> usize[src]
Convert a clause identifier to the offset of the clause.
pub fn offset2clause(&self, head: usize) -> Clause[src]
Convert a clause offset to the identifier of the clause.
pub fn swap(&mut self, a: usize, b: usize)[src]
Swap the literal at the given offsets in the clause database.
pub fn fields(&self, clause: Clause) -> &u32[src]
Access the metadata for this clause.
pub fn fields_mut(&mut self, clause: Clause) -> &mut u32[src]
Access the mutable metadata for this clause.
pub fn fields_from_offset(&self, offset: usize) -> &u32[src]
Access the metadata for the clause with this offset.
This is possibly more efficient than fields().
pub fn fields_mut_from_offset(&mut self, offset: usize) -> &mut u32[src]
Access the mutable metadata for the clause with this offset.
This is possibly more efficient than fields().
pub fn shrink_to_fit(&mut self)[src]
See Vec::shrink_to_fit().
Trait Implementations
impl HeapSpace for ClauseDatabase[src]
fn heap_space(&self) -> usize[src]
impl PartialEq<ClauseDatabase> for ClauseDatabase[src]
fn eq(&self, other: &ClauseDatabase) -> bool[src]
fn ne(&self, other: &ClauseDatabase) -> bool[src]
impl Index<usize> for ClauseDatabase[src]
type Output = Literal
The returned type after indexing.
fn index(&self, offset: usize) -> &Literal[src]
impl IndexMut<usize> for ClauseDatabase[src]
impl Debug for ClauseDatabase[src]
Auto Trait Implementations
impl Send for ClauseDatabase
impl Unpin for ClauseDatabase
impl Sync for ClauseDatabase
impl UnwindSafe for ClauseDatabase
impl RefUnwindSafe for ClauseDatabase
Blanket Implementations
impl<T> HeapSpace for T where
T: Copy, [src]
T: Copy,
fn heap_space(&Self) -> usize[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> From<T> for T[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,