diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2024-06-13 03:21:46 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2024-06-16 03:28:25 +0300 |
commit | e127e63c93f8d04de0a564eae5e5cb40b80260f5 (patch) | |
tree | 6c3d0e528e27d498cf3c517508046d92eae4b076 /src/ipa/libipa/pwl.cpp | |
parent | 6c735ab8e2387f26e3c4d1a2e4d55c127ca7d1fa (diff) |
ipa: libipa: pwl: Make the empty() function inline
The Pwl::empty() function is a one-liner that can be easily optimized by
the compiler given the chance. Make it inline.
While at it, move the function documentation block to match the class
declaration order.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/ipa/libipa/pwl.cpp')
-rw-r--r-- | src/ipa/libipa/pwl.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/ipa/libipa/pwl.cpp b/src/ipa/libipa/pwl.cpp index 1ba01085..d8ea92be 100644 --- a/src/ipa/libipa/pwl.cpp +++ b/src/ipa/libipa/pwl.cpp @@ -183,6 +183,12 @@ void Pwl::prepend(double x, double y, const double eps) } /** + * \fn Pwl::empty() const + * \brief Check if the piecewise linear function is empty + * \return True if there are no points in the function, false otherwise + */ + +/** * \brief Get the domain of the piecewise linear function * \return An interval representing the domain */ @@ -204,15 +210,6 @@ Pwl::Interval Pwl::range() const } /** - * \brief Check if the piecewise linear function is empty - * \return True if there are no points in the function, false otherwise - */ -bool Pwl::empty() const -{ - return points_.empty(); -} - -/** * \brief Evaluate the piecewise linear function * \param[in] x The x value to input into the function * \param[inout] span Initial guess for span |