1#ifndef TATOOINE_FIELD_OPERATIONS_H
2#define TATOOINE_FIELD_OPERATIONS_H
10template <
typename V0,
typename V1,
typename Real0,
typename Real1,
11 std::size_t NumDimensions>
13 V0::num_tensor_components() ==
22 lhs, rhs, [](
auto const& lhs,
auto const rhs) {
return dot(lhs, rhs); });
25template <
typename V0,
typename Real0,
typename V1,
typename Real1,
26 std::size_t N,
typename Tensor>
30 lhs, rhs, [](
auto const& lhs,
auto const& rhs) {
return lhs + rhs; });
33template <
typename Real0,
typename Real1, std::size_t N, std::size_t TM,
38 lhs, rhs, [](
auto const& lhs,
auto const& rhs) {
return lhs * rhs; });
41template <
typename V0,
typename Real0,
typename V1,
typename Real1,
42 std::size_t N, std::size_t TM, std::size_t TN>
46 lhs, rhs, [](
auto const& lhs,
auto const& rhs) {
return lhs * rhs; });
49template <
typename V0,
typename Real0,
typename V1,
typename Real1,
50 std::size_t N,
typename Tensor>
54 lhs, rhs, [](
auto const& lhs,
auto const& rhs) {
return lhs * rhs; });
57template <
typename V,
typename VReal, std::
size_t N,
typename Tensor>
60 return V{f.
as_derived()} | [scalar](
auto const& t) {
return t * scalar; };
63template <
typename V, arithmetic VReal, std::
size_t N,
typename Tensor>
66 return V{f.
as_derived()} | [scalar](
auto const& t) {
return t * scalar; };
69template <
typename V,
typename VReal, std::size_t N,
70 arithmetic_or_complex ScalarReal,
typename Tensor>
72 ScalarReal
const scalar) {
73 return V{f.
as_derived()} | [scalar](
auto const& t) {
return t / scalar; };
76template <
typename V,
typename VReal, std::size_t N,
77 arithmetic_or_complex ScalarReal,
typename Tensor>
80 return V{f.
as_derived()} | [scalar](
auto const& t) {
return scalar / t; };
107template <
typename V,
typename VReal, std::
size_t N>
112template <
typename V,
typename VReal, std::
size_t N>
117template <
typename V,
typename VReal, std::
size_t N>
122template <
typename V,
typename VReal, std::
size_t N>
Definition: concepts.h:33
Definition: algorithm.h:6
constexpr auto squared_euclidean_length(base_tensor< Tensor, T, N > const &t_in)
Definition: length.h:7
constexpr auto make_binary_operation_field(const field< LHSInternalField, LHSReal, N, LHSTensor > &lhs, const field< RHSInternalField, RHSReal, N, RHSTensor > &rhs, const Op &op)
Definition: binary_operation_field.h:119
auto constexpr operator/(Lhs const &lhs, Rhs const &rhs)
component-wise division
Definition: operator_overloads.h:103
tensor< real_number, Dimensions... > Tensor
Definition: tensor.h:184
constexpr auto operator*(diag_static_tensor< TensorA, M, N > const &A, static_vec auto const &b) -> vec< common_type< tatooine::value_type< TensorA >, tatooine::value_type< decltype(b)> >, M > requires(N==decltype(b)::dimension(0))
Definition: diag_tensor.h:141
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
auto constexpr operator+(static_tensor auto const &lhs, arithmetic_or_complex auto const scalar)
Definition: operator_overloads.h:35
auto as_derived() -> auto &
Definition: field.h:161
Definition: unary_operation_field.h:15