libipa: pwl: Add clear() function
Sometimes it is necessary to clear a pwl. Add a function for that. Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
This commit is contained in:
parent
3c653f3f65
commit
3acacb089d
2 changed files with 6 additions and 0 deletions
|
@ -159,6 +159,11 @@ void Pwl::prepend(double x, double y, const double eps)
|
||||||
* \return True if there are no points in the function, false otherwise
|
* \return True if there are no points in the function, false otherwise
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \fn Pwl::clear()
|
||||||
|
* \brief Clear the piecewise linear function
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \fn Pwl::size() const
|
* \fn Pwl::size() const
|
||||||
* \brief Retrieve the number of points in the piecewise linear function
|
* \brief Retrieve the number of points in the piecewise linear function
|
||||||
|
|
|
@ -49,6 +49,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 { return points_.empty(); }
|
bool empty() const { return points_.empty(); }
|
||||||
|
void clear() { points_.clear(); }
|
||||||
size_t size() const { return points_.size(); }
|
size_t size() const { return points_.size(); }
|
||||||
|
|
||||||
Interval domain() const;
|
Interval domain() const;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue