Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

separator.inc
Go to the documentation of this file.
1 
29 #pragma once
30 
34 
35 #pragma GCC visibility push(default)
36 namespace abacus {
37 
38 
39 template <class BaseType, class CoType>
42 {
43  if(newCons_.full()) {
44  delete cv;
45  return Full;
46  }
47 
48  if(pool_&&pool_->present(cv)) {
49  delete cv;
50  nDuplications_++;
51  return Duplication;
52  }
53 
54  if(hash_&&find(cv)) {
55  delete cv;
56  nDuplications_++;
57  return Duplication;
58  }
59 
60 
61  newCons_.push(cv);
62  if(hash_)
63  hash_->insert(cv->hashKey(),cv);
64  return Added;
65 }
66 
67 
68 template <class BaseType, class CoType>
70 {
71  if(!hash_)
72  return 0;
73  return hash_->nCollisions();
74 }
75 
76 
77 template <class BaseType, class CoType>
78 bool Separator<BaseType, CoType>::find(BaseType *cv)
79 {
80  int key = cv->hashKey();
81 
82  BaseType **cand = hash_->initializeIteration(key);
83 
84  while(cand) {
85  if (cv->equal(*cand)) return true;
86  cand = hash_->next(key);
87  }
88  return false;
89 }
90 
91 }
92 #pragma GCC visibility pop
abacus::Added
@ Added
Definition: separator.h:41
abacus::Separator::nCollisions
int nCollisions() const
Returns the number of collisions in the hash table.
constraint.h
constraint.
abacus
Definition: ILPClusterPlanarity.h:50
variable.h
variable.
abacus::Full
@ Full
Definition: separator.h:41
abacus::Separator::cutFound
Separator_CUTFOUND cutFound(BaseType *cv)
Passes a cut (constraint or variable) to the buffer.
separator.h
separator.
abacus::Separator_CUTFOUND
Separator_CUTFOUND
Definition: separator.h:41
abacus::Separator::find
bool find(BaseType *cv)
abacus::Duplication
@ Duplication
Definition: separator.h:41
Minisat::Internal::find
static bool find(V &ts, const T &t)
Definition: Alg.h:48