TiledArray::detail::TensorInterface< T, R, OpResult > Class Template Reference

Documentation

template<typename T, typename R, typename OpResult>
class TiledArray::detail::TensorInterface< T, R, OpResult >

Tensor interface for external data.

This class allows users to construct a tensor object using data from an external source. TensorInterface objects can be used with each other and Tensor objects in any of the arithmetic operations.

Warning
No ownership of the data pointer used to construct TensorInterface objects. Therefore, it is the user's responsibility to manage the lifetime of the data.
This is not appropriate for use as a tile object as it does not own the data it references. Use Tensor for that purpose.
Template Parameters
TThe tensor value type
RThe range type
OpResulttensor type used as the return type from operations that produce a tensor

Definition at line 82 of file tensor_interface.h.

Public Types

typedef TensorInterface< T, R, OpResult > TensorInterface_
 This class type. More...
 
typedef R range_type
 Tensor range type. More...
 
typedef range_type::index1_type index1_type
 1-index type More...
 
typedef range_type::ordinal_type ordinal_type
 Ordinal type. More...
 
using size_type = ordinal_type
 
typedef std::remove_const< T >::type value_type
 Array element type. More...
 
typedef std::add_lvalue_reference< T >::type reference
 Element reference type. More...
 
typedef std::add_lvalue_reference< typename std::add_const< T >::type >::type const_reference
 Element reference type. More...
 
typedef std::add_pointer< T >::type pointer
 Element pointer type. More...
 
typedef std::add_pointer< typename std::add_const< T >::type >::type const_pointer
 Element pointer type. More...
 
typedef std::ptrdiff_t difference_type
 Difference type. More...
 
typedef detail::numeric_type< value_type >::type numeric_type
 the numeric type that supports T More...
 
typedef detail::scalar_type< value_type >::type scalar_type
 the scalar type that supports T More...
 
typedef OpResult result_tensor
 Tensor type used as the return type from operations that produce a tensor. More...
 

Public Member Functions

 TensorInterface ()=delete
 Compiler generated functions. More...
 
 ~TensorInterface ()=default
 
 TensorInterface (const TensorInterface_ &)=default
 
 TensorInterface (TensorInterface_ &&)=default
 
TensorInterface_operator= (const TensorInterface_ &)=delete
 
TensorInterface_operator= (TensorInterface_ &&)=delete
 
template<typename U , typename UOpResult , typename std::enable_if< std::is_convertible< typename TensorInterface< U, R, UOpResult >::pointer, pointer >::value >::type * = nullptr>
 TensorInterface (const TensorInterface< U, R, UOpResult > &other)
 Type conversion copy constructor. More...
 
template<typename U , typename UOpResult , typename std::enable_if< std::is_convertible< typename TensorInterface< U, R, UOpResult >::pointer, pointer >::value >::type * = nullptr>
 TensorInterface (TensorInterface< U, R, UOpResult > &&other)
 Type conversion move constructor. More...
 
 TensorInterface (const range_type &range, pointer data)
 Construct a new view of tensor. More...
 
 TensorInterface (range_type &&range, pointer data)
 Construct a new view of tensor. More...
 
template<typename T1 , typename std::enable_if< detail::is_tensor< T1 >::value >::type * = nullptr>
TensorInterface_operator= (const T1 &other)
 
const range_typerange () const
 Tensor range object accessor. More...
 
ordinal_type size () const
 Tensor dimension size accessor. More...
 
pointer data () const
 Data pointer accessor. More...
 
const_reference operator[] (const ordinal_type index) const
 Element subscript accessor. More...
 
reference operator[] (const ordinal_type index)
 Element subscript accessor. More...
 
template<typename... Index>
reference operator() (const Index &... idx)
 Element accessor. More...
 
template<typename... Index>
const_reference operator() (const Index &... idx) const
 Element accessor. More...
 
constexpr bool empty () const
 Check for empty view. More...
 
void swap (TensorInterface_ &other)
 Swap tensor views. More...
 
template<typename Index , typename = std::enable_if_t<detail::is_integral_range_v<Index>>>
TensorInterface_shift_to (const Index &bound_shift)
 Shift the lower and upper bound of this tensor view. More...
 
template<typename Index , typename = std::enable_if_t<std::is_integral_v<Index>>>
TensorInterface_shift_to (const std::initializer_list< Index > &bound_shift)
 Shift the lower and upper bound of this tensor view. More...
 
template<typename Index , typename = std::enable_if_t<detail::is_integral_range_v<Index>>>
result_tensor shift (const Index &bound_shift) const
 Make a copy of this view shited by bound_shift. More...
 
template<typename Index , typename = std::enable_if_t<std::is_integral_v<Index>>>
result_tensor shift (const std::initializer_list< Index > &bound_shift) const
 Make a copy of this view shited by bound_shift. More...
 
template<typename Right , typename Op , typename std::enable_if< is_tensor< Right >::value >::type * = nullptr>
result_tensor binary (const Right &right, Op &&op) const
 Use a binary, element wise operation to construct a new tensor. More...
 
template<typename Right , typename Op , typename Perm , typename std::enable_if< is_tensor< Right >::value &&detail::is_permutation_v< Perm >>::type * = nullptr>
result_tensor binary (const Right &right, Op &&op, const Perm &perm) const
 Use a binary, element wise operation to construct a new, permuted tensor. More...
 
template<typename Right , typename Op , typename std::enable_if< is_tensor< Right >::value >::type * = nullptr>
TensorInterface_inplace_binary (const Right &right, Op &&op)
 Use a binary, element wise operation to modify this tensor. More...
 
template<typename Op >
result_tensor unary (Op &&op) const
 Use a unary, element wise operation to construct a new tensor. More...
 
template<typename Op , typename Perm , typename = std::enable_if_t<detail::is_permutation_v<Perm>>>
result_tensor unary (Op &&op, const Perm &perm) const
 Use a unary, element wise operation to construct a new, permuted tensor. More...
 
template<typename Op >
TensorInterface_inplace_unary (Op &&op)
 Use a unary, element wise operation to modify this tensor. More...
 
template<typename Perm , typename = std::enable_if_t<detail::is_permutation_v<Perm>>>
result_tensor permute (const Perm &perm) const
 
template<typename Scalar , typename std::enable_if< detail::is_numeric_v< Scalar >>::type * = nullptr>
result_tensor scale (const Scalar factor) const
 Construct a scaled copy of this tensor. More...
 
template<typename Scalar , typename Perm , typename std::enable_if< detail::is_numeric_v< Scalar > &&detail::is_permutation_v< Perm >>::type * = nullptr>
result_tensor scale (const Scalar factor, const Perm &perm) const
 Construct a scaled and permuted copy of this tensor. More...
 
template<typename Scalar , typename std::enable_if< detail::is_numeric_v< Scalar >>::type * = nullptr>
TensorInterface_scale_to (const Scalar factor)
 Scale this tensor. More...
 
template<typename Right , typename std::enable_if< is_tensor< Right >::value >::type * = nullptr>
result_tensor add (const Right &right) const
 Add this and other to construct a new tensors. More...
 
template<typename Right , typename Perm , typename std::enable_if< is_tensor< Right >::value &&detail::is_permutation_v< Perm >>::type * = nullptr>
result_tensor add (const Right &right, const Perm &perm) const
 Add this and other to construct a new, permuted tensor. More...
 
template<typename Right , typename Scalar , typename std::enable_if< is_tensor< Right >::value &&detail::is_numeric_v< Scalar >>::type * = nullptr>
result_tensor add (const Right &right, const Scalar factor) const
 Scale and add this and other to construct a new tensor. More...
 
template<typename Right , typename Scalar , typename Perm , typename std::enable_if< is_tensor< Right >::value &&detail::is_numeric_v< Scalar > &&detail::is_permutation_v< Perm >>::type * = nullptr>
result_tensor add (const Right &right, const Scalar factor, const Perm &perm) const
 Scale and add this and other to construct a new, permuted tensor. More...
 
result_tensor add (const numeric_type value) const
 Add a constant to a copy of this tensor. More...
 
template<typename Perm , typename = std::enable_if_t<detail::is_permutation_v<Perm>>>
result_tensor add (const numeric_type value, const Perm &perm) const
 Add a constant to a permuted copy of this tensor. More...
 
template<typename Right , typename std::enable_if< is_tensor< Right >::value >::type * = nullptr>
TensorInterface_add_to (const Right &right)
 Add other to this tensor. More...
 
template<typename Right , typename Scalar , typename std::enable_if< is_tensor< Right >::value &&detail::is_numeric_v< Scalar >>::type * = nullptr>
TensorInterface_add_to (const Right &right, const Scalar factor)
 Add other to this tensor, and scale the result. More...
 
TensorInterface_add_to (const numeric_type value)
 Add a constant to this tensor. More...
 
template<typename Right , typename std::enable_if< is_tensor< Right >::value >::type * = nullptr>
result_tensor subt (const Right &right) const
 Subtract this and right to construct a new tensor. More...
 
template<typename Right , typename Perm , typename std::enable_if< is_tensor< Right >::value &&detail::is_permutation_v< Perm >>::type * = nullptr>
result_tensor subt (const Right &right, const Perm &perm) const
 Subtract this and right to construct a new, permuted tensor. More...
 
template<typename Right , typename Scalar , typename std::enable_if< is_tensor< Right >::value &&detail::is_numeric_v< Scalar >>::type * = nullptr>
result_tensor subt (const Right &right, const Scalar factor) const
 Scale and subtract this and right to construct a new tensor. More...
 
template<typename Right , typename Scalar , typename Perm , typename std::enable_if< is_tensor< Right >::value &&detail::is_numeric_v< Scalar > &&detail::is_permutation_v< Perm >>::type * = nullptr>
result_tensor subt (const Right &right, const Scalar factor, const Perm &perm) const
 Scale and subtract this and right to construct a new, permuted tensor. More...
 
result_tensor subt (const numeric_type value) const
 Subtract a constant from a copy of this tensor. More...
 
template<typename Perm , typename = std::enable_if_t<detail::is_permutation_v<Perm>>>
result_tensor subt (const numeric_type value, const Perm &perm) const
 Subtract a constant from a permuted copy of this tensor. More...
 
template<typename Right , typename std::enable_if< is_tensor< Right >::value >::type * = nullptr>
TensorInterface_subt_to (const Right &right)
 Subtract right from this tensor. More...
 
template<typename Right , typename Scalar , typename std::enable_if< is_tensor< Right >::value &&detail::is_numeric_v< Scalar >>::type * = nullptr>
TensorInterface_subt_to (const Right &right, const Scalar factor)
 Subtract right from and scale this tensor. More...
 
TensorInterface_subt_to (const numeric_type value)
 Subtract a constant from this tensor. More...
 
template<typename Right , typename std::enable_if< is_tensor< Right >::value >::type * = nullptr>
result_tensor mult (const Right &right) const
 Multiply this by right to create a new tensor. More...
 
template<typename Right , typename Perm , typename std::enable_if< is_tensor< Right >::value &&detail::is_permutation_v< Perm >>::type * = nullptr>
result_tensor mult (const Right &right, const Perm &perm) const
 Multiply this by right to create a new, permuted tensor. More...
 
template<typename Right , typename Scalar , typename std::enable_if< is_tensor< Right >::value &&detail::is_numeric_v< Scalar >>::type * = nullptr>
result_tensor mult (const Right &right, const Scalar factor) const
 Scale and multiply this by right to create a new tensor. More...
 
template<typename Right , typename Scalar , typename Perm , typename std::enable_if< is_tensor< Right >::value &&detail::is_numeric_v< Scalar > &&detail::is_permutation_v< Perm >>::type * = nullptr>
result_tensor mult (const Right &right, const Scalar factor, const Perm &perm) const
 Scale and multiply this by right to create a new, permuted tensor. More...
 
template<typename Right , typename std::enable_if< is_tensor< Right >::value >::type * = nullptr>
TensorInterface_mult_to (const Right &right)
 Multiply this tensor by right. More...
 
template<typename Right , typename Scalar , typename std::enable_if< is_tensor< Right >::value &&detail::is_numeric_v< Scalar >>::type * = nullptr>
TensorInterface_mult_to (const Right &right, const Scalar factor)
 Scale and multiply this tensor by right. More...
 
result_tensor neg () const
 Create a negated copy of this tensor. More...
 
template<typename Perm , typename = std::enable_if_t<detail::is_permutation_v<Perm>>>
result_tensor neg (const Perm &perm) const
 Create a negated and permuted copy of this tensor. More...
 
TensorInterface_neg_to ()
 Negate elements of this tensor. More...
 
result_tensor conj () const
 Create a complex conjugated copy of this tensor. More...
 
template<typename Scalar , typename std::enable_if< detail::is_numeric_v< Scalar >>::type * = nullptr>
result_tensor conj (const Scalar factor) const
 Create a complex conjugated and scaled copy of this tensor. More...
 
template<typename Perm , typename = std::enable_if_t<detail::is_permutation_v<Perm>>>
result_tensor conj (const Perm &perm) const
 Create a complex conjugated and permuted copy of this tensor. More...
 
template<typename Scalar , typename Perm , typename std::enable_if< detail::is_numeric_v< Scalar > &&detail::is_permutation_v< Perm >>::type * = nullptr>
result_tensor conj (const Scalar factor, const Perm &perm) const
 Create a complex conjugated, scaled, and permuted copy of this tensor. More...
 
TensorInterface_conj_to ()
 Complex conjugate this tensor. More...
 
template<typename Scalar , typename std::enable_if< detail::is_numeric_v< Scalar >>::type * = nullptr>
TensorInterface_conj_to (const Scalar factor)
 Complex conjugate and scale this tensor. More...
 
template<typename ReduceOp , typename JoinOp >
numeric_type reduce (ReduceOp &&reduce_op, JoinOp &&join_op, const numeric_type identity) const
 Unary reduction operation. More...
 
template<typename Right , typename ReduceOp , typename JoinOp , typename std::enable_if< is_tensor< Right >::value >::type * = nullptr>
numeric_type reduce (const Right &other, ReduceOp &&reduce_op, JoinOp &&join_op, const numeric_type identity) const
 Binary reduction operation. More...
 
numeric_type sum () const
 Sum of elements. More...
 
numeric_type product () const
 Product of elements. More...
 
scalar_type squared_norm () const
 Square of vector 2-norm. More...
 
template<typename ResultType = numeric_type>
ResultType norm () const
 Vector 2-norm. More...
 
numeric_type min () const
 Minimum element. More...
 
numeric_type max () const
 Maximum element. More...
 
numeric_type abs_min () const
 Absolute minimum element. More...
 
numeric_type abs_max () const
 Absolute maximum element. More...
 
template<typename Right , typename std::enable_if< is_tensor< Right >::value >::type * = nullptr>
numeric_type dot (const Right &other) const
 Vector dot product. More...
 
template<typename Right , typename std::enable_if< is_tensor< Right >::value >::type * = nullptr>
numeric_type inner_product (const Right &other) const
 

Friends

template<typename , typename , typename >
class TensorInterface
 
template<typename U , typename Range_ , typename OpResult_ , typename Index1 , typename Index2 >
void TiledArray::remap (detail::TensorInterface< U, Range_, OpResult_ > &, U *const, const Index1 &, const Index2 &)
 
template<typename U , typename Range_ , typename OpResult_ , typename Index1 , typename Index2 >
void TiledArray::remap (detail::TensorInterface< const U, Range_, OpResult_ > &, U *const, const Index1 &, const Index2 &)
 
template<typename U , typename Range_ , typename OpResult_ , typename Index1 , typename Index2 >
void TiledArray::remap (detail::TensorInterface< U, Range_, OpResult_ > &, U *const, const std::initializer_list< Index1 > &, const std::initializer_list< Index2 > &)
 
template<typename U , typename Range_ , typename OpResult_ , typename Index1 , typename Index2 >
void TiledArray::remap (detail::TensorInterface< const U, Range_, OpResult_ > &, U *const, const std::initializer_list< Index1 > &, const std::initializer_list< Index2 > &)
 

Member Typedef Documentation

◆ const_pointer

template<typename T , typename R , typename OpResult >
typedef std::add_pointer<typename std::add_const<T>::type>::type TiledArray::detail::TensorInterface< T, R, OpResult >::const_pointer

Element pointer type.

Definition at line 99 of file tensor_interface.h.

◆ const_reference

template<typename T , typename R , typename OpResult >
typedef std::add_lvalue_reference<typename std::add_const<T>::type>::type TiledArray::detail::TensorInterface< T, R, OpResult >::const_reference

Element reference type.

Definition at line 96 of file tensor_interface.h.

◆ difference_type

template<typename T , typename R , typename OpResult >
typedef std::ptrdiff_t TiledArray::detail::TensorInterface< T, R, OpResult >::difference_type

Difference type.

Definition at line 100 of file tensor_interface.h.

◆ index1_type

template<typename T , typename R , typename OpResult >
typedef range_type::index1_type TiledArray::detail::TensorInterface< T, R, OpResult >::index1_type

1-index type

Definition at line 87 of file tensor_interface.h.

◆ numeric_type

template<typename T , typename R , typename OpResult >
typedef detail::numeric_type<value_type>::type TiledArray::detail::TensorInterface< T, R, OpResult >::numeric_type

the numeric type that supports T

Definition at line 102 of file tensor_interface.h.

◆ ordinal_type

template<typename T , typename R , typename OpResult >
typedef range_type::ordinal_type TiledArray::detail::TensorInterface< T, R, OpResult >::ordinal_type

Ordinal type.

Definition at line 88 of file tensor_interface.h.

◆ pointer

template<typename T , typename R , typename OpResult >
typedef std::add_pointer<T>::type TiledArray::detail::TensorInterface< T, R, OpResult >::pointer

Element pointer type.

Definition at line 97 of file tensor_interface.h.

◆ range_type

template<typename T , typename R , typename OpResult >
typedef R TiledArray::detail::TensorInterface< T, R, OpResult >::range_type

Tensor range type.

Definition at line 86 of file tensor_interface.h.

◆ reference

template<typename T , typename R , typename OpResult >
typedef std::add_lvalue_reference<T>::type TiledArray::detail::TensorInterface< T, R, OpResult >::reference

Element reference type.

Definition at line 93 of file tensor_interface.h.

◆ result_tensor

template<typename T , typename R , typename OpResult >
typedef OpResult TiledArray::detail::TensorInterface< T, R, OpResult >::result_tensor

Tensor type used as the return type from operations that produce a tensor.

Definition at line 106 of file tensor_interface.h.

◆ scalar_type

template<typename T , typename R , typename OpResult >
typedef detail::scalar_type<value_type>::type TiledArray::detail::TensorInterface< T, R, OpResult >::scalar_type

the scalar type that supports T

Definition at line 104 of file tensor_interface.h.

◆ size_type

template<typename T , typename R , typename OpResult >
using TiledArray::detail::TensorInterface< T, R, OpResult >::size_type = ordinal_type

Definition at line 89 of file tensor_interface.h.

◆ TensorInterface_

template<typename T , typename R , typename OpResult >
typedef TensorInterface<T, R, OpResult> TiledArray::detail::TensorInterface< T, R, OpResult >::TensorInterface_

This class type.

Definition at line 85 of file tensor_interface.h.

◆ value_type

template<typename T , typename R , typename OpResult >
typedef std::remove_const<T>::type TiledArray::detail::TensorInterface< T, R, OpResult >::value_type

Array element type.

Definition at line 91 of file tensor_interface.h.

Constructor & Destructor Documentation

◆ TensorInterface() [1/7]

template<typename T , typename R , typename OpResult >
TiledArray::detail::TensorInterface< T, R, OpResult >::TensorInterface ( )
delete

Compiler generated functions.

◆ ~TensorInterface()

template<typename T , typename R , typename OpResult >
TiledArray::detail::TensorInterface< T, R, OpResult >::~TensorInterface ( )
default

◆ TensorInterface() [2/7]

template<typename T , typename R , typename OpResult >
TiledArray::detail::TensorInterface< T, R, OpResult >::TensorInterface ( const TensorInterface_ )
default

◆ TensorInterface() [3/7]

template<typename T , typename R , typename OpResult >
TiledArray::detail::TensorInterface< T, R, OpResult >::TensorInterface ( TensorInterface_ &&  )
default

◆ TensorInterface() [4/7]

template<typename T , typename R , typename OpResult >
template<typename U , typename UOpResult , typename std::enable_if< std::is_convertible< typename TensorInterface< U, R, UOpResult >::pointer, pointer >::value >::type * = nullptr>
TiledArray::detail::TensorInterface< T, R, OpResult >::TensorInterface ( const TensorInterface< U, R, UOpResult > &  other)
inline

Type conversion copy constructor.

Template Parameters
UThe value type of the other view
Parameters
otherThe other tensor view to be copied

Definition at line 157 of file tensor_interface.h.

◆ TensorInterface() [5/7]

template<typename T , typename R , typename OpResult >
template<typename U , typename UOpResult , typename std::enable_if< std::is_convertible< typename TensorInterface< U, R, UOpResult >::pointer, pointer >::value >::type * = nullptr>
TiledArray::detail::TensorInterface< T, R, OpResult >::TensorInterface ( TensorInterface< U, R, UOpResult > &&  other)
inline

Type conversion move constructor.

Template Parameters
UThe value type of the other tensor view
Parameters
otherThe other tensor view to be moved

Definition at line 168 of file tensor_interface.h.

◆ TensorInterface() [6/7]

template<typename T , typename R , typename OpResult >
TiledArray::detail::TensorInterface< T, R, OpResult >::TensorInterface ( const range_type range,
pointer  data 
)
inline

Construct a new view of tensor.

Parameters
rangeThe range of this tensor
dataThe data pointer for this tensor

Definition at line 177 of file tensor_interface.h.

Here is the call graph for this function:

◆ TensorInterface() [7/7]

template<typename T , typename R , typename OpResult >
TiledArray::detail::TensorInterface< T, R, OpResult >::TensorInterface ( range_type &&  range,
pointer  data 
)
inline

Construct a new view of tensor.

Parameters
rangeThe range of this tensor
dataThe data pointer for this tensor

Definition at line 186 of file tensor_interface.h.

Here is the call graph for this function:

Member Function Documentation

◆ abs_max()

template<typename T , typename R , typename OpResult >
numeric_type TiledArray::detail::TensorInterface< T, R, OpResult >::abs_max ( ) const
inline

Absolute maximum element.

Returns
The maximum elements of this tensor

Definition at line 1093 of file tensor_interface.h.

Here is the call graph for this function:

◆ abs_min()

template<typename T , typename R , typename OpResult >
numeric_type TiledArray::detail::TensorInterface< T, R, OpResult >::abs_min ( ) const
inline

Absolute minimum element.

Returns
The minimum elements of this tensor

Definition at line 1080 of file tensor_interface.h.

Here is the call graph for this function:

◆ add() [1/6]

template<typename T , typename R , typename OpResult >
result_tensor TiledArray::detail::TensorInterface< T, R, OpResult >::add ( const numeric_type  value) const
inline

Add a constant to a copy of this tensor.

Parameters
valueThe constant to be added to this tensor
Returns
A new tensor where the elements are the sum of the elements of this and value

Definition at line 595 of file tensor_interface.h.

Here is the call graph for this function:

◆ add() [2/6]

template<typename T , typename R , typename OpResult >
template<typename Perm , typename = std::enable_if_t<detail::is_permutation_v<Perm>>>
result_tensor TiledArray::detail::TensorInterface< T, R, OpResult >::add ( const numeric_type  value,
const Perm &  perm 
) const
inline

Add a constant to a permuted copy of this tensor.

Parameters
valueThe constant to be added to this tensor
permThe permutation to be applied to this tensor
Returns
A new tensor where the elements are the sum of the elements of this and value

Definition at line 608 of file tensor_interface.h.

Here is the call graph for this function:

◆ add() [3/6]

template<typename T , typename R , typename OpResult >
template<typename Right , typename std::enable_if< is_tensor< Right >::value >::type * = nullptr>
result_tensor TiledArray::detail::TensorInterface< T, R, OpResult >::add ( const Right &  right) const
inline

Add this and other to construct a new tensors.

Template Parameters
RightThe right-hand tensor type
Parameters
rightThe tensor that will be added to this tensor
Returns
A new tensor where the elements are the sum of the elements of this and other

Definition at line 522 of file tensor_interface.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add() [4/6]

template<typename T , typename R , typename OpResult >
template<typename Right , typename Perm , typename std::enable_if< is_tensor< Right >::value &&detail::is_permutation_v< Perm >>::type * = nullptr>
result_tensor TiledArray::detail::TensorInterface< T, R, OpResult >::add ( const Right &  right,
const Perm &  perm 
) const
inline

Add this and other to construct a new, permuted tensor.

Template Parameters
RightThe right-hand tensor type
Parameters
rightThe tensor that will be added to this tensor
permThe permutation to be applied to this tensor
Returns
A new tensor where the elements are the sum of the elements of this and other

Definition at line 541 of file tensor_interface.h.

Here is the call graph for this function:

◆ add() [5/6]

template<typename T , typename R , typename OpResult >
template<typename Right , typename Scalar , typename std::enable_if< is_tensor< Right >::value &&detail::is_numeric_v< Scalar >>::type * = nullptr>
result_tensor TiledArray::detail::TensorInterface< T, R, OpResult >::add ( const Right &  right,
const Scalar  factor 
) const
inline

Scale and add this and other to construct a new tensor.

Template Parameters
RightThe right-hand tensor type
ScalarA scalar type
Parameters
rightThe tensor that will be added to this tensor
factorThe scaling factor
Returns
A new tensor where the elements are the sum of the elements of this and other, scaled by factor

Definition at line 562 of file tensor_interface.h.

Here is the call graph for this function:

◆ add() [6/6]

template<typename T , typename R , typename OpResult >
template<typename Right , typename Scalar , typename Perm , typename std::enable_if< is_tensor< Right >::value &&detail::is_numeric_v< Scalar > &&detail::is_permutation_v< Perm >>::type * = nullptr>
result_tensor TiledArray::detail::TensorInterface< T, R, OpResult >::add ( const Right &  right,
const Scalar  factor,
const Perm &  perm 
) const
inline

Scale and add this and other to construct a new, permuted tensor.

Template Parameters
RightThe right-hand tensor type
ScalarA scalar type
Parameters
rightThe tensor that will be added to this tensor
factorThe scaling factor
permThe permutation to be applied to this tensor
Returns
A new tensor where the elements are the sum of the elements of this and other, scaled by factor

Definition at line 581 of file tensor_interface.h.

Here is the call graph for this function:

◆ add_to() [1/3]

template<typename T , typename R , typename OpResult >
TensorInterface_& TiledArray::detail::TensorInterface< T, R, OpResult >::add_to ( const numeric_type  value)
inline

Add a constant to this tensor.

Parameters
valueThe constant to be added
Returns
A reference to this tensor

Definition at line 647 of file tensor_interface.h.

Here is the call graph for this function:

◆ add_to() [2/3]

template<typename T , typename R , typename OpResult >
template<typename Right , typename std::enable_if< is_tensor< Right >::value >::type * = nullptr>
TensorInterface_& TiledArray::detail::TensorInterface< T, R, OpResult >::add_to ( const Right &  right)
inline

Add other to this tensor.

Template Parameters
RightThe right-hand tensor type
Parameters
rightThe tensor that will be added to this tensor
Returns
A reference to this tensor

Definition at line 621 of file tensor_interface.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_to() [3/3]

template<typename T , typename R , typename OpResult >
template<typename Right , typename Scalar , typename std::enable_if< is_tensor< Right >::value &&detail::is_numeric_v< Scalar >>::type * = nullptr>
TensorInterface_& TiledArray::detail::TensorInterface< T, R, OpResult >::add_to ( const Right &  right,
const Scalar  factor 
)
inline

Add other to this tensor, and scale the result.

Template Parameters
RightThe right-hand tensor type
ScalarA scalar type
Parameters
rightThe tensor that will be added to this tensor
factorThe scaling factor
Returns
A reference to this tensor

Definition at line 637 of file tensor_interface.h.

Here is the call graph for this function:

◆ binary() [1/2]

template<typename T , typename R , typename OpResult >
template<typename Right , typename Op , typename std::enable_if< is_tensor< Right >::value >::type * = nullptr>
result_tensor TiledArray::detail::TensorInterface< T, R, OpResult >::binary ( const Right &  right,
Op &&  op 
) const
inline

Use a binary, element wise operation to construct a new tensor.

Template Parameters
RightThe right-hand tensor type
OpThe binary operation type
Parameters
rightThe right-hand argument in the binary operation
opThe binary, element-wise operation
Returns
A tensor where element i of the new tensor is equal to op(*this[i],other[i])

Definition at line 327 of file tensor_interface.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ binary() [2/2]

template<typename T , typename R , typename OpResult >
template<typename Right , typename Op , typename Perm , typename std::enable_if< is_tensor< Right >::value &&detail::is_permutation_v< Perm >>::type * = nullptr>
result_tensor TiledArray::detail::TensorInterface< T, R, OpResult >::binary ( const Right &  right,
Op &&  op,
const Perm &  perm 
) const
inline

Use a binary, element wise operation to construct a new, permuted tensor.

Template Parameters
RightThe right-hand tensor type
OpThe binary operation type
Parameters
rightThe right-hand argument in the binary operation
opThe binary, element-wise operation
permThe permutation to be applied to this tensor
Returns
A tensor where element i of the new tensor is equal to op(*this[i],other[i])

Definition at line 347 of file tensor_interface.h.

Here is the call graph for this function:

◆ conj() [1/4]

template<typename T , typename R , typename OpResult >
result_tensor TiledArray::detail::TensorInterface< T, R, OpResult >::conj ( ) const
inline

Create a complex conjugated copy of this tensor.

Returns
A copy of this tensor that contains the complex conjugate the values

Definition at line 919 of file tensor_interface.h.

Here is the call graph for this function:

◆ conj() [2/4]

template<typename T , typename R , typename OpResult >
template<typename Perm , typename = std::enable_if_t<detail::is_permutation_v<Perm>>>
result_tensor TiledArray::detail::TensorInterface< T, R, OpResult >::conj ( const Perm &  perm) const
inline

Create a complex conjugated and permuted copy of this tensor.

Parameters
permThe permutation to be applied to this tensor
Returns
A permuted copy of this tensor that contains the complex conjugate values

Definition at line 940 of file tensor_interface.h.

Here is the call graph for this function:

◆ conj() [3/4]

template<typename T , typename R , typename OpResult >
template<typename Scalar , typename std::enable_if< detail::is_numeric_v< Scalar >>::type * = nullptr>
result_tensor TiledArray::detail::TensorInterface< T, R, OpResult >::conj ( const Scalar  factor) const
inline

Create a complex conjugated and scaled copy of this tensor.

Template Parameters
ScalarA scalar type
Parameters
factorThe scaling factor
Returns
A copy of this tensor that contains the scaled complex conjugate the values

Definition at line 929 of file tensor_interface.h.

Here is the call graph for this function:

◆ conj() [4/4]

template<typename T , typename R , typename OpResult >
template<typename Scalar , typename Perm , typename std::enable_if< detail::is_numeric_v< Scalar > &&detail::is_permutation_v< Perm >>::type * = nullptr>
result_tensor TiledArray::detail::TensorInterface< T, R, OpResult >::conj ( const Scalar  factor,
const Perm &  perm 
) const
inline

Create a complex conjugated, scaled, and permuted copy of this tensor.

Template Parameters
ScalarA scalar type
Parameters
factorThe scaling factor
permThe permutation to be applied to this tensor
Returns
A permuted copy of this tensor that contains the complex conjugate values

Definition at line 955 of file tensor_interface.h.

Here is the call graph for this function:

◆ conj_to() [1/2]

template<typename T , typename R , typename OpResult >
TensorInterface_& TiledArray::detail::TensorInterface< T, R, OpResult >::conj_to ( )
inline

Complex conjugate this tensor.

Returns
A reference to this tensor

Definition at line 962 of file tensor_interface.h.

Here is the call graph for this function:

◆ conj_to() [2/2]

template<typename T , typename R , typename OpResult >
template<typename Scalar , typename std::enable_if< detail::is_numeric_v< Scalar >>::type * = nullptr>
TensorInterface_& TiledArray::detail::TensorInterface< T, R, OpResult >::conj_to ( const Scalar  factor)
inline

Complex conjugate and scale this tensor.

Template Parameters
ScalarA scalar type
Parameters
factorThe scaling factor
Returns
A reference to this tensor

Definition at line 971 of file tensor_interface.h.

Here is the call graph for this function:

◆ data()

template<typename T , typename R , typename OpResult >
pointer TiledArray::detail::TensorInterface< T, R, OpResult >::data ( ) const
inline

Data pointer accessor.

Returns
The data pointer of the parent tensor

Definition at line 216 of file tensor_interface.h.

Here is the caller graph for this function:

◆ dot()

template<typename T , typename R , typename OpResult >
template<typename Right , typename std::enable_if< is_tensor< Right >::value >::type * = nullptr>
numeric_type TiledArray::detail::TensorInterface< T, R, OpResult >::dot ( const Right &  other) const
inline

Vector dot product.

Template Parameters
RightThe right-hand tensor type
Parameters
otherThe right-hand tensor to be reduced
Returns
The inner product of the this and other

Definition at line 1110 of file tensor_interface.h.

Here is the call graph for this function:

◆ empty()

template<typename T , typename R , typename OpResult >
constexpr bool TiledArray::detail::TensorInterface< T, R, OpResult >::empty ( ) const
inlineconstexpr

Check for empty view.

Returns
false

Definition at line 259 of file tensor_interface.h.

◆ inner_product()

template<typename T , typename R , typename OpResult >
template<typename Right , typename std::enable_if< is_tensor< Right >::value >::type * = nullptr>
numeric_type TiledArray::detail::TensorInterface< T, R, OpResult >::inner_product ( const Right &  other) const
inline

Vector inner product

Template Parameters
RightThe right-hand tensor type
Parameters
otherThe right-hand tensor to be reduced
Returns
The dot product of the this and other If numeric_type is real, this is equivalent to dot product
See also
Tensor::dot

Definition at line 1126 of file tensor_interface.h.

Here is the call graph for this function:

◆ inplace_binary()

template<typename T , typename R , typename OpResult >
template<typename Right , typename Op , typename std::enable_if< is_tensor< Right >::value >::type * = nullptr>
TensorInterface_& TiledArray::detail::TensorInterface< T, R, OpResult >::inplace_binary ( const Right &  right,
Op &&  op 
)
inline

Use a binary, element wise operation to modify this tensor.

Template Parameters
RightThe right-hand tensor type
OpThe binary operation type
Parameters
rightThe right-hand argument in the binary operation
opThe binary, element-wise operation
Returns
A reference to this object
Exceptions
TiledArray::ExceptionWhen this tensor is empty.
TiledArray::ExceptionWhen other is empty.
TiledArray::ExceptionWhen the range of this tensor is not equal to the range of other.
TiledArray::ExceptionWhen this and other are the same.

Definition at line 382 of file tensor_interface.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ inplace_unary()

template<typename T , typename R , typename OpResult >
template<typename Op >
TensorInterface_& TiledArray::detail::TensorInterface< T, R, OpResult >::inplace_unary ( Op &&  op)
inline

Use a unary, element wise operation to modify this tensor.

Template Parameters
OpThe unary operation type
Parameters
opThe unary, element-wise operation
Returns
A reference to this object
Exceptions
TiledArray::ExceptionWhen this tensor is empty.

Definition at line 439 of file tensor_interface.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ max()

template<typename T , typename R , typename OpResult >
numeric_type TiledArray::detail::TensorInterface< T, R, OpResult >::max ( ) const
inline

Maximum element.

Returns
The maximum elements of this tensor

Definition at line 1071 of file tensor_interface.h.

Here is the call graph for this function:

◆ min()

template<typename T , typename R , typename OpResult >
numeric_type TiledArray::detail::TensorInterface< T, R, OpResult >::min ( ) const
inline

Minimum element.

Returns
The minimum elements of this tensor

Definition at line 1062 of file tensor_interface.h.

Here is the call graph for this function:

◆ mult() [1/4]

template<typename T , typename R , typename OpResult >
template<typename Right , typename std::enable_if< is_tensor< Right >::value >::type * = nullptr>
result_tensor TiledArray::detail::TensorInterface< T, R, OpResult >::mult ( const Right &  right) const
inline

Multiply this by right to create a new tensor.

Template Parameters
RightThe right-hand tensor type
Parameters
rightThe tensor that will be multiplied by this tensor
Returns
A new tensor where the elements are the product of the elements of this and right

Definition at line 792 of file tensor_interface.h.

Here is the call graph for this function:

◆ mult() [2/4]

template<typename T , typename R , typename OpResult >
template<typename Right , typename Perm , typename std::enable_if< is_tensor< Right >::value &&detail::is_permutation_v< Perm >>::type * = nullptr>
result_tensor TiledArray::detail::TensorInterface< T, R, OpResult >::mult ( const Right &  right,
const Perm &  perm 
) const
inline

Multiply this by right to create a new, permuted tensor.

Template Parameters
RightThe right-hand tensor type
Parameters
rightThe tensor that will be multiplied by this tensor
permThe permutation to be applied to this tensor
Returns
A new tensor where the elements are the product of the elements of this and right

Definition at line 811 of file tensor_interface.h.

Here is the call graph for this function:

◆ mult() [3/4]

template<typename T , typename R , typename OpResult >
template<typename Right , typename Scalar , typename std::enable_if< is_tensor< Right >::value &&detail::is_numeric_v< Scalar >>::type * = nullptr>
result_tensor TiledArray::detail::TensorInterface< T, R, OpResult >::mult ( const Right &  right,
const Scalar  factor 
) const
inline

Scale and multiply this by right to create a new tensor.

Template Parameters
RightThe right-hand tensor type
ScalarA scalar type
Parameters
rightThe tensor that will be multiplied by this tensor
factorThe scaling factor
Returns
A new tensor where the elements are the product of the elements of this and right, scaled by factor

Definition at line 832 of file tensor_interface.h.

Here is the call graph for this function:

◆ mult() [4/4]

template<typename T , typename R , typename OpResult >
template<typename Right , typename Scalar , typename Perm , typename std::enable_if< is_tensor< Right >::value &&detail::is_numeric_v< Scalar > &&detail::is_permutation_v< Perm >>::type * = nullptr>
result_tensor TiledArray::detail::TensorInterface< T, R, OpResult >::mult ( const Right &  right,
const Scalar  factor,
const Perm &  perm 
) const
inline

Scale and multiply this by right to create a new, permuted tensor.

Template Parameters
RightThe right-hand tensor type
ScalarA scalar type
Parameters
rightThe tensor that will be multiplied by this tensor
factorThe scaling factor
permThe permutation to be applied to this tensor
Returns
A new tensor where the elements are the product of the elements of this and right, scaled by factor

Definition at line 851 of file tensor_interface.h.

Here is the call graph for this function:

◆ mult_to() [1/2]

template<typename T , typename R , typename OpResult >
template<typename Right , typename std::enable_if< is_tensor< Right >::value >::type * = nullptr>
TensorInterface_& TiledArray::detail::TensorInterface< T, R, OpResult >::mult_to ( const Right &  right)
inline

Multiply this tensor by right.

Template Parameters
RightThe right-hand tensor type
Parameters
rightThe tensor that will be multiplied by this tensor
Returns
A reference to this tensor

Definition at line 867 of file tensor_interface.h.

Here is the call graph for this function:

◆ mult_to() [2/2]

template<typename T , typename R , typename OpResult >
template<typename Right , typename Scalar , typename std::enable_if< is_tensor< Right >::value &&detail::is_numeric_v< Scalar >>::type * = nullptr>
TensorInterface_& TiledArray::detail::TensorInterface< T, R, OpResult >::mult_to ( const Right &  right,
const Scalar  factor 
)
inline

Scale and multiply this tensor by right.

Template Parameters
RightThe right-hand tensor type
ScalarA scalar type
Parameters
rightThe tensor that will be multiplied by this tensor
factorThe scaling factor
Returns
A reference to this tensor

Definition at line 883 of file tensor_interface.h.

Here is the call graph for this function:

◆ neg() [1/2]

template<typename T , typename R , typename OpResult >
result_tensor TiledArray::detail::TensorInterface< T, R, OpResult >::neg ( ) const
inline

Create a negated copy of this tensor.

Returns
A new tensor that contains the negative values of this tensor

Definition at line 894 of file tensor_interface.h.

Here is the call graph for this function:

◆ neg() [2/2]

template<typename T , typename R , typename OpResult >
template<typename Perm , typename = std::enable_if_t<detail::is_permutation_v<Perm>>>
result_tensor TiledArray::detail::TensorInterface< T, R, OpResult >::neg ( const Perm &  perm) const
inline

Create a negated and permuted copy of this tensor.

Parameters
permThe permutation to be applied to this tensor
Returns
A new tensor that contains the negative values of this tensor

Definition at line 904 of file tensor_interface.h.

Here is the call graph for this function:

◆ neg_to()

template<typename T , typename R , typename OpResult >
TensorInterface_& TiledArray::detail::TensorInterface< T, R, OpResult >::neg_to ( )
inline

Negate elements of this tensor.

Returns
A reference to this tensor

Definition at line 911 of file tensor_interface.h.

Here is the call graph for this function:

◆ norm()

template<typename T , typename R , typename OpResult >
template<typename ResultType = numeric_type>
ResultType TiledArray::detail::TensorInterface< T, R, OpResult >::norm ( ) const
inline

Vector 2-norm.

Template Parameters
ResultTypethe return type
Note
This evaluates std::sqrt(ResultType(this->squared_norm()))
Returns
The vector norm of this tensor

Definition at line 1055 of file tensor_interface.h.

Here is the call graph for this function:

◆ operator()() [1/2]

template<typename T , typename R , typename OpResult >
template<typename... Index>
reference TiledArray::detail::TensorInterface< T, R, OpResult >::operator() ( const Index &...  idx)
inline

Element accessor.

Template Parameters
IndexAn integral type pack or a single coodinate index type
Parameters
idxThe index pack

Definition at line 241 of file tensor_interface.h.

◆ operator()() [2/2]

template<typename T , typename R , typename OpResult >
template<typename... Index>
const_reference TiledArray::detail::TensorInterface< T, R, OpResult >::operator() ( const Index &...  idx) const
inline

Element accessor.

Template Parameters
IndexAn integral type pack or a single coodinate index type
Parameters
idxThe index pack

Definition at line 251 of file tensor_interface.h.

◆ operator=() [1/3]

template<typename T , typename R , typename OpResult >
template<typename T1 , typename std::enable_if< detail::is_tensor< T1 >::value >::type * = nullptr>
TensorInterface_& TiledArray::detail::TensorInterface< T, R, OpResult >::operator= ( const T1 &  other)
inline

Definition at line 193 of file tensor_interface.h.

Here is the call graph for this function:

◆ operator=() [2/3]

template<typename T , typename R , typename OpResult >
TensorInterface_& TiledArray::detail::TensorInterface< T, R, OpResult >::operator= ( const TensorInterface_ )
delete

◆ operator=() [3/3]

template<typename T , typename R , typename OpResult >
TensorInterface_& TiledArray::detail::TensorInterface< T, R, OpResult >::operator= ( TensorInterface_ &&  )
delete

◆ operator[]() [1/2]

template<typename T , typename R , typename OpResult >
reference TiledArray::detail::TensorInterface< T, R, OpResult >::operator[] ( const ordinal_type  index)
inline

Element subscript accessor.

Parameters
indexThe ordinal element index
Returns
A const reference to the element at index.

Definition at line 231 of file tensor_interface.h.

◆ operator[]() [2/2]

template<typename T , typename R , typename OpResult >
const_reference TiledArray::detail::TensorInterface< T, R, OpResult >::operator[] ( const ordinal_type  index) const
inline

Element subscript accessor.

Parameters
indexThe ordinal element index
Returns
A const reference to the element at index.

Definition at line 222 of file tensor_interface.h.

◆ permute()

template<typename T , typename R , typename OpResult >
template<typename Perm , typename = std::enable_if_t<detail::is_permutation_v<Perm>>>
result_tensor TiledArray::detail::TensorInterface< T, R, OpResult >::permute ( const Perm &  perm) const
inline

Definition at line 448 of file tensor_interface.h.

Here is the call graph for this function:

◆ product()

template<typename T , typename R , typename OpResult >
numeric_type TiledArray::detail::TensorInterface< T, R, OpResult >::product ( ) const
inline

Product of elements.

Returns
The product of all elements of this tensor

Definition at line 1029 of file tensor_interface.h.

Here is the call graph for this function:

◆ range()

template<typename T , typename R , typename OpResult >
const range_type& TiledArray::detail::TensorInterface< T, R, OpResult >::range ( ) const
inline

Tensor range object accessor.

Returns
The tensor range object

Definition at line 206 of file tensor_interface.h.

Here is the caller graph for this function:

◆ reduce() [1/2]

template<typename T , typename R , typename OpResult >
template<typename Right , typename ReduceOp , typename JoinOp , typename std::enable_if< is_tensor< Right >::value >::type * = nullptr>
numeric_type TiledArray::detail::TensorInterface< T, R, OpResult >::reduce ( const Right &  other,
ReduceOp &&  reduce_op,
JoinOp &&  join_op,
const numeric_type  identity 
) const
inline

Binary reduction operation.

Perform an element-wise binary reduction of the data of this and other by executing join_op(result, reduce_op(*this[i], other[i])) for each i in the index range of this . result is initialized to identity . If HAVE_INTEL_TBB is defined, and this is a contiguous tensor, the reduction will be executed in an undefined order, otherwise will execute in the order of increasing i .

Template Parameters
RightThe right-hand argument tensor type
ReduceOpThe reduction operation type
JoinOpThe join operation type
Parameters
otherThe right-hand argument of the binary reduction
reduce_opThe element-wise reduction operation
join_opThe join result operation
identityThe identity value of the reduction
Returns
The reduced value

Definition at line 1010 of file tensor_interface.h.

Here is the call graph for this function:

◆ reduce() [2/2]

template<typename T , typename R , typename OpResult >
template<typename ReduceOp , typename JoinOp >
numeric_type TiledArray::detail::TensorInterface< T, R, OpResult >::reduce ( ReduceOp &&  reduce_op,
JoinOp &&  join_op,
const numeric_type  identity 
) const
inline

Unary reduction operation.

Perform an element-wise reduction of the data by executing join_op(result, reduce_op(*this[i])) for each i in the index range of this . result is initialized to identity . If HAVE_INTEL_TBB is defined, and this is a contiguous tensor, the reduction will be executed in an undefined order, otherwise will execute in the order of increasing i .

Template Parameters
ReduceOpThe reduction operation type
JoinOpThe join operation type
Parameters
reduce_opThe element-wise reduction operation
join_opThe join result operation
identityThe identity value of the reduction
Returns
The reduced value

Definition at line 988 of file tensor_interface.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ scale() [1/2]

template<typename T , typename R , typename OpResult >
template<typename Scalar , typename std::enable_if< detail::is_numeric_v< Scalar >>::type * = nullptr>
result_tensor TiledArray::detail::TensorInterface< T, R, OpResult >::scale ( const Scalar  factor) const
inline

Construct a scaled copy of this tensor.

Template Parameters
ScalarA scalar type
Parameters
factorThe scaling factor
Returns
A new tensor where the elements of this tensor are scaled by factor

Definition at line 478 of file tensor_interface.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ scale() [2/2]

template<typename T , typename R , typename OpResult >
template<typename Scalar , typename Perm , typename std::enable_if< detail::is_numeric_v< Scalar > &&detail::is_permutation_v< Perm >>::type * = nullptr>
result_tensor TiledArray::detail::TensorInterface< T, R, OpResult >::scale ( const Scalar  factor,
const Perm &  perm 
) const
inline

Construct a scaled and permuted copy of this tensor.

Template Parameters
ScalarA scalar type
Parameters
factorThe scaling factor
permThe permutation to be applied to this tensor
Returns
A new tensor where the elements of this tensor are scaled by factor and permuted

Definition at line 494 of file tensor_interface.h.

Here is the call graph for this function:

◆ scale_to()

template<typename T , typename R , typename OpResult >
template<typename Scalar , typename std::enable_if< detail::is_numeric_v< Scalar >>::type * = nullptr>
TensorInterface_& TiledArray::detail::TensorInterface< T, R, OpResult >::scale_to ( const Scalar  factor)
inline

Scale this tensor.

Template Parameters
ScalarA scalar type
Parameters
factorThe scaling factor
Returns
A reference to this tensor

Definition at line 507 of file tensor_interface.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ shift() [1/2]

template<typename T , typename R , typename OpResult >
template<typename Index , typename = std::enable_if_t<detail::is_integral_range_v<Index>>>
result_tensor TiledArray::detail::TensorInterface< T, R, OpResult >::shift ( const Index &  bound_shift) const
inline

Make a copy of this view shited by bound_shift.

Template Parameters
IndexAn integral range type
Parameters
bound_shiftThe shift to be applied to the tensor range
Returns
A copy of the shifted view

Definition at line 300 of file tensor_interface.h.

◆ shift() [2/2]

template<typename T , typename R , typename OpResult >
template<typename Index , typename = std::enable_if_t<std::is_integral_v<Index>>>
result_tensor TiledArray::detail::TensorInterface< T, R, OpResult >::shift ( const std::initializer_list< Index > &  bound_shift) const
inline

Make a copy of this view shited by bound_shift.

Template Parameters
IndexAn integral range type
Parameters
bound_shiftThe shift to be applied to the tensor range
Returns
A copy of the shifted view

Definition at line 311 of file tensor_interface.h.

◆ shift_to() [1/2]

template<typename T , typename R , typename OpResult >
template<typename Index , typename = std::enable_if_t<detail::is_integral_range_v<Index>>>
TensorInterface_& TiledArray::detail::TensorInterface< T, R, OpResult >::shift_to ( const Index &  bound_shift)
inline

Shift the lower and upper bound of this tensor view.

Template Parameters
IndexAn integral range type
Parameters
bound_shiftThe shift to be applied to the tensor range
Returns
Reference to this

Definition at line 276 of file tensor_interface.h.

◆ shift_to() [2/2]

template<typename T , typename R , typename OpResult >
template<typename Index , typename = std::enable_if_t<std::is_integral_v<Index>>>
TensorInterface_& TiledArray::detail::TensorInterface< T, R, OpResult >::shift_to ( const std::initializer_list< Index > &  bound_shift)
inline

Shift the lower and upper bound of this tensor view.

Template Parameters
IndexAn integral type
Parameters
bound_shiftThe shift to be applied to the tensor range
Returns
Reference to this

Definition at line 288 of file tensor_interface.h.

◆ size()

template<typename T , typename R , typename OpResult >
ordinal_type TiledArray::detail::TensorInterface< T, R, OpResult >::size ( ) const
inline

Tensor dimension size accessor.

Returns
The number of elements in the tensor

Definition at line 211 of file tensor_interface.h.

◆ squared_norm()

template<typename T , typename R , typename OpResult >
scalar_type TiledArray::detail::TensorInterface< T, R, OpResult >::squared_norm ( ) const
inline

Square of vector 2-norm.

Returns
The vector norm of this tensor

Definition at line 1038 of file tensor_interface.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ subt() [1/6]

template<typename T , typename R , typename OpResult >
result_tensor TiledArray::detail::TensorInterface< T, R, OpResult >::subt ( const numeric_type  value) const
inline

Subtract a constant from a copy of this tensor.

Returns
A new tensor where the elements are the different between the elements of this and value

Definition at line 734 of file tensor_interface.h.

Here is the call graph for this function:

◆ subt() [2/6]

template<typename T , typename R , typename OpResult >
template<typename Perm , typename = std::enable_if_t<detail::is_permutation_v<Perm>>>
result_tensor TiledArray::detail::TensorInterface< T, R, OpResult >::subt ( const numeric_type  value,
const Perm &  perm 
) const
inline

Subtract a constant from a permuted copy of this tensor.

Parameters
valueThe constant to be subtracted
permThe permutation to be applied to this tensor
Returns
A new tensor where the elements are the different between the elements of this and value

Definition at line 744 of file tensor_interface.h.

Here is the call graph for this function:

◆ subt() [3/6]

template<typename T , typename R , typename OpResult >
template<typename Right , typename std::enable_if< is_tensor< Right >::value >::type * = nullptr>
result_tensor TiledArray::detail::TensorInterface< T, R, OpResult >::subt ( const Right &  right) const
inline

Subtract this and right to construct a new tensor.

Template Parameters
RightThe right-hand tensor type
Parameters
rightThe tensor that will be subtracted from this tensor
Returns
A new tensor where the elements are the different between the elements of this and right

Definition at line 662 of file tensor_interface.h.

Here is the call graph for this function:

◆ subt() [4/6]

template<typename T , typename R , typename OpResult >
template<typename Right , typename Perm , typename std::enable_if< is_tensor< Right >::value &&detail::is_permutation_v< Perm >>::type * = nullptr>
result_tensor TiledArray::detail::TensorInterface< T, R, OpResult >::subt ( const Right &  right,
const Perm &  perm 
) const
inline

Subtract this and right to construct a new, permuted tensor.

Template Parameters
RightThe right-hand tensor type
Parameters
rightThe tensor that will be subtracted from this tensor
permThe permutation to be applied to this tensor
Returns
A new tensor where the elements are the different between the elements of this and right

Definition at line 681 of file tensor_interface.h.

Here is the call graph for this function:

◆ subt() [5/6]

template<typename T , typename R , typename OpResult >
template<typename Right , typename Scalar , typename std::enable_if< is_tensor< Right >::value &&detail::is_numeric_v< Scalar >>::type * = nullptr>
result_tensor TiledArray::detail::TensorInterface< T, R, OpResult >::subt ( const Right &  right,
const Scalar  factor 
) const
inline

Scale and subtract this and right to construct a new tensor.

Template Parameters
RightThe right-hand tensor type
ScalarA scalar type
Parameters
rightThe tensor that will be subtracted from this tensor
factorThe scaling factor
Returns
A new tensor where the elements are the different between the elements of this and right, scaled by factor

Definition at line 702 of file tensor_interface.h.

Here is the call graph for this function:

◆ subt() [6/6]

template<typename T , typename R , typename OpResult >
template<typename Right , typename Scalar , typename Perm , typename std::enable_if< is_tensor< Right >::value &&detail::is_numeric_v< Scalar > &&detail::is_permutation_v< Perm >>::type * = nullptr>
result_tensor TiledArray::detail::TensorInterface< T, R, OpResult >::subt ( const Right &  right,
const Scalar  factor,
const Perm &  perm 
) const
inline

Scale and subtract this and right to construct a new, permuted tensor.

Template Parameters
RightThe right-hand tensor type
ScalarA scalar type
Parameters
rightThe tensor that will be subtracted from this tensor
factorThe scaling factor
permThe permutation to be applied to this tensor
Returns
A new tensor where the elements are the different between the elements of this and right, scaled by factor

Definition at line 721 of file tensor_interface.h.

Here is the call graph for this function:

◆ subt_to() [1/3]

template<typename T , typename R , typename OpResult >
TensorInterface_& TiledArray::detail::TensorInterface< T, R, OpResult >::subt_to ( const numeric_type  value)
inline

Subtract a constant from this tensor.

Returns
A reference to this tensor

Definition at line 780 of file tensor_interface.h.

Here is the call graph for this function:

◆ subt_to() [2/3]

template<typename T , typename R , typename OpResult >
template<typename Right , typename std::enable_if< is_tensor< Right >::value >::type * = nullptr>
TensorInterface_& TiledArray::detail::TensorInterface< T, R, OpResult >::subt_to ( const Right &  right)
inline

Subtract right from this tensor.

Template Parameters
RightThe right-hand tensor type
Parameters
rightThe tensor that will be subtracted from this tensor
Returns
A reference to this tensor

Definition at line 755 of file tensor_interface.h.

Here is the call graph for this function:

◆ subt_to() [3/3]

template<typename T , typename R , typename OpResult >
template<typename Right , typename Scalar , typename std::enable_if< is_tensor< Right >::value &&detail::is_numeric_v< Scalar >>::type * = nullptr>
TensorInterface_& TiledArray::detail::TensorInterface< T, R, OpResult >::subt_to ( const Right &  right,
const Scalar  factor 
)
inline

Subtract right from and scale this tensor.

Template Parameters
RightThe right-hand tensor type
ScalarA scalar type
Parameters
rightThe tensor that will be subtracted from this tensor
factorThe scaling factor
Returns
A reference to this tensor

Definition at line 771 of file tensor_interface.h.

Here is the call graph for this function:

◆ sum()

template<typename T , typename R , typename OpResult >
numeric_type TiledArray::detail::TensorInterface< T, R, OpResult >::sum ( ) const
inline

Sum of elements.

Returns
The sum of all elements of this tensor

Definition at line 1020 of file tensor_interface.h.

Here is the call graph for this function:

◆ swap()

template<typename T , typename R , typename OpResult >
void TiledArray::detail::TensorInterface< T, R, OpResult >::swap ( TensorInterface_ other)
inline

Swap tensor views.

Parameters
otherThe view to be swapped

Definition at line 264 of file tensor_interface.h.

Here is the call graph for this function:

◆ unary() [1/2]

template<typename T , typename R , typename OpResult >
template<typename Op >
result_tensor TiledArray::detail::TensorInterface< T, R, OpResult >::unary ( Op &&  op) const
inline

Use a unary, element wise operation to construct a new tensor.

Template Parameters
OpThe unary operation type
Parameters
opThe unary, element-wise operation
Returns
A tensor where element i of the new tensor is equal to op(*this[i])
Exceptions
TiledArray::ExceptionWhen this tensor is empty.

Definition at line 395 of file tensor_interface.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unary() [2/2]

template<typename T , typename R , typename OpResult >
template<typename Op , typename Perm , typename = std::enable_if_t<detail::is_permutation_v<Perm>>>
result_tensor TiledArray::detail::TensorInterface< T, R, OpResult >::unary ( Op &&  op,
const Perm &  perm 
) const
inline

Use a unary, element wise operation to construct a new, permuted tensor.

Template Parameters
OpThe unary operation type
Parameters
opThe unary operation
permThe permutation to be applied to this tensor
Returns
A permuted tensor with elements that have been modified by op
Exceptions
TiledArray::ExceptionWhen this tensor is empty.
TiledArray::ExceptionThe dimension of perm does not match that of this tensor.

Definition at line 413 of file tensor_interface.h.

Here is the call graph for this function:

Friends And Related Function Documentation

◆ TensorInterface

template<typename T , typename R , typename OpResult >
template<typename , typename , typename >
friend class TensorInterface
friend

Definition at line 114 of file tensor_interface.h.

◆ TiledArray::remap [1/4]

template<typename T , typename R , typename OpResult >
template<typename U , typename Range_ , typename OpResult_ , typename Index1 , typename Index2 >
void TiledArray::remap ( detail::TensorInterface< const U, Range_, OpResult_ > &  ,
U * const  ,
const Index1 &  ,
const Index2 &   
)
friend

◆ TiledArray::remap [2/4]

template<typename T , typename R , typename OpResult >
template<typename U , typename Range_ , typename OpResult_ , typename Index1 , typename Index2 >
void TiledArray::remap ( detail::TensorInterface< const U, Range_, OpResult_ > &  ,
U * const  ,
const std::initializer_list< Index1 > &  ,
const std::initializer_list< Index2 > &   
)
friend

◆ TiledArray::remap [3/4]

template<typename T , typename R , typename OpResult >
template<typename U , typename Range_ , typename OpResult_ , typename Index1 , typename Index2 >
void TiledArray::remap ( detail::TensorInterface< U, Range_, OpResult_ > &  ,
U * const  ,
const Index1 &  ,
const Index2 &   
)
friend

◆ TiledArray::remap [4/4]

template<typename T , typename R , typename OpResult >
template<typename U , typename Range_ , typename OpResult_ , typename Index1 , typename Index2 >
void TiledArray::remap ( detail::TensorInterface< U, Range_, OpResult_ > &  ,
U * const  ,
const std::initializer_list< Index1 > &  ,
const std::initializer_list< Index2 > &   
)
friend

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