|
Phyth v0.1.0
A dimensional safe C++ header-only mechanics and electromagnetics simulation library.
|
Closed interval [min, max] of physical quantities. More...
#include <Interval.hpp>
Public Member Functions | |
| Interval (Quantity< UnitT > value) noexcept | |
| Construct a zero-length interval containing a single value. | |
| Interval (Quantity< UnitT > min, Quantity< UnitT > max) | |
| Construct a closed interval [min, max]. | |
| bool | Contains (Quantity< UnitT > x) const noexcept |
| Check if a value lies within the interval. | |
| bool | Contains (const Interval &interval) const noexcept |
| Check if another interval is fully contained in this one. | |
| Quantity< UnitT > | GetMinimum () const noexcept |
| Quantity< UnitT > | GetMaximum () const noexcept |
Private Attributes | |
| Quantity< UnitT > | min_ |
| Quantity< UnitT > | max_ |
Closed interval [min, max] of physical quantities.
| UnitT | The unit type of the bounds |
Example: Interval<Meter> temp(200_m, 400_m); if (temp.Contains(300_m)) { ... }
Definition at line 20 of file Interval.hpp.
|
inlinenoexcept |
Construct a zero-length interval containing a single value.
| value | The only value in the interval |
Definition at line 28 of file Interval.hpp.
Construct a closed interval [min, max].
| min | Lower bound (inclusive) |
| max | Upper bound (inclusive) |
| std::invalid_argument | if min > max |
Definition at line 39 of file Interval.hpp.
Check if another interval is fully contained in this one.
| interval | The interval to test |
Definition at line 62 of file Interval.hpp.
|
inlinenoexcept |
Check if a value lies within the interval.
| x | The value to test |
Definition at line 52 of file Interval.hpp.
|
inlinenoexcept |
Definition at line 70 of file Interval.hpp.
|
inlinenoexcept |
Definition at line 67 of file Interval.hpp.
Definition at line 74 of file Interval.hpp.
Definition at line 73 of file Interval.hpp.