autoppl  v0.8
A C++ template library for probabilistic programming
value.hpp
Go to the documentation of this file.
1 #pragma once
2 #include <fastad_bits/util/type_traits.hpp>
3 
4 namespace ad {
5 namespace boost {
6 
7 template <class T>
8 inline auto sum(const T& x)
9 {
10  if constexpr (ad::util::is_eigen_v<T>) {
11  return x.sum();
12  } else {
13  return x;
14  }
15 }
16 
17 } // namespace boost
18 } // namespace ad
ad
Definition: bounded_inv_transform.hpp:9
ad::boost::sum
auto sum(const T &x)
Definition: value.hpp:8