cMHN
1.1
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
pRC
prc
core
value
functions
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
6
#include <
prc/core/basic/type_traits.hpp
>
7
#include <
prc/core/functors/add.hpp
>
8
#include <
prc/core/functors/fold.hpp
>
9
#include <
prc/core/value/functions/div.hpp
>
10
#include <
prc/core/value/functions/fold.hpp
>
11
12
namespace
pRC
13
{
14
template
<
class
...
Xs
,
If<IsInvocable<Fold<Add>
,
Xs
...>> = 0>
15
static
inline
constexpr
auto
mean
(
Xs
&&...
args
)
16
{
17
using
R
=
RemoveConstReference<ResultOf<Fold<Add>
,
Xs
...>>;
18
return
fold<Add>
(forward<Xs>(
args
)...) /
19
identity<typename R::Value>
(
sizeof
...(
args
));
20
}
21
}
22
#endif
// pRC_CORE_VALUE_FUNCTIONS_MEAN_H
type_traits.hpp
add.hpp
fold.hpp
pRC
Definition
cholesky.hpp:18
pRC::mean
static constexpr auto mean(Xs &&...args)
Definition
mean.hpp:15
pRC::makeConstantSequence
static constexpr auto makeConstantSequence()
Definition
sequence.hpp:402
pRC::RemoveConstReference
RemoveConst< RemoveReference< T > > RemoveConstReference
Definition
type_traits.hpp:62
div.hpp
fold.hpp
Generated by
1.10.0