ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
Gluco2::OccLists< Idx, Vec, Deleted > Class Template Reference

#include <SolverTypes.h>

Public Member Functions

 OccLists (const Deleted &d)
 
void init (const Idx &idx)
 
void prelocate (const int num)
 
Vec & operator[] (const Idx &idx)
 
Vec & lookup (const Idx &idx)
 
void cleanAll ()
 
void clean (const Idx &idx)
 
void smudge (const Idx &idx)
 
void clear (bool free=true)
 

Detailed Description

template<class Idx, class Vec, class Deleted>
class Gluco2::OccLists< Idx, Vec, Deleted >

Definition at line 290 of file SolverTypes.h.

Constructor & Destructor Documentation

◆ OccLists()

template<class Idx, class Vec, class Deleted>
Gluco2::OccLists< Idx, Vec, Deleted >::OccLists ( const Deleted & d)
inline

Definition at line 298 of file SolverTypes.h.

298: deleted(d) {}

Member Function Documentation

◆ clean()

template<class Idx, class Vec, class Deleted>
void Gluco2::OccLists< Idx, Vec, Deleted >::clean ( const Idx & idx)

Definition at line 341 of file SolverTypes.h.

342{
343 Vec& vec = occs[toInt(idx)];
344 int i, j;
345 for (i = j = 0; i < vec.size(); i++)
346 if (!deleted(vec[i]))
347 vec[j++] = vec[i];
348 vec.shrink_(i - j);
349 dirty[toInt(idx)] = 0;
350}
int toInt(Var v)
Definition SolverTypes.h:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cleanAll()

template<class Idx, class Vec, class Deleted>
void Gluco2::OccLists< Idx, Vec, Deleted >::cleanAll ( )

Definition at line 330 of file SolverTypes.h.

331{
332 for (int i = 0; i < dirties.size(); i++)
333 // Dirties may contain duplicates so check here if a variable is already cleaned:
334 if (dirty[toInt(dirties[i])])
335 clean(dirties[i]);
336 dirties.shrink_( dirties.size() );
337}
void clean(const Idx &idx)
Here is the call graph for this function:

◆ clear()

template<class Idx, class Vec, class Deleted>
void Gluco2::OccLists< Idx, Vec, Deleted >::clear ( bool free = true)
inline

Definition at line 315 of file SolverTypes.h.

315 {
316 if(free){
317 occs .clear(free);
318 dirty .clear(free);
319 dirties.clear(free);
320 } else {
321 occs .shrink (occs .size());
322 dirty .shrink_(dirty .size());
323 dirties.shrink_(dirties.size());
324 }
325 }
Here is the call graph for this function:

◆ init()

template<class Idx, class Vec, class Deleted>
void Gluco2::OccLists< Idx, Vec, Deleted >::init ( const Idx & idx)
inline

Definition at line 300 of file SolverTypes.h.

300{ occs.growTo(toInt(idx)+1); dirty.growTo(toInt(idx)+1, 0); }
Here is the call graph for this function:

◆ lookup()

template<class Idx, class Vec, class Deleted>
Vec & Gluco2::OccLists< Idx, Vec, Deleted >::lookup ( const Idx & idx)
inline

Definition at line 304 of file SolverTypes.h.

304{ if (dirty[toInt(idx)]) clean(idx); return occs[toInt(idx)]; }
Here is the call graph for this function:

◆ operator[]()

template<class Idx, class Vec, class Deleted>
Vec & Gluco2::OccLists< Idx, Vec, Deleted >::operator[] ( const Idx & idx)
inline

Definition at line 303 of file SolverTypes.h.

303{ return occs[toInt(idx)]; }
Here is the call graph for this function:

◆ prelocate()

template<class Idx, class Vec, class Deleted>
void Gluco2::OccLists< Idx, Vec, Deleted >::prelocate ( const int num)
inline

Definition at line 301 of file SolverTypes.h.

301{ occs.prelocate(num); dirty.prelocate(num); }

◆ smudge()

template<class Idx, class Vec, class Deleted>
void Gluco2::OccLists< Idx, Vec, Deleted >::smudge ( const Idx & idx)
inline

Definition at line 308 of file SolverTypes.h.

308 {
309 if (dirty[toInt(idx)] == 0){
310 dirty[toInt(idx)] = 1;
311 dirties.push(idx);
312 }
313 }
Here is the call graph for this function:

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