pRC
multi-purpose Tensor Train library for C++
Loading...
Searching...
No Matches
floor.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_VALUE_FUNCTIONS_FLOOR_H
4#define pRC_CORE_VALUE_FUNCTIONS_FLOOR_H
5
6#include <cmath>
7
10
11namespace pRC
12{
20 template<class T, If<IsFloat<T>> = 0>
21 static inline constexpr auto floor(T const &a)
22 {
23 return Float(std::floor(a()));
24 }
25
36 template<class T, If<IsInteger<T>> = 0>
37 static inline constexpr auto floor(T const &a)
38 {
39 return a;
40 }
41}
42#endif // pRC_CORE_VALUE_FUNCTIONS_FLOOR_H
Top-level class storing a floating point number.
Definition float.hpp:35
Definition cholesky.hpp:18
static constexpr auto floor(X &&a)
Calculates element-wise floor of a Tensor.
Definition floor.hpp:21
static constexpr Conditional< IsSatisfied< C >, RemoveConstReference< X >, X > copy(X &&a)
Definition copy.hpp:13