[v1,02/11] libipa: pwl: Add clear() function
diff mbox series

Message ID 20250109115412.356768-3-stefan.klug@ideasonboard.com
State New
Headers show
Series
  • Add Bayesian AWB algorithm to libipa and rkisp1
Related show

Commit Message

Stefan Klug Jan. 9, 2025, 11:53 a.m. UTC
Sometimes it is necessary to clear a pwl. Add a function for that.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
---
 src/ipa/libipa/pwl.cpp | 5 +++++
 src/ipa/libipa/pwl.h   | 1 +
 2 files changed, 6 insertions(+)

Comments

Paul Elder Jan. 13, 2025, 10:11 p.m. UTC | #1
On Thu, Jan 09, 2025 at 12:53:53PM +0100, Stefan Klug wrote:
> 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>

> ---
>  src/ipa/libipa/pwl.cpp | 5 +++++
>  src/ipa/libipa/pwl.h   | 1 +
>  2 files changed, 6 insertions(+)
> 
> diff --git a/src/ipa/libipa/pwl.cpp b/src/ipa/libipa/pwl.cpp
> index 88fe2022d66d..3fa005ba92df 100644
> --- a/src/ipa/libipa/pwl.cpp
> +++ b/src/ipa/libipa/pwl.cpp
> @@ -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
>   */
>  
> +/**
> + * \fn Pwl::clear()
> + * \brief Clear the piecewise linear function
> + */
> +
>  /**
>   * \fn Pwl::size() const
>   * \brief Retrieve the number of points in the piecewise linear function
> diff --git a/src/ipa/libipa/pwl.h b/src/ipa/libipa/pwl.h
> index d4ec9f4f18fb..93ced1a39745 100644
> --- a/src/ipa/libipa/pwl.h
> +++ b/src/ipa/libipa/pwl.h
> @@ -49,6 +49,7 @@ public:
>  	void append(double x, double y, double eps = 1e-6);
>  
>  	bool empty() const { return points_.empty(); }
> +	void clear() { points_.clear(); }
>  	size_t size() const { return points_.size(); }
>  
>  	Interval domain() const;
> -- 
> 2.43.0
>

Patch
diff mbox series

diff --git a/src/ipa/libipa/pwl.cpp b/src/ipa/libipa/pwl.cpp
index 88fe2022d66d..3fa005ba92df 100644
--- a/src/ipa/libipa/pwl.cpp
+++ b/src/ipa/libipa/pwl.cpp
@@ -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
  */
 
+/**
+ * \fn Pwl::clear()
+ * \brief Clear the piecewise linear function
+ */
+
 /**
  * \fn Pwl::size() const
  * \brief Retrieve the number of points in the piecewise linear function
diff --git a/src/ipa/libipa/pwl.h b/src/ipa/libipa/pwl.h
index d4ec9f4f18fb..93ced1a39745 100644
--- a/src/ipa/libipa/pwl.h
+++ b/src/ipa/libipa/pwl.h
@@ -49,6 +49,7 @@  public:
 	void append(double x, double y, double eps = 1e-6);
 
 	bool empty() const { return points_.empty(); }
+	void clear() { points_.clear(); }
 	size_t size() const { return points_.size(); }
 
 	Interval domain() const;