yosys-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Minisat::OccLists< K, Vec, Deleted, MkIndex > Class Template Reference

#include <SolverTypes.h>

+ Collaboration diagram for Minisat::OccLists< K, Vec, Deleted, MkIndex >:

Public Member Functions

 OccLists (const Deleted &d, MkIndex _index=MkIndex())
 
void init (const K &idx)
 
Vec & operator[] (const K &idx)
 
Vec & lookup (const K &idx)
 
void cleanAll ()
 
void clean (const K &idx)
 
void smudge (const K &idx)
 
void clear (bool free=true)
 

Private Attributes

IntMap< K, Vec, MkIndex > occs
 
IntMap< K, char, MkIndex > dirty
 
vec< K > dirties
 
Deleted deleted
 

Detailed Description

template<class K, class Vec, class Deleted, class MkIndex = MkIndexDefault<K>>
class Minisat::OccLists< K, Vec, Deleted, MkIndex >

Definition at line 325 of file SolverTypes.h.

Constructor & Destructor Documentation

template<class K, class Vec, class Deleted, class MkIndex = MkIndexDefault<K>>
Minisat::OccLists< K, Vec, Deleted, MkIndex >::OccLists ( const Deleted &  d,
MkIndex  _index = MkIndex() 
)
inline

Definition at line 333 of file SolverTypes.h.

333  :
334  occs(_index),
335  dirty(_index),
336  deleted(d){}
IntMap< K, Vec, MkIndex > occs
Definition: SolverTypes.h:327
IntMap< K, char, MkIndex > dirty
Definition: SolverTypes.h:328

Member Function Documentation

template<class K, class Vec , class Deleted , class MkIndex >
void Minisat::OccLists< K, Vec, Deleted, MkIndex >::clean ( const K &  idx)

Definition at line 371 of file SolverTypes.h.

372 {
373  Vec& vec = occs[idx];
374  int i, j;
375  for (i = j = 0; i < vec.size(); i++)
376  if (!deleted(vec[i]))
377  vec[j++] = vec[i];
378  vec.shrink(i - j);
379  dirty[idx] = 0;
380 }
IntMap< K, Vec, MkIndex > occs
Definition: SolverTypes.h:327
static std::string idx(std::string str)
Definition: test_autotb.cc:57
IntMap< K, char, MkIndex > dirty
Definition: SolverTypes.h:328

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class K , class Vec , class Deleted , class MkIndex >
void Minisat::OccLists< K, Vec, Deleted, MkIndex >::cleanAll ( )

Definition at line 360 of file SolverTypes.h.

361 {
362  for (int i = 0; i < dirties.size(); i++)
363  // Dirties may contain duplicates so check here if a variable is already cleaned:
364  if (dirty[dirties[i]])
365  clean(dirties[i]);
366  dirties.clear();
367 }
IntMap< K, char, MkIndex > dirty
Definition: SolverTypes.h:328
Size size(void) const
Definition: Vec.h:64
void clean(const K &idx)
Definition: SolverTypes.h:371
void clear(bool dealloc=false)
Definition: Vec.h:125
template<class K, class Vec, class Deleted, class MkIndex = MkIndexDefault<K>>
void Minisat::OccLists< K, Vec, Deleted, MkIndex >::clear ( bool  free = true)
inline

Definition at line 351 of file SolverTypes.h.

351  {
352  occs .clear(free);
353  dirty .clear(free);
354  dirties.clear(free);
355  }
void free(void *)
IntMap< K, Vec, MkIndex > occs
Definition: SolverTypes.h:327
void clear(bool dispose=false)
Definition: IntMap.h:52
IntMap< K, char, MkIndex > dirty
Definition: SolverTypes.h:328
void clear(bool dealloc=false)
Definition: Vec.h:125
template<class K, class Vec, class Deleted, class MkIndex = MkIndexDefault<K>>
void Minisat::OccLists< K, Vec, Deleted, MkIndex >::init ( const K &  idx)
inline

Definition at line 338 of file SolverTypes.h.

338 { occs.reserve(idx); occs[idx].clear(); dirty.reserve(idx, 0); }
IntMap< K, Vec, MkIndex > occs
Definition: SolverTypes.h:327
void clear(bool dispose=false)
Definition: IntMap.h:52
static std::string idx(std::string str)
Definition: test_autotb.cc:57
IntMap< K, char, MkIndex > dirty
Definition: SolverTypes.h:328
void reserve(K key, V pad)
Definition: IntMap.h:47
template<class K, class Vec, class Deleted, class MkIndex = MkIndexDefault<K>>
Vec& Minisat::OccLists< K, Vec, Deleted, MkIndex >::lookup ( const K &  idx)
inline

Definition at line 340 of file SolverTypes.h.

340 { if (dirty[idx]) clean(idx); return occs[idx]; }
IntMap< K, Vec, MkIndex > occs
Definition: SolverTypes.h:327
static std::string idx(std::string str)
Definition: test_autotb.cc:57
IntMap< K, char, MkIndex > dirty
Definition: SolverTypes.h:328
void clean(const K &idx)
Definition: SolverTypes.h:371
template<class K, class Vec, class Deleted, class MkIndex = MkIndexDefault<K>>
Vec& Minisat::OccLists< K, Vec, Deleted, MkIndex >::operator[] ( const K &  idx)
inline

Definition at line 339 of file SolverTypes.h.

339 { return occs[idx]; }
IntMap< K, Vec, MkIndex > occs
Definition: SolverTypes.h:327
static std::string idx(std::string str)
Definition: test_autotb.cc:57
template<class K, class Vec, class Deleted, class MkIndex = MkIndexDefault<K>>
void Minisat::OccLists< K, Vec, Deleted, MkIndex >::smudge ( const K &  idx)
inline

Definition at line 344 of file SolverTypes.h.

344  {
345  if (dirty[idx] == 0){
346  dirty[idx] = 1;
347  dirties.push(idx);
348  }
349  }
static std::string idx(std::string str)
Definition: test_autotb.cc:57
IntMap< K, char, MkIndex > dirty
Definition: SolverTypes.h:328
void push(void)
Definition: Vec.h:74

Field Documentation

template<class K, class Vec, class Deleted, class MkIndex = MkIndexDefault<K>>
Deleted Minisat::OccLists< K, Vec, Deleted, MkIndex >::deleted
private

Definition at line 330 of file SolverTypes.h.

template<class K, class Vec, class Deleted, class MkIndex = MkIndexDefault<K>>
vec<K> Minisat::OccLists< K, Vec, Deleted, MkIndex >::dirties
private

Definition at line 329 of file SolverTypes.h.

template<class K, class Vec, class Deleted, class MkIndex = MkIndexDefault<K>>
IntMap<K, char, MkIndex> Minisat::OccLists< K, Vec, Deleted, MkIndex >::dirty
private

Definition at line 328 of file SolverTypes.h.

template<class K, class Vec, class Deleted, class MkIndex = MkIndexDefault<K>>
IntMap<K, Vec, MkIndex> Minisat::OccLists< K, Vec, Deleted, MkIndex >::occs
private

Definition at line 327 of file SolverTypes.h.


The documentation for this class was generated from the following file: