AI 24/25 Project Software
Documentation for the AI 24/25 course programming project software
Loading...
Searching...
No Matches
interval.h
1#ifndef PROBFD_VALUE_UTILS_H
2#define PROBFD_VALUE_UTILS_H
3
4#include "probfd/value_type.h"
5
6#include <iosfwd>
7
8namespace probfd {
9
12struct Interval {
15
17 explicit Interval(value_t val = 0_vt);
18
20 explicit Interval(value_t lb, value_t ub);
21
24
26 Interval& operator*=(value_t scale_factor);
27
30 [[nodiscard]]
31 double length() const;
32
38 [[nodiscard]]
40};
41
50
59
64
66std::ostream& operator<<(std::ostream& os, Interval val);
67
68} // namespace probfd
69
70#endif // PROBFD_VALUE_UTILS_H
The top-level namespace of probabilistic Fast Downward.
Definition command_line.h:8
Interval operator*(value_t scale_factor, Interval val)
Scales an interval.
double value_t
Typedef for the state value type.
Definition aliases.h:7
Interval operator+(Interval lhs, Interval rhs)
Computes the component-wise addition of two intervals.
std::ostream & operator<<(std::ostream &os, Interval val)
Stream output operator. Prints '[<val.lower>,<val.upper>]'.
value_t g_epsilon
The default tolerance value for approximate comparisons.
Represents a closed interval over the extended reals as a pair of lower and upper bound.
Definition interval.h:12
bool bounds_approximately_equal(value_t tolerance=g_epsilon) const
Checks if the length is below a given tolerance.
double length() const
Returns the length of the interval. If both bounds are infinity and have the same sign,...
value_t lower
The Lower bound of the interval.
Definition interval.h:13
value_t upper
The upper bound of the interval.
Definition interval.h:14
Interval(value_t val=0_vt)
Constructs an interval consisting of a single point p.
Interval(value_t lb, value_t ub)
Constructs an interval from a specified lower and upper bound.
Interval & operator*=(value_t scale_factor)
Equivalent to *this = factor * (*this)
Interval & operator+=(Interval rhs)
Equivalent to *this = *this + rhs.