// // 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 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 &sources, const std::vector &weights); /*! @returns The weighted sum of all sources. */ float get_confidence() final; private: const std::vector sources_; const std::vector weights_; float weight_sum_; }; }