Tatooine
tensor
include
tatooine
tensor_operations
length.h
Go to the documentation of this file.
1
#ifndef TATOOINE_TENSOR_OPERATIONS_LENGTH_H
2
#define TATOOINE_TENSOR_OPERATIONS_LENGTH_H
3
//==============================================================================
4
namespace
tatooine
{
5
//==============================================================================
6
template
<
typename
Tensor,
typename
T,
size_t
N>
7
constexpr
auto
squared_euclidean_length
(
base_tensor<Tensor, T, N>
const
& t_in) {
8
return
dot
(t_in, t_in);
9
}
10
//------------------------------------------------------------------------------
11
template
<
typename
Tensor,
typename
T,
size_t
N>
12
constexpr
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
tatooine
Definition:
algorithm.h:6
tatooine::squared_euclidean_length
constexpr auto squared_euclidean_length(base_tensor< Tensor, T, N > const &t_in)
Definition:
length.h:7
tatooine::euclidean_length
constexpr auto euclidean_length(base_tensor< Tensor, T, N > const &t_in) -> T
Definition:
length.h:12
tatooine::dot
constexpr auto dot(base_tensor< Tensor0, T0, N > const &lhs, base_tensor< Tensor1, T1, N > const &rhs)
Definition:
tensor_operations.h:120
tatooine::base_tensor
Definition:
base_tensor.h:23
Generated by
1.9.5