23 #ifndef FTL_TENSOR_ADDITION_HPP
24 #define FTL_TENSOR_ADDITION_HPP
38 template <
typename E1,
typename E2,
typename T1,
typename T2>
84 template <
typename E1,
typename E2,
typename T1,
typename T2>
90 while (x.dim_sizes()[i] == y.dim_sizes()[i]) ++i;
94 if (x.rank() != y.rank() || i != x.rank()) ;
99 #endif // FTL_TENSOR_ADDITION_HPP
Expression class for calculating the addition of two tensors.
Definition: tensor_addition.hpp:39
data_type operator[](size_type i) const
Adds two elements (one from each Tensor) from the tensor expression data.
Definition: tensor_addition.hpp:79
typename traits::size_type size_type
Definition: tensor_addition.hpp:43
Definition: mapper.hpp:37
Defines a general tensor expression so that opertions on tensor expressions can be defined the syntax...
Definition: tensor_expression_interface.hpp:49
T1 traits
Definition: tensor_addition.hpp:41
typename traits::data_type data_type
Definition: tensor_addition.hpp:44
typename traits::dim_container dim_container
Definition: tensor_addition.hpp:42
const size_type rank() const
Returns the size of the expression.
Definition: tensor_addition.hpp:72
const size_type size() const
Returns the size of the expression.
Definition: tensor_addition.hpp:66
TensorAddition(TensorExpression< E1, T1 > const &x, TensorExpression< E2, T2 > const &y)
Sets the expressions for addition and checks that they have the same ranks and dimension.
Definition: tensor_addition.hpp:85
const dim_container & dim_sizes() const
Gets the sizes of the all the dimensions of the expression.
Definition: tensor_addition.hpp:60