Skip to content
Snippets Groups Projects
Commit f7ed56f9 authored by Raphael Grimm's avatar Raphael Grimm
Browse files

Add SimpleAbstractFunctionRNRM and LineStripR1RM

parent efc8b026
No related branches found
No related tags found
No related merge requests found
......@@ -34,14 +34,17 @@ namespace math
public:
using point_t = Eigen::Matrix<float, M, 1>;
int Count() { return points.size(); }
int Count() const { return points.size(); }
LineStripR1RM(std::vector<point_t> points, float minT, float maxT)
: points(std::move(points)), minT(minT), maxT(maxT)
{}
bool InLimits(float t);
point_t Get(float t) override
bool InLimits(float t) const
{
return t >= minT && t <= maxT;
}
point_t Get(float t) const override
{
int i; float f;
GetIndex(t, i, f);
......@@ -49,11 +52,11 @@ namespace math
}
private:
point_t GetDirection(int i)
point_t GetDirection(int i) const
{
return points.at(i+1) - points.at(i);
}
void GetIndex(float t, int& i, float& f)
void GetIndex(float t, int& i, float& f) const
{
Helpers::GetIndex(t, minT, maxT, points.size(), i, f);
}
......
......@@ -32,7 +32,7 @@ namespace math
public:
using in_t = Eigen::Matrix<float, N, 1>;
using out_t = Eigen::Matrix<float, M, 1>;
virtual out_t Get(in_t t) = 0;
virtual out_t Get(in_t t) const = 0;
private:
};
......@@ -42,7 +42,7 @@ namespace math
public:
using in_t = float;
using out_t = Eigen::Matrix<float, M, 1>;
virtual out_t Get(in_t t) = 0;
virtual out_t Get(in_t t) const = 0;
private:
};
......
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