pub struct ClauseDatabase { /* private fields */ }
Expand description
Stores clauses in a flat buffer
Implementations§
Source§impl ClauseDatabase
impl ClauseDatabase
Sourcepub fn number_of_clauses(&self) -> ClauseIdentifierType
pub fn number_of_clauses(&self) -> ClauseIdentifierType
Returns the total number that are stored.
Sourcepub fn last_clause(&self) -> Clause
pub fn last_clause(&self) -> Clause
Returns the clause that was added last.
Sourcepub fn pop_clause(&mut self)
pub fn pop_clause(&mut self)
Delete the last clause.
Sourcepub fn clause_to_string(&self, clause: Clause) -> String
pub fn clause_to_string(&self, clause: Clause) -> String
Give the DIMACS representation of a clause.
Only used for debugging, prefer clause::write_clause()
.
Sourcepub fn clause_range(&self, clause: Clause) -> Range<usize>
pub fn clause_range(&self, clause: Clause) -> Range<usize>
The internal offsets of the literals in the the clause.
Sourcepub fn clause2offset(&self, clause: Clause) -> usize
pub fn clause2offset(&self, clause: Clause) -> usize
Convert a clause identifier to the offset of the clause.
Sourcepub fn offset2clause(&self, head: usize) -> Clause
pub fn offset2clause(&self, head: usize) -> Clause
Convert a clause offset to the identifier of the clause.
Sourcepub fn swap(&mut self, a: usize, b: usize)
pub fn swap(&mut self, a: usize, b: usize)
Swap the literal at the given offsets in the clause database.
Sourcepub fn fields_mut(&mut self, clause: Clause) -> &mut u32
pub fn fields_mut(&mut self, clause: Clause) -> &mut u32
Access the mutable metadata for this clause.
Sourcepub fn fields_from_offset(&self, offset: usize) -> &u32
pub fn fields_from_offset(&self, offset: usize) -> &u32
Access the metadata for the clause with this offset.
This is possibly more efficient than fields()
.
Sourcepub fn fields_mut_from_offset(&mut self, offset: usize) -> &mut u32
pub fn fields_mut_from_offset(&mut self, offset: usize) -> &mut u32
Access the mutable metadata for the clause with this offset.
This is possibly more efficient than fields()
.
Sourcepub fn shrink_to_fit(&mut self)
pub fn shrink_to_fit(&mut self)
See Vec::shrink_to_fit()
.
Trait Implementations§
Source§impl ClauseStorage for ClauseDatabase
impl ClauseStorage for ClauseDatabase
Source§impl Debug for ClauseDatabase
impl Debug for ClauseDatabase
Source§impl Default for ClauseDatabase
impl Default for ClauseDatabase
Source§fn default() -> ClauseDatabase
fn default() -> ClauseDatabase
Create an empty clause database.