25 #include "ngraph/ngraph_visibility.hpp"
39 using value_type = std::int64_t;
40 using size_type = std::uint64_t;
48 Interval(value_type min_val, value_type max_val);
71 bool operator!=(
const Interval& interval)
const;
104 static constexpr value_type s_max{std::numeric_limits<value_type>::max()};
108 static value_type clip(value_type value);
109 static value_type clip_times(value_type a, value_type b);
110 static value_type clip_add(value_type a, value_type b);
111 static value_type clip_minus(value_type a, value_type b);
113 value_type m_min_val{0};
114 value_type m_max_val{s_max};
118 std::ostream& operator<<(std::ostream& str,
const Interval& interval);
Interval arithmetic.
Definition: interval.hpp:37
Interval operator-(const Interval &interval) const
The interval whose elements are a difference of an element from each interval.
Interval operator+(const Interval &interval) const
The interval whose elements are a sum of an element from each interval.
bool contains(const Interval &interval) const
True if this interval includes all the values in interval.
void set_min_val(value_type val)
Set the inclusive lower bound of the interval.
Definition: interval.hpp:62
Interval operator*(const Interval &interval) const
The smallest interval whose elements are a product of an element from each interval.
value_type get_min_val() const
the inclusive lower bound of the interval
Definition: interval.hpp:60
Interval(value_type min_val, value_type max_val)
Closed interval {x|min_val <= x <= max_val}.
Interval(value_type val)
Single-valued interval; just contains val.
bool empty() const
Returns true if the interval has no elements.
Interval operator&(const Interval &interval) const
The interval that is the intersection of this interval and interval.
Interval & operator-=(const Interval &interval)
Extend this interval to differences of elements in this interval and interval.
bool has_upper_bound() const
True if the upper bound is finite.
Definition: interval.hpp:68
size_type size() const
The number of elements in the interval. Zero if max < min.
bool contains(value_type value) const
True if this interval includes value.
Interval()=default
Interval of everything.
Interval & operator*=(const Interval &interval)
Extend this interval to products of elements in this interval and interval.
Interval & operator&=(const Interval &interval)
Change this interval to only include elements also in interval.
bool operator==(const Interval &interval) const
True if min and max bounds match.
void set_max_val(value_type val)
Set the inclusive upper bound of the interval.
Definition: interval.hpp:66
Interval(const Interval &interval)=default
Copy constructor.
Interval & operator+=(const Interval &interval)
Extend this interval to sums of elements in this interval and interval.
value_type get_max_val() const
the inclusive upper bound of the interval
Definition: interval.hpp:64
The Intel nGraph C++ API.
Definition: attribute_adapter.hpp:28