Go to the documentation of this file.
26 template <
typename RangeType>
bool isRangeValid(RangeType
const &range)
35 template <
typename RangeType>
bool isRangeEmpty(RangeType
const &range)
37 return isRangeValid(range) && (range.minimum == range.maximum);
46 template <
typename RangeType,
typename RangeBaseType>
49 return (range.minimum <= value) && (value <= range.maximum);
58 template <
typename RangeType>
bool isRangeContained(RangeType
const &left, RangeType
const &right)
60 return (left.minimum <= right.minimum) && (right.maximum <= left.maximum);
69 template <
typename RangeType>
bool doRangesOverlap(RangeType
const &left, RangeType
const &right)
81 template <
typename RangeType>
bool areRangesDisjunct(RangeType
const &left, RangeType
const &right)
83 return !doRangesOverlaps(left, right);
92 template <
typename RangeType>
bool doesRangePredate(RangeType
const &left, RangeType
const &right)
94 return left.maximum == right.minimum;
103 template <
typename RangeType>
bool doesRangeSucceed(RangeType
const &left, RangeType
const &right)
105 return left.minimum == right.maximum;
116 template <
typename RangeType>
bool extendRangeWith(RangeType &left, RangeType
const &right)
120 left.maximum = right.maximum;
125 left.minimum = right.minimum;
140 template <
typename RangeType> RangeType
getUnionRange(RangeType
const &left, RangeType
const &right)
143 result.minimum = std::min(left.minimum, right.minimum);
144 result.maximum = std::max(left.maximum, right.maximum);
154 template <
typename RangeType,
typename RangeBaseType>
158 result.minimum = std::min(left.minimum, value);
159 result.maximum = std::max(left.maximum, value);
169 template <
typename RangeType>
bool unionRangeWith(RangeType &left, RangeType
const &right)
181 template <
typename RangeType,
typename RangeBaseType>
bool unionRangeWith(RangeType &left, RangeBaseType
const &value)
199 result.minimum = std::max(left.minimum, right.minimum);
200 result.maximum = std::min(left.maximum, right.maximum);
namespace ad
Definition: Acceleration.hpp:30
bool isWithinRange(RangeType const &range, RangeBaseType const &value)
Checks if value of RangeBaseType is within range.
Definition: RangeOperation.hpp:47
::ad::physics::Speed maximum
Definition: SpeedRange.hpp:121
::ad::physics::ParametricValue maximum
Definition: ParametricRange.hpp:121
bool doRangesOverlap(RangeType const &left, RangeType const &right)
Checks left range overlaps right one.
Definition: RangeOperation.hpp:69
bool unionRangeWith(RangeType &left, RangeType const &right)
Definition: RangeOperation.hpp:169
bool operator<(ad::physics::ParametricRange const &left, ad::physics::ParametricRange const &right)
Comparison operator for range based types.
Definition: RangeOperation.hpp:249
bool isRangeContained(RangeType const &left, RangeType const &right)
Checks if right range is contained in left one.
Definition: RangeOperation.hpp:58
RangeType getUnionRange(RangeType const &left, RangeType const &right)
Calculate union of left and right range.
Definition: RangeOperation.hpp:140
::ad::physics::Speed minimum
Definition: SpeedRange.hpp:116
bool operator>(ad::physics::ParametricRange const &left, ad::physics::ParametricRange const &right)
Comparison operator for range based types.
Definition: RangeOperation.hpp:227
bool areRangesDisjunct(RangeType const &left, RangeType const &right)
Checks left range is disjunct from right one.
Definition: RangeOperation.hpp:81
bool operator<=(ad::physics::ParametricRange const &left, ad::physics::ParametricRange const &right)
Comparison operator for range based types.
Definition: RangeOperation.hpp:260
bool extendRangeWith(RangeType &left, RangeType const &right)
Extends left range with right one. Direction of extension depends of the relative position of ranges.
Definition: RangeOperation.hpp:116
bool doesRangeSucceed(RangeType const &left, RangeType const &right)
Checks if left range comes directly after right one.
Definition: RangeOperation.hpp:103
RangeType getIntersectionRange(RangeType const &left, RangeType const &right)
Intersect this range with right one.
Definition: RangeOperation.hpp:194
DataType SpeedRange.
Definition: SpeedRange.hpp:39
bool doesRangePredate(RangeType const &left, RangeType const &right)
Checks if left range comes directly before right one.
Definition: RangeOperation.hpp:92
bool intersectRangeWith(RangeType &left, RangeType const &right)
Intersect left range with right one and store intersection in left.
Definition: RangeOperation.hpp:212
bool operator>=(ad::physics::ParametricRange const &left, ad::physics::ParametricRange const &right)
Comparison operator for range based types.
Definition: RangeOperation.hpp:238
::ad::physics::Distance minimum
Definition: MetricRange.hpp:116
bool isRangeValid(RangeType const &range)
Definition: RangeOperation.hpp:26
::ad::physics::ParametricValue minimum
Definition: ParametricRange.hpp:116
DataType MetricRange.
Definition: MetricRange.hpp:39
DataType ParametricRange.
Definition: ParametricRange.hpp:39
::ad::physics::Acceleration minimum
Definition: AccelerationRange.hpp:116
DataType AccelerationRange.
Definition: AccelerationRange.hpp:39
bool isRangeEmpty(RangeType const &range)
Definition: RangeOperation.hpp:35
::ad::physics::Distance maximum
Definition: MetricRange.hpp:121
::ad::physics::Acceleration maximum
Definition: AccelerationRange.hpp:121