lossless
compression_safeguards.safeguards.pointwise.lossless
Lossless reconstruction safeguard.
Classes:
-
LosslessSafeguard–The
LosslessSafeguardguarantees that all elements are reconstructed
LosslessSafeguard
LosslessSafeguard()
Bases: PointwiseSafeguard
The LosslessSafeguard guarantees that all elements are reconstructed
exactly, i.e. losslessly.
This safeguard is an alternative to using a zero error bound safeguard.
This safeguards can be used with the
SelectSafeguard to express
regions that are of extra special interest and must be kept exactly the
same.
Methods:
-
check_pointwise–Check for which elements the
dataandapproximationare bitwise -
compute_safe_intervals–The safe intervals for each element in the
dataarray only contain -
compute_footprint–Compute the footprint of the
footarray, e.g. for expanding data -
compute_inverse_footprint–Compute the inverse footprint of the
footarray, e.g. for expanding -
get_config–Returns the configuration of the safeguard.
late_bound
property
The set of late-bound parameters that this safeguard has.
Late-bound parameters are only bound when checking and applying the safeguard, in contrast to the normal early-bound parameters that are configured during safeguard initialisation.
Late-bound parameters can be used for parameters that depend on the specific data that is to be safeguarded.
check_pointwise
check_pointwise(
data: ndarray[S, dtype[T]],
approximation: ndarray[S, dtype[T]],
*,
late_bound: Bindings,
where: Literal[True] | ndarray[S, dtype[bool]] = True,
) -> ndarray[S, dtype[bool]]
Check for which elements the data and approximation are bitwise
equivalent.
| Parameters: |
|
|---|
| Returns: |
|---|
compute_safe_intervals
compute_safe_intervals(
data: ndarray[S, dtype[T]],
*,
late_bound: Bindings,
where: Literal[True] | ndarray[S, dtype[bool]] = True,
) -> IntervalUnion[T, int, int]
The safe intervals for each element in the data array only contain
this element.
| Parameters: |
|
|---|
| Returns: |
|
|---|
compute_footprint
compute_footprint(
foot: ndarray[S, dtype[bool]],
*,
late_bound: Bindings,
where: Literal[True] | ndarray[S, dtype[bool]] = True,
) -> ndarray[S, dtype[bool]]
Compute the footprint of the foot array, e.g. for expanding data
points into the pointwise checks that they contribute to.
The footprint is equivalent to foot & where.
| Parameters: |
|
|---|
| Returns: |
|---|
compute_inverse_footprint
compute_inverse_footprint(
foot: ndarray[S, dtype[bool]],
*,
late_bound: Bindings,
where: Literal[True] | ndarray[S, dtype[bool]] = True,
) -> ndarray[S, dtype[bool]]
Compute the inverse footprint of the foot array, e.g. for expanding
pointwise check fails into the points that could have contributed to
the failures.
The inverse footprint is equivalent to foot & where.
| Parameters: |
|
|---|
| Returns: |
|---|