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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user