1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-19 08:31:11 +00:00
CLK/Analyser/Dynamic/ConfidenceSummary.hpp

42 lines
923 B
C++
Raw Normal View History

//
// ConfidenceSummary.hpp
// Clock Signal
//
// Created by Thomas Harte on 21/01/2018.
// Copyright 2018 Thomas Harte. All rights reserved.
//
#pragma once
#include "ConfidenceSource.hpp"
#include <vector>
2023-05-10 21:02:18 +00:00
namespace Analyser::Dynamic {
/*!
Summaries a collection of confidence sources by calculating their weighted sum.
*/
class ConfidenceSummary: public ConfidenceSource {
public:
/*!
Instantiates a summary that will produce the weighted sum of
@c sources, each using the corresponding entry of @c weights.
Requires that @c sources and @c weights are of the same length.
*/
ConfidenceSummary(
const std::vector<ConfidenceSource *> &sources,
const std::vector<float> &weights);
/*! @returns The weighted sum of all sources. */
float get_confidence() final;
private:
2020-05-10 03:42:42 +00:00
const std::vector<ConfidenceSource *> sources_;
const std::vector<float> weights_;
float weight_sum_;
};
}