mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-24 00:55:07 +03:00
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>
This commit is contained in:
parent
6c735ab8e2
commit
e127e63c93
2 changed files with 7 additions and 10 deletions
|
@ -182,6 +182,12 @@ void Pwl::prepend(double x, double y, const double eps)
|
||||||
points_.insert(points_.begin(), Point({ x, y }));
|
points_.insert(points_.begin(), Point({ x, y }));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \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
|
* \brief Get the domain of the piecewise linear function
|
||||||
* \return An interval representing the domain
|
* \return An interval representing the domain
|
||||||
|
@ -203,15 +209,6 @@ Pwl::Interval Pwl::range() const
|
||||||
return Interval(lo, hi);
|
return Interval(lo, hi);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* \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
|
* \brief Evaluate the piecewise linear function
|
||||||
* \param[in] x The x value to input into the function
|
* \param[in] x The x value to input into the function
|
||||||
|
|
|
@ -51,7 +51,7 @@ public:
|
||||||
|
|
||||||
void append(double x, double y, double eps = 1e-6);
|
void append(double x, double y, double eps = 1e-6);
|
||||||
|
|
||||||
bool empty() const;
|
bool empty() const { return points_.empty(); }
|
||||||
Interval domain() const;
|
Interval domain() const;
|
||||||
Interval range() const;
|
Interval range() const;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue