Documentation
Typedefs | |
template<typename... T> | |
using | TiledArray::result_of_subt_t = decltype(subt(std::declval< T >()...)) |
template<typename... T> | |
using | TiledArray::result_of_subt_to_t = decltype(subt_to(std::declval< T >()...)) |
template<typename... T> | |
using | TiledArray::result_of_mult_t = decltype(mult(std::declval< T >()...)) |
template<typename... T> | |
using | TiledArray::result_of_mult_to_t = decltype(mult_to(std::declval< T >()...)) |
template<typename... T> | |
using | TiledArray::result_of_binary_t = decltype(binary(std::declval< T >()...)) |
template<typename... T> | |
using | TiledArray::result_of_inplace_binary_t = decltype(inplace_binary(std::declval< T >()...)) |
template<typename... T> | |
using | TiledArray::result_of_neg_t = decltype(neg(std::declval< T >()...)) |
template<typename... T> | |
using | TiledArray::result_of_neg_to_t = decltype(neg_to(std::declval< T >()...)) |
template<typename... T> | |
using | TiledArray::result_of_conj_t = decltype(conj(std::declval< T >()...)) |
template<typename... T> | |
using | TiledArray::result_of_conj_to_t = decltype(conj_to(std::declval< T >()...)) |
template<typename... T> | |
using | TiledArray::result_of_unary_t = decltype(unary(std::declval< T >()...)) |
template<typename... T> | |
using | TiledArray::result_of_inplace_unary_t = decltype(inplace_unary(std::declval< T >()...)) |
template<typename... T> | |
using | TiledArray::result_of_gemm_t = decltype(gemm(std::declval< T >()...)) |
template<typename T > | |
using | TiledArray::result_of_sum_t = decltype(sum(std::declval< T >())) |
template<typename T > | |
using | TiledArray::result_of_product_t = decltype(product(std::declval< T >())) |
template<typename T > | |
using | TiledArray::result_of_squared_norm_t = decltype(squared_norm(std::declval< T >())) |
template<typename T , typename ResultType = T> | |
using | TiledArray::result_of_norm_t = decltype(norm(std::declval< T >(), std::declval< ResultType & >())) |
template<typename T > | |
using | TiledArray::result_of_max_t = decltype(max(std::declval< T >())) |
template<typename T > | |
using | TiledArray::result_of_min_t = decltype(min(std::declval< T >())) |
template<typename T > | |
using | TiledArray::result_of_abs_max_t = decltype(abs_max(std::declval< T >())) |
template<typename T > | |
using | TiledArray::result_of_abs_min_t = decltype(abs_min(std::declval< T >())) |
template<typename L , typename R > | |
using | TiledArray::result_of_dot_t = decltype(dot(std::declval< L >(), std::declval< R >())) |
Functions | |
template<typename Left , typename Right > | |
auto | TiledArray::subt (const Left &left, const Right &right) |
Subtract tile arguments. More... | |
template<typename Left , typename Right , typename Scalar , typename std::enable_if< detail::is_numeric_v< Scalar >>::type * = nullptr> | |
auto | TiledArray::subt (const Left &left, const Right &right, const Scalar factor) |
Subtract and scale tile arguments. More... | |
template<typename Left , typename Right , typename Perm , typename = std::enable_if_t<detail::is_permutation_v<Perm>>> | |
auto | TiledArray::subt (const Left &left, const Right &right, const Perm &perm) |
Subtract and permute tile arguments. More... | |
template<typename Left , typename Right , typename Scalar , typename Perm , typename std::enable_if< detail::is_numeric_v< Scalar > &&detail::is_permutation_v< Perm >>::type * = nullptr> | |
auto | TiledArray::subt (const Left &left, const Right &right, const Scalar factor, const Perm &perm) |
Subtract, scale, and permute tile arguments. More... | |
template<typename Arg , typename Scalar , typename std::enable_if< detail::is_numeric_v< Scalar >>::type * = nullptr> | |
auto | TiledArray::subt (const Arg &arg, const Scalar value) |
Subtract a scalar constant from the tile argument. More... | |
template<typename Arg , typename Scalar , typename Perm , typename std::enable_if< detail::is_numeric_v< Scalar > &&detail::is_permutation_v< Perm >>::type * = nullptr> | |
auto | TiledArray::subt (const Arg &arg, const Scalar value, const Perm &perm) |
Subtract a constant scalar and permute tile argument. More... | |
template<typename Result , typename Arg > | |
Result & | TiledArray::subt_to (Result &result, const Arg &arg) |
Subtract from the result tile. More... | |
template<typename Result , typename Arg , typename Scalar , typename std::enable_if< detail::is_numeric_v< Scalar >>::type * = nullptr> | |
Result & | TiledArray::subt_to (Result &result, const Arg &arg, const Scalar factor) |
Subtract and scale from the result tile. More... | |
template<typename Result , typename Scalar , typename std::enable_if< detail::is_numeric_v< Scalar >>::type * = nullptr> | |
Result & | TiledArray::subt_to (Result &result, const Scalar value) |
Subtract constant scalar from the result tile. More... | |
template<typename Left , typename Right > | |
auto | TiledArray::mult (const Left &left, const Right &right) |
Multiplication tile arguments. More... | |
template<typename Left , typename Right , typename Scalar , std::enable_if_t< TiledArray::detail::is_numeric_v< Scalar >> * = nullptr> | |
auto | TiledArray::mult (const Left &left, const Right &right, const Scalar factor) |
Multiplication and scale tile arguments. More... | |
template<typename Left , typename Right , typename Perm , typename = std::enable_if_t<detail::is_permutation_v<Perm> && detail::has_member_function_mult_anyreturn_v< const Left, const Right&, const Perm&>>> | |
auto | TiledArray::mult (const Left &left, const Right &right, const Perm &perm) |
Multiplication and permute tile arguments. More... | |
template<typename Left , typename Right , typename Scalar , typename Perm , std::enable_if_t< TiledArray::detail::is_numeric_v< Scalar > &&detail::is_permutation_v< Perm >> * = nullptr> | |
auto | TiledArray::mult (const Left &left, const Right &right, const Scalar factor, const Perm &perm) |
Multiplication, scale, and permute tile arguments. More... | |
template<typename Result , typename Arg > | |
Result & | TiledArray::mult_to (Result &result, const Arg &arg) |
Multiply to the result tile. More... | |
template<typename Result , typename Arg , typename Scalar , std::enable_if_t< TiledArray::detail::is_numeric_v< Scalar >> * = nullptr> | |
Result & | TiledArray::mult_to (Result &result, const Arg &arg, const Scalar factor) |
Multiply and scale to the result tile. More... | |
template<typename Left , typename Right , typename Op > | |
decltype(auto) | TiledArray::binary (const Left &left, const Right &right, Op &&op) |
Binary element-wise transform producing a new tile. More... | |
template<typename Left , typename Right , typename Op , typename Perm , typename = std::enable_if_t<detail::is_permutation_v<Perm>>> | |
decltype(auto) | TiledArray::binary (const Left &left, const Right &right, Op &&op, const Perm &perm) |
Binary element-wise transform producing a new tile. More... | |
template<typename Left , typename Right , typename Op > | |
Left & | TiledArray::inplace_binary (Left &left, const Right &right, Op &&op) |
Binary element-wise in-place transform. More... | |
template<typename Arg > | |
auto | TiledArray::neg (const Arg &arg) |
Negate the tile argument. More... | |
template<typename Arg , typename Perm , typename = std::enable_if_t<detail::is_permutation_v<Perm>>> | |
auto | TiledArray::neg (const Arg &arg, const Perm &perm) |
Negate and permute tile argument. More... | |
template<typename Result > | |
Result & | TiledArray::neg_to (Result &result) |
Negate the tile argument in-place. More... | |
template<typename Arg > | |
auto | TiledArray::conj (const Arg &arg) |
Create a complex conjugated copy of a tile. More... | |
template<typename Arg , typename Scalar , typename std::enable_if< TiledArray::detail::is_numeric_v< Scalar >>::type * = nullptr> | |
auto | TiledArray::conj (const Arg &arg, const Scalar factor) |
Create a complex conjugated and scaled copy of a tile. More... | |
template<typename Arg , typename Perm , typename = std::enable_if_t<detail::is_permutation_v<Perm>>> | |
auto | TiledArray::conj (const Arg &arg, const Perm &perm) |
Create a complex conjugated and permuted copy of a tile. More... | |
template<typename Arg , typename Scalar , typename Perm , typename std::enable_if< TiledArray::detail::is_numeric_v< Scalar > &&detail::is_permutation_v< Perm >>::type * = nullptr> | |
auto | TiledArray::conj (const Arg &arg, const Scalar factor, const Perm &perm) |
Create a complex conjugated, scaled, and permuted copy of a tile. More... | |
template<typename Result > | |
Result & | TiledArray::conj_to (Result &result) |
In-place complex conjugate a tile. More... | |
template<typename Result , typename Scalar , typename std::enable_if< TiledArray::detail::is_numeric_v< Scalar >>::type * = nullptr> | |
Result & | TiledArray::conj_to (Result &result, const Scalar factor) |
In-place complex conjugate and scale a tile. More... | |
template<typename Arg , typename Op > | |
decltype(auto) | TiledArray::unary (const Arg &arg, Op &&op) |
Unary element-wise transform producing a new tile. More... | |
template<typename Arg , typename Op , typename Perm , typename = std::enable_if_t<detail::is_permutation_v<Perm>>> | |
decltype(auto) | TiledArray::unary (const Arg &arg, Op &&op, const Perm &perm) |
Unary element-wise transform producing a new tile. More... | |
template<typename Result , typename Op > | |
Result & | TiledArray::inplace_unary (Result &arg, Op &&op) |
Unary element-wise in-place transform. More... | |
template<typename Left , typename Right , typename Scalar , std::enable_if_t< TiledArray::detail::is_numeric_v< Scalar >> * = nullptr> | |
auto | TiledArray::gemm (const Left &left, const Right &right, const Scalar factor, const math::GemmHelper &gemm_config) |
Contract 2 tensors over head/tail modes and scale the product. More... | |
template<typename Result , typename Left , typename Right , typename Scalar , std::enable_if_t< TiledArray::detail::is_numeric_v< Scalar >> * = nullptr> | |
Result & | TiledArray::gemm (Result &result, const Left &left, const Right &right, const Scalar factor, const math::GemmHelper &gemm_config) |
template<typename Result , typename Left , typename Right , typename ElementMultiplyAddOp , std::enable_if_t< std::is_invocable_r_v< void, std::remove_reference_t< ElementMultiplyAddOp >, typename Result::value_type &, const typename Left::value_type &, const typename Right::value_type & >> * = nullptr> | |
Result & | TiledArray::gemm (Result &result, const Left &left, const Right &right, const math::GemmHelper &gemm_config, ElementMultiplyAddOp &&element_multiplyadd_op) |
template<typename Arg > | |
auto | TiledArray::sum (const Arg &arg) |
Sum the hyper-diagonal elements a tile. More... | |
template<typename Arg > | |
auto | TiledArray::product (const Arg &arg) |
Multiply the elements of a tile. More... | |
template<typename Arg > | |
auto | TiledArray::squared_norm (const Arg &arg) |
Squared vector 2-norm of the elements of a tile. More... | |
template<typename Arg > | |
auto | TiledArray::norm (const Arg &arg) |
Vector 2-norm of a tile. More... | |
template<typename Arg , typename ResultType > | |
void | TiledArray::norm (const Arg &arg, ResultType &result) |
Vector 2-norm of a tile. More... | |
template<typename Arg > | |
auto | TiledArray::max (const Arg &arg) |
Maximum element of a tile. More... | |
template<typename Arg > | |
auto | TiledArray::min (const Arg &arg) |
Minimum element of a tile. More... | |
template<typename Arg > | |
auto | TiledArray::abs_max (const Arg &arg) |
Absolute maximum element of a tile. More... | |
template<typename Arg > | |
auto | TiledArray::abs_min (const Arg &arg) |
Absolute mainimum element of a tile. More... | |
template<typename Left , typename Right > | |
auto | TiledArray::dot (const Left &left, const Right &right) |
Vector dot product of two tiles. More... | |
template<typename Left , typename Right > | |
auto | TiledArray::inner_product (const Left &left, const Right &right) |
Vector inner product of two tiles. More... | |
Introduction
To use a user defined tile types in TiledArray expressions, users must define a set of interface function that define basic arithmetic and query operations. It is not necessary to define all operations, only those that are required for the algebraic tensor operations used in your application. However, more than one function may be necessary for a given expression operator. Each function has an intrusive and non-intrusive interface that may be used to implement the required functionality. Below is a description of each interface function, the intrusive and non-intrusive function signatures of the function, and, in some cases, a reference implementation. The reference implementation assumes that the tensor type has a range()
member for convenience, but this is not necessary. Tensor implementations may have any arbitrary range interface function(s).
Minimum Tile Requirements
The minimum requirements for user defined tile types are:
- An accessible copy constructor
- An accessible destructor
- Must be a shallow copy object
TiledArray assumes tiles are shallow copy objects for efficiency when coping objects and to avoid unnecessary replication of data. A shallow copy object is an object that only copies a pointer (and updates a reference counter) instead of explicitly copying all elements of the tile. If your tile object is not a shallow copy object, you can use the TiledArray::Tile
class to wrap the object.
Interface and Naming Convention
The naming convention used for interface functions is:
xxxx
- Basexxxx
operation that creates a new tile object from the input arguments.xxxx_to
- Basexxxx
operation that modifies the first argument or calling object in-place (without constructing an new object).
where xxxx
represent the arithmetic/mutating operation performed by the interface function, which includes:
add
subt
mult
scal
gemm
neg
shift
There are additional functions supporting generic unary and binary element-wise operations:
unary
inplace_unary
binary
inplace_binary
There are multiple overloaded version of these function, which combine scaling, permuting, or scaling and permuting operations with the base arithmetic/mutating operation.
In the following sections, TensorType
is used to represent an arbitrary user-defined tile type that meets the minimum requirements specified above. ScalarType
is used to represent an built-in scalar data type (e.g. int
, float
, etc.). The example code below is used for demonstration purposes and may not be the an optimal solution.
Required Functions
The minimum set of functions required are:
empty
clone
permute
scale
These functions are necessary for all tile operations.
Empty
The empty function checks that the tile object has been initialized and is usable in arithmetic operations. It returns true
if the tile has not been initialized, otherwise false
. It is possible for empty to always return false
, if the tile type does not support default construction (or uninitialized) objects.
Non-intrusive interface:
Intrusive interface:
Clone
The clone function creates a "deep" copy of a tensor, i.e. all data elements of the tile are explicitly copied to a new object.
Non-intrusive interface:
Intrusive interface:
Permute
The permute function reorders the data of an input tile by swapping the indices in the output tile. For example, the transpose of a matrix is the equivalent of permutation P(1,0), where indices 0 and 1 are swapped. The implementation of permute must support arbitrary permutations up to the highest rank supported by the tile type.
Non-intrusive interface:
Intrusive interface:
Example:
The following code constructs a permuted copy of the argument. The example code assumes TensorType
has a range()
member function that returns a TiledArray::Range
object. However, this is an implementation detail that is not necessary.
Scale
The scale interface consists of two function groups scale
and scale_to
.
Non-intrusive interface:
Intrusive interface:
Function (1) creates a copy of the argument tensor that is scaled by factor
, (2) creates a copy of the argument tensor that is scaled by factor
and permuted by perm
, and (3) scales the argument tensor in-place (without creating a copy).
Example:
Tile Addition Interface
The tile addition interface include several functions, which are required for to implement simple addition operations.
Typedef Documentation
◆ result_of_abs_max_t
using TiledArray::result_of_abs_max_t = typedef decltype(abs_max(std::declval<T>())) |
Definition at line 998 of file tile_interface.h.
◆ result_of_abs_min_t
using TiledArray::result_of_abs_min_t = typedef decltype(abs_min(std::declval<T>())) |
Definition at line 1001 of file tile_interface.h.
◆ result_of_binary_t
using TiledArray::result_of_binary_t = typedef decltype(binary(std::declval<T>()...)) |
Definition at line 568 of file tile_interface.h.
◆ result_of_conj_t
using TiledArray::result_of_conj_t = typedef decltype(conj(std::declval<T>()...)) |
Definition at line 697 of file tile_interface.h.
◆ result_of_conj_to_t
using TiledArray::result_of_conj_to_t = typedef decltype(conj_to(std::declval<T>()...)) |
Definition at line 700 of file tile_interface.h.
◆ result_of_dot_t
using TiledArray::result_of_dot_t = typedef decltype(dot(std::declval<L>(), std::declval<R>())) |
Definition at line 1004 of file tile_interface.h.
◆ result_of_gemm_t
using TiledArray::result_of_gemm_t = typedef decltype(gemm(std::declval<T>()...)) |
Definition at line 845 of file tile_interface.h.
◆ result_of_inplace_binary_t
using TiledArray::result_of_inplace_binary_t = typedef decltype(inplace_binary(std::declval<T>()...)) |
Definition at line 571 of file tile_interface.h.
◆ result_of_inplace_unary_t
using TiledArray::result_of_inplace_unary_t = typedef decltype(inplace_unary(std::declval<T>()...)) |
Definition at line 753 of file tile_interface.h.
◆ result_of_max_t
using TiledArray::result_of_max_t = typedef decltype(max(std::declval<T>())) |
Definition at line 992 of file tile_interface.h.
◆ result_of_min_t
using TiledArray::result_of_min_t = typedef decltype(min(std::declval<T>())) |
Definition at line 995 of file tile_interface.h.
◆ result_of_mult_t
using TiledArray::result_of_mult_t = typedef decltype(mult(std::declval<T>()...)) |
Definition at line 507 of file tile_interface.h.
◆ result_of_mult_to_t
using TiledArray::result_of_mult_to_t = typedef decltype(mult_to(std::declval<T>()...)) |
Definition at line 510 of file tile_interface.h.
◆ result_of_neg_t
using TiledArray::result_of_neg_t = typedef decltype(neg(std::declval<T>()...)) |
Definition at line 613 of file tile_interface.h.
◆ result_of_neg_to_t
using TiledArray::result_of_neg_to_t = typedef decltype(neg_to(std::declval<T>()...)) |
Definition at line 616 of file tile_interface.h.
◆ result_of_norm_t
using TiledArray::result_of_norm_t = typedef decltype(norm(std::declval<T>(), std::declval<ResultType&>())) |
Definition at line 988 of file tile_interface.h.
◆ result_of_product_t
using TiledArray::result_of_product_t = typedef decltype(product(std::declval<T>())) |
Definition at line 982 of file tile_interface.h.
◆ result_of_squared_norm_t
using TiledArray::result_of_squared_norm_t = typedef decltype(squared_norm(std::declval<T>())) |
Definition at line 985 of file tile_interface.h.
◆ result_of_subt_t
using TiledArray::result_of_subt_t = typedef decltype(subt(std::declval<T>()...)) |
Definition at line 410 of file tile_interface.h.
◆ result_of_subt_to_t
using TiledArray::result_of_subt_to_t = typedef decltype(subt_to(std::declval<T>()...)) |
Definition at line 413 of file tile_interface.h.
◆ result_of_sum_t
using TiledArray::result_of_sum_t = typedef decltype(sum(std::declval<T>())) |
Definition at line 979 of file tile_interface.h.
◆ result_of_unary_t
using TiledArray::result_of_unary_t = typedef decltype(unary(std::declval<T>()...)) |
Definition at line 750 of file tile_interface.h.
Function Documentation
◆ abs_max()
|
inline |
Absolute maximum element of a tile.
- Template Parameters
-
Arg The tile argument type
- Parameters
-
arg The argument to find the maximum
- Returns
- A scalar that is equal to
abs(max(arg))
Definition at line 937 of file tile_interface.h.
◆ abs_min()
|
inline |
Absolute mainimum element of a tile.
- Template Parameters
-
Arg The tile argument type
- Parameters
-
arg The argument to find the minimum
- Returns
- A scalar that is equal to
abs(min(arg))
Definition at line 947 of file tile_interface.h.
◆ binary() [1/2]
|
inline |
Binary element-wise transform producing a new tile.
- Template Parameters
-
Left The left-hand tile type Right The right-hand tile type Op An element-wise operation type
- Parameters
-
[in] left The left-hand argument to the transform [in] right The right-hand argument to the transform op An element-wise operation
- Returns
result
where for eachi
inleft.range()
result
[i]==op(left[i],right[i])
Definition at line 527 of file tile_interface.h.
◆ binary() [2/2]
|
inline |
Binary element-wise transform producing a new tile.
- Template Parameters
-
Left The left-hand tile type Right The right-hand tile type Op An element-wise operation type Perm A permutation type
- Parameters
-
[in] left The left-hand argument to the transform [in] right The right-hand argument to the transform op An element-wise operation perm The permutation to be applied to the result
- Returns
perm^result
where for eachi
inleft.range()
result
[i]==op(left[i],right[i])
Definition at line 546 of file tile_interface.h.
◆ conj() [1/4]
|
inline |
Create a complex conjugated copy of a tile.
- Template Parameters
-
Arg The tile argument type
- Parameters
-
arg The tile to be conjugated
- Returns
- A complex conjugated copy of
arg
Definition at line 626 of file tile_interface.h.
◆ conj() [2/4]
|
inline |
Create a complex conjugated and permuted copy of a tile.
- Template Parameters
-
Arg The tile argument type
- Parameters
-
arg The tile to be conjugated perm The permutation to be applied to arg
- Returns
- A complex conjugated and permuted copy of
arg
Definition at line 652 of file tile_interface.h.
◆ conj() [3/4]
|
inline |
Create a complex conjugated and scaled copy of a tile.
- Template Parameters
-
Arg The tile argument type Scalar A scalar type
- Parameters
-
arg The tile to be conjugated factor The scaling factor
- Returns
- A complex conjugated and scaled copy of
arg
Definition at line 640 of file tile_interface.h.
◆ conj() [4/4]
|
inline |
Create a complex conjugated, scaled, and permuted copy of a tile.
- Template Parameters
-
Arg The tile argument type Scalar A scalar type
- Parameters
-
arg The argument to be conjugated factor The scaling factor perm The permutation to be applied to arg
- Returns
- A complex conjugated, scaled, and permuted copy of
arg
Definition at line 668 of file tile_interface.h.
◆ conj_to() [1/2]
|
inline |
In-place complex conjugate a tile.
- Template Parameters
-
Result The tile type
- Parameters
-
result The tile to be conjugated
- Returns
- A reference to
result
Definition at line 678 of file tile_interface.h.
◆ conj_to() [2/2]
|
inline |
In-place complex conjugate and scale a tile.
- Template Parameters
-
Result The tile type Scalar A scalar type
- Parameters
-
result The tile to be conjugated factor The scaling factor
- Returns
- A reference to
result
Definition at line 692 of file tile_interface.h.
◆ dot()
|
inline |
Vector dot product of two tiles.
- Template Parameters
-
Left The left-hand argument tile type Right The right-hand argument tile type
- Parameters
-
left The left-hand argument tile right The right-hand argument tile
- Returns
- A scalar that is equal to
sum_i left[i] * right[i]
Definition at line 959 of file tile_interface.h.
◆ gemm() [1/3]
|
inline |
Contract 2 tensors over head/tail modes and scale the product.
The contraction is done via a GEMM operation with fused indices as defined by gemm_config
.
- Template Parameters
-
Left The left-hand tile type Right The right-hand tile type Scalar A scalar type
- Parameters
-
left The left-hand argument to be contracted right The right-hand argument to be contracted factor The scaling factor gemm_config A helper object used to simplify gemm operations
- Returns
- A tile that is equal to
(left * right) * factor
Definition at line 771 of file tile_interface.h.
◆ gemm() [2/3]
|
inline |
Definition at line 836 of file tile_interface.h.
◆ gemm() [3/3]
|
inline |
Contract 2 tensors over head/tail modes, scale the product, and add to result
The contraction is done via a GEMM operation with fused indices as defined by gemm_config
.
- Template Parameters
-
Result The result tile type Left The left-hand tile type Right The right-hand tile type Scalar A numeric type
- Parameters
-
result The contracted result left The left-hand argument to be contracted right The right-hand argument to be contracted factor The scaling factor gemm_config A helper object used to simplify gemm operations
- Returns
- A tile that is equal to
result + (left * right) * factor
Definition at line 793 of file tile_interface.h.
◆ inner_product()
|
inline |
Vector inner product of two tiles.
- Template Parameters
-
Left The left-hand argument tile type Right The right-hand argument tile type
- Parameters
-
left The left-hand argument tile right The right-hand argument tile
- Returns
- A scalar that is equal to
sum_i conj(left[i]) * right[i]
Definition at line 971 of file tile_interface.h.
◆ inplace_binary()
|
inline |
Binary element-wise in-place transform.
- Template Parameters
-
Left The left-hand tile type Right The right-hand tile type Op An element-wise operation type
- Parameters
-
[in,out] left The left-hand argument to the transform; output contains the result of binary(left,right,op)
[in] right The right-hand argument to the transform op An element-wise operation
- Returns
- reference to
left
Definition at line 563 of file tile_interface.h.
◆ inplace_unary()
|
inline |
Unary element-wise in-place transform.
- Template Parameters
-
Arg The tile argument type Op An element-wise operation type
- Parameters
-
[in,out] arg The tile to be transformed, on output for each i
inarg.range()
arg
[i] containsop(arg[i])
op An element-wise operation
- Returns
reference
toarg
Definition at line 745 of file tile_interface.h.
◆ max()
|
inline |
Maximum element of a tile.
- Template Parameters
-
Arg The tile argument type
- Parameters
-
arg The argument to find the maximum
- Returns
- A scalar that is equal to
max(arg)
Definition at line 917 of file tile_interface.h.
◆ min()
|
inline |
Minimum element of a tile.
- Template Parameters
-
Arg The tile argument type
- Parameters
-
arg The argument to find the minimum
- Returns
- A scalar that is equal to
min(arg)
Definition at line 927 of file tile_interface.h.
◆ mult() [1/4]
|
inline |
Multiplication tile arguments.
- Template Parameters
-
Left The left-hand tile type Right The right-hand tile type
- Parameters
-
left The left-hand argument to be multiplied right The right-hand argument to be multiplied
- Returns
- A tile that is equal to
(left * right)
Definition at line 425 of file tile_interface.h.
◆ mult() [2/4]
|
inline |
Multiplication and permute tile arguments.
- Template Parameters
-
Left The left-hand tile type Right The right-hand tile type
- Parameters
-
left The left-hand argument to be multiplied right The right-hand argument to be multiplied perm The permutation to be applied to the result
- Returns
- A tile that is equal to
perm ^ (left * right)
Definition at line 457 of file tile_interface.h.
◆ mult() [3/4]
|
inline |
Multiplication and scale tile arguments.
- Template Parameters
-
Left The left-hand tile type Right The right-hand tile type Scalar A scalar type
- Parameters
-
left The left-hand argument to be multiplied right The right-hand argument to be multiplied factor The scaling factor
- Returns
- A tile that is equal to
(left * right) * factor
Definition at line 440 of file tile_interface.h.
◆ mult() [4/4]
|
inline |
Multiplication, scale, and permute tile arguments.
- Template Parameters
-
Left The left-hand tile type Right The right-hand tile type Scalar A scalar type
- Parameters
-
left The left-hand argument to be multiplied right The right-hand argument to be multiplied factor The scaling factor perm The permutation to be applied to the result
- Returns
- A tile that is equal to
perm ^ (left * right) * factor
Definition at line 474 of file tile_interface.h.
◆ mult_to() [1/2]
|
inline |
Multiply to the result tile.
- Template Parameters
-
Result The result tile type Arg The argument tile type
- Parameters
-
result The result tile to be multiplied arg The argument to be multiplied by the result
- Returns
- A tile that is equal to
result *= arg
Definition at line 487 of file tile_interface.h.
◆ mult_to() [2/2]
|
inline |
Multiply and scale to the result tile.
- Template Parameters
-
Result The result tile type Arg The argument tile type Scalar A scalar type
- Parameters
-
result The result tile to be multiplied arg The argument to be multiplied by result
factor The scaling factor
- Returns
- A tile that is equal to
(result *= arg) *= factor
Definition at line 502 of file tile_interface.h.
◆ neg() [1/2]
|
inline |
Negate the tile argument.
- Template Parameters
-
Arg The tile argument type
- Parameters
-
arg The argument to be negated
- Returns
- A tile that is equal to
-arg
Definition at line 586 of file tile_interface.h.
◆ neg() [2/2]
|
inline |
Negate and permute tile argument.
- Template Parameters
-
Arg The tile argument type
- Parameters
-
arg The argument to be negated perm The permutation to be applied to the result
- Returns
- A tile that is equal to
perm ^ -arg
Definition at line 598 of file tile_interface.h.
◆ neg_to()
|
inline |
Negate the tile argument in-place.
- Template Parameters
-
Result The result tile type
- Parameters
-
result The result tile to be negated
- Returns
- Reference to
result
Definition at line 608 of file tile_interface.h.
◆ norm() [1/2]
|
inline |
Vector 2-norm of a tile.
- Template Parameters
-
Arg The tile argument type
- Parameters
-
arg The argument to be multiplied and summed
- Returns
- A scalar that is equal to
sqrt(sum_i arg[i] * arg[i])
Definition at line 896 of file tile_interface.h.
◆ norm() [2/2]
|
inline |
Vector 2-norm of a tile.
- Template Parameters
-
Arg The tile argument type ResultType The result type
- Parameters
-
arg The argument to be multiplied and summed
- Returns
- A scalar that is equal to
sqrt(sum_i arg[i] * arg[i])
Definition at line 907 of file tile_interface.h.
◆ product()
|
inline |
Multiply the elements of a tile.
- Template Parameters
-
Arg The tile argument type
- Parameters
-
arg The argument to be multiplied
- Returns
- A scalar that is equal to
prod_i arg[i]
Definition at line 875 of file tile_interface.h.
◆ squared_norm()
|
inline |
Squared vector 2-norm of the elements of a tile.
- Template Parameters
-
Arg The tile argument type
- Parameters
-
arg The argument to be multiplied and summed
- Returns
- The sum of the squared elements of
arg
-
A scalar that is equal to
sum_i arg[i] * arg[i]
Definition at line 886 of file tile_interface.h.
◆ subt() [1/6]
|
inline |
Subtract a scalar constant from the tile argument.
- Template Parameters
-
Arg The tile argument type Scalar A scalar type
- Parameters
-
arg The left-hand argument to be subtracted value The constant scalar to be subtracted
- Returns
- A tile that is equal to
arg - value
Definition at line 347 of file tile_interface.h.
◆ subt() [2/6]
|
inline |
Subtract a constant scalar and permute tile argument.
- Template Parameters
-
Arg The tile argument type Scalar A scalar type
- Parameters
-
arg The left-hand argument to be subtracted value The constant scalar value to be subtracted perm The permutation to be applied to the result
- Returns
- A tile that is equal to
perm ^ (arg - value)
Definition at line 363 of file tile_interface.h.
◆ subt() [3/6]
|
inline |
Subtract tile arguments.
- Template Parameters
-
Left The left-hand tile type Right The right-hand tile type
- Parameters
-
left The left-hand argument to be subtracted right The right-hand argument to be subtracted
- Returns
- A tile that is equal to
(left - right)
Definition at line 284 of file tile_interface.h.
◆ subt() [4/6]
|
inline |
Subtract and permute tile arguments.
- Template Parameters
-
Left The left-hand tile type Right The right-hand tile type
- Parameters
-
left The left-hand argument to be subtracted right The right-hand argument to be subtracted perm The permutation to be applied to the result
- Returns
- A tile that is equal to
perm ^ (left - right)
Definition at line 314 of file tile_interface.h.
◆ subt() [5/6]
|
inline |
Subtract and scale tile arguments.
- Template Parameters
-
Left The left-hand tile type Right The right-hand tile type Scalar A scalar type
- Parameters
-
left The left-hand argument to be subtracted right The right-hand argument to be subtracted factor The scaling factor
- Returns
- A tile that is equal to
(left - right) * factor
Definition at line 300 of file tile_interface.h.
◆ subt() [6/6]
|
inline |
Subtract, scale, and permute tile arguments.
- Template Parameters
-
Left The left-hand tile type Right The right-hand tile type Scalar A scalar type
- Parameters
-
left The left-hand argument to be subtracted right The right-hand argument to be subtracted factor The scaling factor perm The permutation to be applied to the result
- Returns
- A tile that is equal to
perm ^ (left - right) * factor
Definition at line 332 of file tile_interface.h.
◆ subt_to() [1/3]
|
inline |
Subtract from the result tile.
- Template Parameters
-
Result The result tile type Arg The argument tile type
- Parameters
-
result The result tile arg The argument to be subtracted from the result
- Returns
- A tile that is equal to
result[i] -= arg[i]
Definition at line 375 of file tile_interface.h.
◆ subt_to() [2/3]
|
inline |
Subtract and scale from the result tile.
- Template Parameters
-
Result The result tile type Arg The argument tile type Scalar A scalar type
- Parameters
-
result The result tile arg The argument to be subtracted from result
factor The scaling factor
- Returns
- A tile that is equal to
(result -= arg) *= factor
Definition at line 391 of file tile_interface.h.
◆ subt_to() [3/3]
|
inline |
Subtract constant scalar from the result tile.
- Template Parameters
-
Result The result tile type Scalar A scalar type
- Parameters
-
result The result tile value The constant scalar to be subtracted from result
- Returns
- A tile that is equal to
(result -= arg) *= factor
Definition at line 405 of file tile_interface.h.
◆ sum()
|
inline |
Sum the hyper-diagonal elements a tile.
- Template Parameters
-
Arg The tile argument type
- Parameters
-
arg The argument to be summed
- Returns
- The sum of the hyper-diagonal elements of
arg
Sum the elements of a tile
- Template Parameters
-
Arg The tile argument type
- Parameters
-
arg The argument to be summed
- Returns
- A scalar that is equal to
sum_i arg[i]
Definition at line 865 of file tile_interface.h.
◆ unary() [1/2]
|
inline |
Unary element-wise transform producing a new tile.
- Template Parameters
-
Arg The tile argument type Op An element-wise operation type
- Parameters
-
[in] arg The tile to be transformed op An element-wise operation
- Returns
result
where for eachi
inarg.range()
result
[i]==op(arg[i])
Definition at line 715 of file tile_interface.h.
◆ unary() [2/2]
|
inline |
Unary element-wise transform producing a new tile.
- Template Parameters
-
Arg The tile argument type Op An element-wise operation type
- Parameters
-
[in] arg The tile to be transformed op An element-wise operation perm The permutation to be applied to the result of the transform
- Returns
perm^result
where for eachi
inarg.range()
result
[i]==op(arg[i])
Definition at line 731 of file tile_interface.h.