cMHN 1.2
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
mean.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_VALUE_FUNCTIONS_MEAN_H
4#define pRC_CORE_VALUE_FUNCTIONS_MEAN_H
5
11
12namespace pRC
13{
14 template<class... Xs>
15 requires IsInvocable<Fold<Add>, Xs...>
16 static inline constexpr auto mean(Xs &&...args)
17 {
19 return fold<Add>(forward<Xs>(args)...) /
20 identity<Value<R>>(sizeof...(args));
21 }
22}
23#endif // pRC_CORE_VALUE_FUNCTIONS_MEAN_H
Definition cholesky.hpp:10
static constexpr decltype(auto) fold(X &&a)
Definition fold.hpp:14
RemoveConst< RemoveReference< T > > RemoveConstReference
Definition basics.hpp:47
static constexpr auto identity()
Definition identity.hpp:13
static constexpr auto mean(Xs &&...args)
Definition mean.hpp:16