Tensor
A C++ expression template library for computations on N dimensional tensors
Public Types | Public Member Functions | List of all members
ftl::TensorSubtraction< E1, E2, T1, T2 > Class Template Reference

Expression class for calculating the subtraction of two tensors. More...

#include <tensor_subtraction.hpp>

Inheritance diagram for ftl::TensorSubtraction< E1, E2, T1, T2 >:
Inheritance graph
[legend]
Collaboration diagram for ftl::TensorSubtraction< E1, E2, T1, T2 >:
Collaboration graph
[legend]

Public Types

using traits = T1
 
using dim_container = typename traits::dim_container
 
using size_type = typename traits::size_type
 
using data_type = typename traits::data_type
 

Public Member Functions

 TensorSubtraction (TensorExpression< E1, T1 > const &x, TensorExpression< E2, T2 > const &y)
 Sets the expressions for subtraction and checks that they have the same ranks and dimension. More...
 
const dim_containerdim_sizes () const
 Gets the sizes of the all the dimensions of the expression. More...
 
const size_type size () const
 Returns the size of the expression. More...
 
const size_type rank () const
 Returns the size of the expression. More...
 
data_type operator[] (size_type i) const
 Adds two elements (one from each Tensor) from the tensor expression data. More...
 

Detailed Description

template<typename E1, typename E2, typename T1, typename T2>
class ftl::TensorSubtraction< E1, E2, T1, T2 >

Expression class for calculating the subtraction of two tensors.

Template Parameters
E1The first expression for subtraction
E2The second expression for subtraction
T1The traits of the first expression
T2The traits if the second expression

Member Typedef Documentation

template<typename E1, typename E2, typename T1, typename T2>
using ftl::TensorSubtraction< E1, E2, T1, T2 >::data_type = typename traits::data_type
template<typename E1, typename E2, typename T1, typename T2>
using ftl::TensorSubtraction< E1, E2, T1, T2 >::dim_container = typename traits::dim_container
template<typename E1, typename E2, typename T1, typename T2>
using ftl::TensorSubtraction< E1, E2, T1, T2 >::size_type = typename traits::size_type
template<typename E1, typename E2, typename T1, typename T2>
using ftl::TensorSubtraction< E1, E2, T1, T2 >::traits = T1

Constructor & Destructor Documentation

template<typename E1 , typename E2 , typename T1 , typename T2 >
ftl::TensorSubtraction< E1, E2, T1, T2 >::TensorSubtraction ( TensorExpression< E1, T1 > const &  x,
TensorExpression< E2, T2 > const &  y 
)

Sets the expressions for subtraction and checks that they have the same ranks and dimension.

Parameters
[in]xThe first expression for subtraction.
[in]yThe second expression for subtraction

Member Function Documentation

template<typename E1, typename E2, typename T1, typename T2>
const dim_container& ftl::TensorSubtraction< E1, E2, T1, T2 >::dim_sizes ( ) const
inline

Gets the sizes of the all the dimensions of the expression.

Returns
A constant reference to the dimension size vector of the expression
template<typename E1, typename E2, typename T1, typename T2>
data_type ftl::TensorSubtraction< E1, E2, T1, T2 >::operator[] ( size_type  i) const
inline

Adds two elements (one from each Tensor) from the tensor expression data.

Parameters
[in]iThe element in the expression which must be fetched.
Returns
The result of the subtraction of the Tensors.
template<typename E1, typename E2, typename T1, typename T2>
const size_type ftl::TensorSubtraction< E1, E2, T1, T2 >::rank ( ) const
inline

Returns the size of the expression.

Returns
The size of the tensor_subtraction.
template<typename E1, typename E2, typename T1, typename T2>
const size_type ftl::TensorSubtraction< E1, E2, T1, T2 >::size ( ) const
inline

Returns the size of the expression.

Returns
The size of the tensor_subtraction.

The documentation for this class was generated from the following file: