Tatooine
length.h
Go to the documentation of this file.
1#ifndef TATOOINE_TENSOR_OPERATIONS_LENGTH_H
2#define TATOOINE_TENSOR_OPERATIONS_LENGTH_H
3//==============================================================================
4namespace tatooine {
5//==============================================================================
6template <typename Tensor, typename T, size_t N>
8 return dot(t_in, t_in);
9}
10//------------------------------------------------------------------------------
11template <typename Tensor, typename T, size_t N>
12constexpr auto euclidean_length(base_tensor<Tensor, T, N> const& t_in) -> T {
13 return std::sqrt(squared_euclidean_length(t_in));
14}
15//==============================================================================
16} // namespace tatooine
17//==============================================================================
18#endif
Definition: algorithm.h:6
constexpr auto squared_euclidean_length(base_tensor< Tensor, T, N > const &t_in)
Definition: length.h:7
constexpr auto euclidean_length(base_tensor< Tensor, T, N > const &t_in) -> T
Definition: length.h:12
constexpr auto dot(base_tensor< Tensor0, T0, N > const &lhs, base_tensor< Tensor1, T1, N > const &rhs)
Definition: tensor_operations.h:120
Definition: base_tensor.h:23