Moves implementation of piecewise_function::evaluate(u) from h to cpp to prevent massive rebuilds everytime the function is changed.

This commit is contained in:
Richard Brice
2023-10-25 11:44:19 -07:00
parent dd915736f5
commit 0aa69a6ebf
2 changed files with 11 additions and 9 deletions
+1 -9
View File
@@ -151,15 +151,7 @@ typedef item const* ptr;
virtual item::ptr evaluate() const;
Eigen::Matrix4d evaluate(double u) const {
// @todo: rb optimize, assume monotonic evaluation and store last evaluated segment?
for (auto& [length, fn] : spans) {
if (u < length+0.001) { // @todo: rb - need to use consistent tolerance
return fn(u);
}
u -= length;
}
}
Eigen::Matrix4d evaluate(double u) const;
};
#ifdef TAXONOMY_USE_SHARED_PTR