16 #ifndef SURGSIM_MATH_INTERVALARITHMETIC_H 17 #define SURGSIM_MATH_INTERVALARITHMETIC_H 59 Interval(
const T& min,
const T& max);
198 template <
class T,
int N>
202 static_assert(N >= 1,
"IntervalND<T, N> cannot be instantiated with N<=0.");
222 IntervalND(
const std::array<T, N>& a,
const std::array<T, N>& b);
297 std::array<Interval<T>, N> m_interval;
345 IntervalND(
const std::array<T, 3>& a,
const std::array<T, 3>& b);
424 std::array<Interval<T>, 3> m_interval;
433 template <
typename T>
440 template <
typename T>
448 template <
typename T>
449 std::ostream& operator<< (std::ostream& o, const Interval<T>& interval);
522 template <
typename T,
int N>
523 std::ostream& operator<< (std::ostream& o, const IntervalND<T, N>& interval);
566 #include "SurgSim/Math/IntervalArithmetic-inl.h" 568 #endif // SURGSIM_MATH_INTERVALARITHMETIC_H Interval< T > & operator=(const Interval< T > &i)
Assignment operator.
Definition: IntervalArithmetic-inl.h:46
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
T getMin() const
Definition: IntervalArithmetic-inl.h:283
bool isApprox(const Interval< T > &i, const T &epsilon) const
Definition: IntervalArithmetic-inl.h:104
IntervalND<T,3> defines the concept of a group of mathematical intervals specialized to 3 intervals a...
Definition: IntervalArithmetic.h:307
Interval< T > upperHalf() const
Definition: IntervalArithmetic-inl.h:301
T getMax() const
Definition: IntervalArithmetic-inl.h:289
friend void IntervalArithmetic_addsub(const Interval< P > &a, const Interval< P > &b, Interval< P > *res)
Add the difference of two intervals to an existing value.
Interval< T > inverse() const
Definition: IntervalArithmetic-inl.h:253
IntervalND defines the concept of a group of mathematical intervals and provides operations on them i...
Definition: IntervalArithmetic.h:199
Interval< T > & addThickness(const T &thickness)
Widens the current interval by thickness on both sides.
Definition: IntervalArithmetic-inl.h:122
friend void IntervalArithmetic_addmul(const Interval< P > &a, const Interval< P > &b, Interval< P > *res)
Add the product of two intervals to an existing value.
friend void IntervalArithmetic_sub(const Interval< P > &a, const Interval< P > &b, Interval< P > *res)
Calculate the difference of two intervals.
friend void IntervalArithmetic_add(const Interval< P > &a, const Interval< P > &b, Interval< P > *res)
Calculate the sum of two intervals.
Interval< T > & operator/=(const Interval< T > &i)
Definition: IntervalArithmetic-inl.h:267
bool operator!=(const Interval< T > &i) const
Definition: IntervalArithmetic-inl.h:116
friend void IntervalArithmetic_submul(const Interval< P > &a, const Interval< P > &b, Interval< P > *res)
Subtract the product of two intervals from an existing value.
friend void IntervalArithmetic_mul(const Interval< P > &a, const Interval< P > &b, Interval< P > *res)
Calculate the product of two intervals.
Interval< T > operator+(const Interval< T > &i) const
Definition: IntervalArithmetic-inl.h:158
Interval< T > & extendToInclude(const T &x)
Widens the current interval on one end to include x.
Definition: IntervalArithmetic-inl.h:130
bool operator==(const Interval< T > &i) const
Definition: IntervalArithmetic-inl.h:110
bool overlapsWith(const Interval< T > &i) const
Definition: IntervalArithmetic-inl.h:86
Interval defines the concept of a mathematical interval and provides operations on it including arith...
Definition: IntervalArithmetic.h:34
friend void IntervalArithmetic_addadd(const Interval< P > &a, const Interval< P > &b, Interval< P > *res)
Calculate the sum of three intervals res + a + b.
Interval()
Constructor.
Definition: IntervalArithmetic-inl.h:27
bool contains(const T &val) const
Definition: IntervalArithmetic-inl.h:92
Interval< T > operator/(const Interval< T > &i) const
Definition: IntervalArithmetic-inl.h:261
Interval< T > square() const
Definition: IntervalArithmetic-inl.h:273
bool containsZero() const
Definition: IntervalArithmetic-inl.h:98
static Interval< T > minToMax(const T &a1, const T &a2)
Generate an interval from min to max based on the inputs.
Definition: IntervalArithmetic-inl.h:62
Interval< T > lowerHalf() const
Definition: IntervalArithmetic-inl.h:295