#include <reluctant.hpp>
Definition at line 28 of file reluctant.hpp.
◆ Reluctant()
| CaDiCaL::Reluctant::Reluctant |
( |
| ) |
|
|
inline |
Definition at line 35 of file reluctant.hpp.
35: period (0), trigger (false) {}
◆ disable()
| void CaDiCaL::Reluctant::disable |
( |
| ) |
|
|
inline |
Definition at line 48 of file reluctant.hpp.
48{ period = 0, trigger = false; }
◆ enable()
| void CaDiCaL::Reluctant::enable |
( |
int | p, |
|
|
int64_t | l ) |
|
inline |
Definition at line 37 of file reluctant.hpp.
37 {
39 u = v = 1;
40 period = countdown =
p;
41 trigger = false;
42 if (l <= 0)
43 limited = false;
44 else
45 limited = true, limit = l;
46 };
#define CADICAL_assert(ignore)
◆ operator bool()
| CaDiCaL::Reluctant::operator bool |
( |
| ) |
|
|
inline |
Definition at line 76 of file reluctant.hpp.
76 {
77 if (!trigger)
78 return false;
79 trigger = false;
80 return true;
81 }
◆ tick()
| void CaDiCaL::Reluctant::tick |
( |
| ) |
|
|
inline |
Definition at line 56 of file reluctant.hpp.
56 {
57
58 if (!period)
59 return;
60 if (trigger)
61 return;
62 if (--countdown)
63 return;
64
65 if ((u & -u) == v)
66 u = u + 1, v = 1;
67 else
68 v = 2 * v;
69
70 if (limited && v >= limit)
71 u = v = 1;
72 countdown = v * period;
73 trigger = true;
74 }
The documentation for this class was generated from the following file: