Class Component

Class Documentation

class Component

cacheable_component.h

Purpose: Defines the Component() class.

Copyright (C) 2018 Zayd Hammoudeh. All rights reserved.

Author
Zayd Hammoudeh zayd@ucsc.edu
Version
0.00.00

This software may be modified and distributed under the terms of the MIT license. See the LICENSE file for details.

Original Author: Marc Thurley.

Public Functions

void reserveSpace(unsigned int num_variables, unsigned int num_clauses)

The size is increased by 2 because the objects are surrounded by two since the storage format is:

     variables SENTINEL clauses SENTINEL

Parameters
  • num_variables: Number of variables in the component
  • num_clauses: Number of long (i.e., non-unary and non-binary) clauses in the component.

void set_id(CacheEntryID id)

Updates the component ID.

Parameters
  • id: New component ID

CacheEntryID id() const
void addVar(const VariableIndex var)
void closeVariableData()
void addCl(const ClauseIndex cl)
void closeClauseData()
std::vector<VariableIndex>::const_iterator varsBegin() const
std::vector<ClauseIndex>::const_iterator clsBegin() const
unsigned num_variables() const
unsigned numLongClauses() const
bool empty() const

Empty Component Checker

Checks whether this component has any variables or clauses.

Return
True if the component has at least one clause or component.

void createAsDummyComponent(unsigned max_var_id, unsigned max_clause_id)
void clear()
unsigned clauses_ofs() const

Accesor the clause offset number.

Return
Clause offset number in the data structure.

const std::vector<ComponentVarAndCls> &getData() const

Component Data Accessor

This function exposes the internal “data_” object of the component. It is not a copy so changes to this object would corrupt the component. Care should be taken when using it.

Return
Reference to the internal data of the component