| 571 | } |
| 572 | |
| 573 | void FactorGraph::removeFactorsOutsideWindow(const FactorType CurrentFactorType, const double TimeWindow, const double CurrentTime) |
| 574 | { |
| 575 | /** find start of the existing factors */ |
| 576 | double FirstTime; |
| 577 | _Structure.getTimeFirst(CurrentFactorType, FirstTime); |
| 578 | |
| 579 | /** calculate cut-off time */ |
| 580 | const double TimeWindowEnd = roundToTick(CurrentTime - TimeWindow); |
| 581 | |
| 582 | /** remove factors one by one */ |
| 583 | if (TimeWindowEnd >= FirstTime) |
| 584 | { |
| 585 | /** get relevant Timestamps */ |
| 586 | std::vector<double> Timestamps; |
| 587 | _Structure.getTimesBelow(CurrentFactorType, TimeWindowEnd, Timestamps); |
| 588 | |
| 589 | /** remove all */ |
| 590 | for (const double &Time : Timestamps) |
| 591 | { |
| 592 | this->removeFactor(CurrentFactorType, Time); |
| 593 | } |
| 594 | } |
| 595 | } |
| 596 | |
| 597 | void FactorGraph::removeAllFactorsOutsideWindow(const double TimeWindow, const double CurrentTime) |
| 598 | { |
nothing calls this directly
no test coverage detected