ipa: raspberrypi: histogram: Add a constructor for an empty histogram

Add a default constructor to the RPiController::Histogram class that creates
an empty histogram. Since this is a cumulative histogram, push a value of 0 into
the first (and only) bin to signify this.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Naushir Patuck
2023-02-03 09:17:31 +00:00
committed by Kieran Bingham
parent 312bd707bd
commit f0c0468b3b
@@ -20,6 +20,11 @@ namespace RPiController {
class Histogram
{
public:
Histogram()
{
cumulative_.push_back(0);
}
template<typename T> Histogram(T *histogram, int num)
{
assert(num);