Commit 7f8ae09c authored by Pierre Fernbach's avatar Pierre Fernbach
Browse files

[Polynomial] from boundary condition: correctly check that t_min < t_max

parent 2ada9cb7
Pipeline #8258 passed with stage
in 12 minutes and 49 seconds
......@@ -106,6 +106,7 @@ struct polynomial : public curve_abc<Time, Numeric, Safe, Point> {
///
polynomial(const Point& init, const Point& end, const time_t min, const time_t max)
: dim_(init.size()), degree_(1), T_min_(min), T_max_(max) {
if (T_min_ >= T_max_) throw std::invalid_argument("T_min must be strictly lower than T_max");
if (init.size() != end.size()) throw std::invalid_argument("init and end points must have the same dimensions.");
t_point_t coeffs;
coeffs.push_back(init);
......@@ -127,6 +128,7 @@ struct polynomial : public curve_abc<Time, Numeric, Safe, Point> {
polynomial(const Point& init, const Point& d_init, const Point& end, const Point& d_end, const time_t min,
const time_t max)
: dim_(init.size()), degree_(3), T_min_(min), T_max_(max) {
if (T_min_ >= T_max_) throw std::invalid_argument("T_min must be strictly lower than T_max");
if (init.size() != end.size()) throw std::invalid_argument("init and end points must have the same dimensions.");
if (init.size() != d_init.size())
throw std::invalid_argument("init and d_init points must have the same dimensions.");
......@@ -170,6 +172,7 @@ struct polynomial : public curve_abc<Time, Numeric, Safe, Point> {
polynomial(const Point& init, const Point& d_init, const Point& dd_init, const Point& end, const Point& d_end,
const Point& dd_end, const time_t min, const time_t max)
: dim_(init.size()), degree_(5), T_min_(min), T_max_(max) {
if (T_min_ >= T_max_) throw std::invalid_argument("T_min must be strictly lower than T_max");
if (init.size() != end.size()) throw std::invalid_argument("init and end points must have the same dimensions.");
if (init.size() != d_init.size())
throw std::invalid_argument("init and d_init points must have the same dimensions.");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment