50 virtual double getDifference(
const double* y,
double x)
const{
return getValue(y, x) - goal_;}
56 virtual double getValue(
const double* y,
double x)
const = 0;
61 void setRepeatCount(
int repeatCount) { repeatCount_ = repeatCount; }
66 void setDirection(EDirection direction) { direction_ = direction; }
71 void setThreshold(
double threshold) { threshold_ = threshold; }
76 void setGoal(
double goal) { goal_ = goal; }
81 EDirection direction_{eBoth};
82 double threshold_{1e-10};
88template<
typename Func>
93 : func_(std::move(func))
96 double getValue(
const double* y,
double x)
const override {
泛型ODE积分的事件检测器
定义 ODEEventDetector.hpp:90
double getValue(const double *y, double x) const override
用于事件检测的开关函数值
定义 ODEEventDetector.hpp:96
ODE积分的事件检测器
定义 ODEEventDetector.hpp:33
virtual double getValue(const double *y, double x) const =0
用于事件检测的开关函数值
EDirection getDirection() const
事件检测开关函数的方向
定义 ODEEventDetector.hpp:65
virtual double getDifference(const double *y, double x) const
用于事件检测的开关函数与目标值的差值
定义 ODEEventDetector.hpp:50
double getGoal() const
事件检测的目标值
定义 ODEEventDetector.hpp:75
double getThreshold() const
事件检测开关函数的阈值
定义 ODEEventDetector.hpp:70
int getRepeatCount() const
事件触发后的重复次数
定义 ODEEventDetector.hpp:60
EDirection
事件检测开关函数的条件
定义 ODEEventDetector.hpp:37