|
🛰️航天仿真算法库 SpaceAST 0.0.1
|
#include <Interval.hpp>
Public 成员函数 | |
| double | start () const |
| double | stop () const |
| double & | start () |
| double & | stop () |
| double | duration () const |
| bool | isEmpty () const |
| bool | isPoint () const |
| bool | isDegenerate () const |
| bool | isValid () const |
| bool | isNonEmpty () const |
| bool | contains (double t) const |
| void | setBounds (double start, double stop) |
| void | setEmpty () |
| void | setWhole () |
| DoubleRange | discretize (double step) const |
| size_t | discretizedCount (double step) const |
| Interval & | unite (const Interval &other) |
| Interval | united (const Interval &other) const |
| Interval & | intersect (const Interval &other) |
| Interval | intersected (const Interval &other) const |
| bool | intersects (const Interval &other) const |
| Interval & | operator|= (const Interval &other) |
| Interval | operator| (const Interval &other) const |
| Interval & | operator&= (const Interval &other) |
| Interval | operator& (const Interval &other) const |
静态 Public 成员函数 | |
| static Interval | Empty () |
Public 属性 | |
| double | start_ |
| double | stop_ |
相对时间区间
相对时间区间类,用于表示时间区间的开始时间和结束时间
|
inline |
将相对时间区间离散化
对 [start, stop] 闭区间按 step 步长采样,返回惰性可迭代的秒偏移范围。 内部相邻点间距恒为 step,但末尾强制把 stop 并入输出(最后一段间距可能 小于 step),因此并非均匀网格。当 step <= 0.0 或区间为空(isEmpty())时 返回空范围;点区间(start == stop)返回 1 个采样点。
| step | 离散化步长(秒) |
|
inline |
计算离散化采样点数量
返回 discretize(step) 所生成的采样点数(含首尾端点)。当 step > 0.0 且区间非空(!isEmpty())时为 ceil(duration()/step) + 1, 点区间(start == stop)返回 1,否则返回 0。
| step | 离散化步长(秒) |
原地交集
| other | 另一个时间区间 |
交集(返回副本)
| other | 另一个时间区间 |
|
inline |
判断两个区间是否相交(非空交集,含仅相切产生的点区间)
| other | 另一个时间区间 |
|
inline |
原地并集:将另一个区间并入自身(凸包)
| other | 另一个时间区间 |
并集(返回副本):凸包
| other | 另一个时间区间 |