Skip to content
Snippets Groups Projects
Commit a23766d9 authored by Timo Koch's avatar Timo Koch
Browse files

[common][spline] Move assert checking requirements to updatePoints

parent 2de0b751
No related branches found
No related tags found
1 merge request!2250[common] Add inverse of monotone cubic spline
...@@ -64,11 +64,6 @@ public: ...@@ -64,11 +64,6 @@ public:
*/ */
MonotoneCubicSpline(const std::vector<Scalar>& x, const std::vector<Scalar>& y) MonotoneCubicSpline(const std::vector<Scalar>& x, const std::vector<Scalar>& y)
{ {
// check some requirements
assert (x.size() == y.size());
assert (x.size() >=2);
assert (std::is_sorted(x.begin(), x.end()));
updatePoints(x, y); updatePoints(x, y);
} }
...@@ -79,6 +74,11 @@ public: ...@@ -79,6 +74,11 @@ public:
*/ */
void updatePoints(const std::vector<Scalar>& x, const std::vector<Scalar>& y) void updatePoints(const std::vector<Scalar>& x, const std::vector<Scalar>& y)
{ {
// check some requirements
assert (x.size() == y.size());
assert (x.size() >=2);
assert (std::is_sorted(x.begin(), x.end()));
// save a copy of the control points // save a copy of the control points
x_ = x; x_ = x;
y_ = y; y_ = y;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment