2
0
mirror of https://github.com/boostorg/math.git synced 2026-01-19 04:22:09 +00:00

Fix invalid read in cubic Hermite. [CI SKIP]

This commit is contained in:
Nick
2020-03-22 11:22:36 -04:00
parent bc70b99553
commit 5cbfdb554a
6 changed files with 164 additions and 14 deletions

View File

@@ -29,6 +29,8 @@ LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
void push_back(Real x, Real y, Real dydx);
std::pair<Real, Real> domain() const;
friend std::ostream& operator<<(std::ostream & os, const cubic_hermite & m);
};
@@ -42,6 +44,8 @@ LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
inline Real operator()(Real x) const;
inline Real prime(Real x) const;
std::pair<Real, Real> domain() const;
};
@@ -56,6 +60,8 @@ LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
inline Real operator()(Real x) const;
inline Real prime(Real x) const;
std::pair<Real, Real> domain() const;
};
} // namespaces
@@ -124,6 +130,10 @@ For the "array of structs" version:
auto ch = cardinal_cubic_hermite_aos(std::move(data), x0, dx);
For a quick sanity check, we can call `ch.domain()`:
auto [x_min, x_max] = ch.domain();
[heading Performance]
Google benchmark was used to evaluate the performance.