|
PPL
0.12.1
|
Traits class for the deterministic timeout mechanism. More...
#include <globals.defs.hh>
Public Types | |
| typedef unsigned long long | Threshold |
| The type used to specify thresholds for computational weight. | |
| typedef unsigned long long | Delta |
| The type used to specify increments of computational weight. | |
Static Public Member Functions | |
| static const Threshold & | get () |
| Returns the current computational weight. | |
| static bool | less_than (const Threshold &a, const Threshold &b) |
Compares the two weights a and b. | |
| static Delta | compute_delta (unsigned long unscaled, unsigned scale) |
Computes a Delta value from unscaled and scale. | |
| static void | from_delta (Threshold &threshold, const Delta &delta) |
Sets threshold to be delta units bigger than the current weight. | |
Static Public Attributes | |
| static Threshold | weight = 0 |
| The current computational weight. | |
| static void(* | check_function )(void) |
| A pointer to the function that has to be called when checking the reaching of thresholds. | |
Traits class for the deterministic timeout mechanism.
This abstract base class should be instantiated by those users willing to provide a polynomial upper bound to the time spent by any invocation of a library operator.
Definition at line 105 of file globals.defs.hh.
| typedef unsigned long long Parma_Polyhedra_Library::Weightwatch_Traits::Delta |
The type used to specify increments of computational weight.
Definition at line 110 of file globals.defs.hh.
| typedef unsigned long long Parma_Polyhedra_Library::Weightwatch_Traits::Threshold |
The type used to specify thresholds for computational weight.
Definition at line 107 of file globals.defs.hh.
|
inlinestatic |
Computes a Delta value from unscaled and scale.
, where
is the value of unscaled and
is the value of scale.| unscaled | The value of delta before scaling. |
| scale | The scaling to be applied to unscaled. |
Definition at line 57 of file globals.inlines.hh.
{
if ((std::numeric_limits<Delta>::max() >> scale) < unscaled)
throw std::invalid_argument("PPL::Weightwatch_Traits::"
"compute_delta(u, s):\n"
"values of u and s cause wrap around.");
return static_cast<Delta>(unscaled) << scale;
}
|
inlinestatic |
Sets threshold to be delta units bigger than the current weight.
Definition at line 66 of file globals.inlines.hh.
References weight.
{
threshold = weight + delta;
}
|
inlinestatic |
Returns the current computational weight.
Definition at line 47 of file globals.inlines.hh.
References weight.
{
return weight;
}
|
inlinestatic |
Compares the two weights a and b.
Definition at line 52 of file globals.inlines.hh.
References sizeof_to_bits.
{
return b - a < (1ULL << (sizeof_to_bits(sizeof(Threshold)) - 1));
}
|
static |
A pointer to the function that has to be called when checking the reaching of thresholds.
The pointer can be null if no thresholds are set.
Definition at line 144 of file globals.defs.hh.
Referenced by Parma_Polyhedra_Library::maybe_abandon().
The current computational weight.
Definition at line 136 of file globals.defs.hh.
Referenced by Parma_Polyhedra_Library::Weight_Profiler::end(), from_delta(), and get().