IgANet
IgANets - Isogeometric Analysis Networks
Loading...
Searching...
No Matches
iganet::utils Namespace Reference

Namespaces

namespace  detail
 

Classes

class  BlockTensor
 Forward declaration of BlockTensor. More...
 
class  BlockTensor< T, Rows >
 Compile-time rank-1 block tensor (row vector) More...
 
class  BlockTensor< T, Rows, Cols >
 Compile-time rank-2 block tensor (matrix) More...
 
class  BlockTensor< T, Rows, Cols, Slices >
 Compile-time rank-3 block tensor (tensor) More...
 
class  BlockTensorCore
 Compile-time block tensor core. More...
 
class  FullQualifiedName
 Full qualified name descriptor. More...
 
struct  integer_pow
 Computes the power of integer E to the N at compile time. More...
 
struct  integer_pow< E, 0 >
 
struct  is_shared_ptr
 Type trait checks if template argument is of type std::shared_ptr<T> More...
 
struct  is_shared_ptr< std::shared_ptr< T > >
 
struct  is_tuple
 Type trait for std::tuple type. More...
 
struct  is_tuple< std::tuple< Ts... > >
 
struct  is_tuple_of_tuples
 Type trait for std::tuple<std::tuple> type. More...
 
struct  is_tuple_of_tuples< std::tuple< Ts... > >
 
struct  make_reverse_index_sequence
 Reverse index sequence. More...
 
struct  Serializable
 Serialization prototype. More...
 
struct  tuple_cat
 Type trait for concatenating std::tuples. More...
 
struct  tuple_cat< std::tuple< Ts... >, Tuples... >
 
struct  tuple_cat< T, Tuples... >
 
struct  tuple_cat<>
 
class  uuid
 

Typedefs

template<class T >
using is_tuple_of_tuples_t = typename is_tuple_of_tuples< T >::type
 Alias for is_tuple_of_tuples::type.
 
template<std::size_t N>
using TensorArray = std::array< torch::Tensor, N >
 
using TensorArray0 = TensorArray< 0 >
 
using TensorArray1 = TensorArray< 1 >
 
using TensorArray2 = TensorArray< 2 >
 
using TensorArray3 = TensorArray< 3 >
 
using TensorArray4 = TensorArray< 4 >
 
template<typename... Tuples>
using tuple_cat_t = typename tuple_cat< Tuples... >::type
 Alias for tuple_cat::type.
 

Functions

template<typename T , std::size_t... Dims>
auto abs (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the absolute value of the elements of input
 
template<typename T , std::size_t... Dims>
auto absolute (const BlockTensor< T, Dims... > &input)
 Alias for abs()
 
template<typename T , std::size_t... Dims>
auto acos (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the inverse cosine of the elements of input
 
template<typename T , std::size_t... Dims>
auto acosh (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the inverse hyperbolic cosine of the elements of input
 
template<typename T , typename U , typename V , std::size_t... Dims>
auto add (const BlockTensor< T, Dims... > &input, const BlockTensor< U, Dims... > &other, V alpha=1.0)
 Returns a new block tensor with the elements of other, scaled by alpha, added to the elements of input
 
template<typename T , typename U , typename V , std::size_t... Dims>
auto add (const BlockTensor< T, Dims... > &input, U other, V alpha=1.0)
 Returns a new block tensor with the elements of other, scaled by alpha, added to the elements of input
 
template<typename T , typename U , typename V , std::size_t... Dims>
auto add (T input, const BlockTensor< U, Dims... > &other, V alpha=1.0)
 Returns a new block tensor with the elements of other, scaled by alpha, added to the elements of input
 
template<typename T , typename U , typename V , typename W , std::size_t... Dims>
auto addcdiv (const BlockTensor< T, Dims... > &input, const BlockTensor< U, Dims... > &tensor1, const BlockTensor< V, Dims... > &tensor2, W value=1.0)
 Returns a new block tensor with the elements of tensor1 divided by the elements of tensor2, with the result multiplied by the scalar value and added to the elements of input
 
template<typename T , typename U , typename V , typename W , std::size_t... Dims>
auto addcmul (const BlockTensor< T, Dims... > &input, const BlockTensor< U, Dims... > &tensor1, const BlockTensor< V, Dims... > &tensor2, W value=1.0)
 Returns a new block tensor with the elements of tensor1 multiplied by the elements of tensor2, with the result multiplied by the scalar value and added to the elements of input
 
template<typename T , std::size_t... Dims>
auto angle (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the angle (in radians) of the elements of input
 
template<typename T , std::size_t... Dims>
auto arccos (const BlockTensor< T, Dims... > &input)
 Alias for acos()
 
template<typename T , std::size_t... Dims>
auto arccosh (const BlockTensor< T, Dims... > &input)
 Alias for acosh()`.
 
template<typename T , std::size_t... Dims>
auto arcsin (const BlockTensor< T, Dims... > &input)
 Alias for asin()
 
template<typename T , std::size_t... Dims>
auto arcsinh (const BlockTensor< T, Dims... > &input)
 Alias for asinh()
 
template<typename T , std::size_t... Dims>
auto arctan (const BlockTensor< T, Dims... > &input)
 Alias for atan()
 
template<typename T , std::size_t... Dims>
auto arctanh (const BlockTensor< T, Dims... > &input)
 Alias for atanh()
 
template<typename T , std::size_t... Dims>
auto asin (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the arcsine of the elements of input
 
template<typename T , std::size_t... Dims>
auto asinh (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the inverse hyperbolic sine of the elements of input
 
template<typename T , std::size_t... Dims>
auto atan (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the arctangent of the elements of input
 
template<typename T , typename U , std::size_t... Dims>
auto atan2 (const BlockTensor< T, Dims... > &input, const BlockTensor< U, Dims... > &other)
 Returns a new block tensor with the arctangent of the elements in input and other with consideration of the quadrant.
 
template<typename T , std::size_t... Dims>
auto atanh (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the inverse hyperbolic tangent of the elements of input
 
template<typename T , typename U , std::size_t... Dims>
auto bitwise_and (const BlockTensor< T, Dims... > &input, const BlockTensor< U, Dims... > &other)
 Returns a new block tensor with the bitwise AND of the elements of input and other
 
template<typename T , typename U , std::size_t... Dims>
auto bitwise_left_shift (const BlockTensor< T, Dims... > &input, const BlockTensor< U, Dims... > &other)
 Returns a new block tensor with the left arithmetic shift of the elements of input by other bits.
 
template<typename T , std::size_t... Dims>
auto bitwise_not (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the bitwise NOT of the elements of input
 
template<typename T , typename U , std::size_t... Dims>
auto bitwise_or (const BlockTensor< T, Dims... > &input, const BlockTensor< U, Dims... > &other)
 Returns a new block tensor with the bitwise OR of the elements of input and other
 
template<typename T , typename U , std::size_t... Dims>
auto bitwise_right_shift (const BlockTensor< T, Dims... > &input, const BlockTensor< U, Dims... > &other)
 Returns a new block tensor with the right arithmetic shift of the element of input by other bits.
 
template<typename T , typename U , std::size_t... Dims>
auto bitwise_xor (const BlockTensor< T, Dims... > &input, const BlockTensor< U, Dims... > &other)
 Returns a new block tensor with the bitwise XOR of the elements of input and other
 
template<typename T , std::size_t... Dims>
auto ceil (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the ceil of the elements of input, the smallest integer greater than or equal to each element.
 
template<typename T , typename U , std::size_t... Dims>
auto clamp (const BlockTensor< T, Dims... > &input, U min, U max)
 Returns a new block tensor with the elements of input clamped into the range [ min, max ].
 
template<typename T , typename U , std::size_t... Dims>
auto clip (const BlockTensor< T, Dims... > &input, U min, U max)
 Alias for clamp()
 
template<typename T , std::size_t... Dims>
auto conj_physical (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the conjugate of the elements of input tensor.
 
template<typename T , typename U , std::size_t... Dims>
auto copysign (const BlockTensor< T, Dims... > &input, const BlockTensor< U, Dims... > &other)
 Returns a new block tensor with the magnitude of the elements of input and the sign of the elements of other
 
template<typename T , std::size_t... Dims>
auto cos (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the cosine of the elements of input
 
template<typename T , std::size_t... Dims>
auto cosh (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the hyperbolic cosine of the elements of input
 
template<typename T , std::size_t... Dims>
auto deg2rad (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the elements of input converted from angles in degrees to radians.
 
template<typename T , std::size_t... Dims>
auto digamma (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the logarithmic derivative of the gamma function of the elements of input
 
template<typename T , typename U , std::size_t... Dims>
auto div (const BlockTensor< T, Dims... > &input, const BlockTensor< U, Dims... > &other)
 Returns a new block tensor with the elements of input divided by the elements of other
 
template<typename T , typename U , std::size_t... Dims>
auto divide (const BlockTensor< T, Dims... > &input, const BlockTensor< U, Dims... > &other)
 Alias for div()
 
template<short_t dim = 0, typename T0 , typename T1 >
auto dotproduct (T0 &&t0, T1 &&t1)
 Computes the directional dot-product between two tensors with summation along the given dimension.
 
template<typename T , std::size_t... Dims>
auto erf (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the error function of the elements of input
 
template<typename T , std::size_t... Dims>
auto erfc (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the complementary error function of the elements of input
 
template<typename T , std::size_t... Dims>
auto erfinv (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the inverse error function of the elements of input
 
template<typename T , std::size_t... Dims>
auto exp (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the exponential of the elements of input
 
template<typename T , std::size_t... Dims>
auto exp2 (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the base-2 exponential of the elements of input
 
template<typename T , std::size_t... Dims>
auto expit (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the expit (also known as the logistic sigmoid function) of the elements of input
 
template<typename T , std::size_t... Dims>
auto expm1 (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the exponential minus 1 of the elements of input
 
template<typename T , std::size_t... Dims>
auto fix (const BlockTensor< T, Dims... > &input)
 Alias for trunc()
 
template<typename T , typename U , std::size_t... Dims>
auto float_power (const BlockTensor< T, Dims... > &input, const BlockTensor< U, Dims... > &other)
 Returns a new block tensor with the elements of input raised to the power of exponent, elementwise, in double precision.
 
template<typename T , std::size_t... Dims>
auto floor (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the floor of the elements of input, the largest integer less than or equal to each element.
 
template<typename T , typename U , std::size_t... Dims>
auto fmod (const BlockTensor< T, Dims... > &input, const BlockTensor< U, Dims... > &other)
 Returns a new block tensor with the fmod of the elements of input and other
 
template<typename T , std::size_t... Dims>
auto frac (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the fractional portion of the elements of input
 
template<typename T , std::size_t... Dims>
auto frexp (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the decomposition of the elements of input into mantissae and exponents.
 
template<typename T , std::size_t N>
torch::Tensor & from_xml (const pugi::xml_document &doc, torch::Tensor &tensor, std::string tag="Matrix", int id=0, std::string label="", bool alloc=true, int index=-1)
 Converts an XML document object to a torch::Tensor object.
 
template<typename T , std::size_t N>
torch::TensorAccessor< T, N > & from_xml (const pugi::xml_document &doc, torch::TensorAccessor< T, N > &accessor, torch::IntArrayRef sizes, std::string tag="Matrix", int id=0, std::string label="", int index=-1)
 Converts an XML documentobject to a torch::TensorAccessor object.
 
template<typename T , std::size_t N, std::size_t M>
utils::TensorArray< M > & from_xml (const pugi::xml_document &doc, utils::TensorArray< M > &tensors, std::string tag="Matrix", int id=0, bool alloc=true, std::string label="")
 Converts an XML document object to an std::array of torch::Tensor objects.
 
template<typename T , std::size_t N>
torch::Tensor & from_xml (const pugi::xml_node &root, torch::Tensor &tensor, std::string tag="Matrix", int id=0, std::string label="", bool alloc=true, int index=-1)
 Converts an XML object to a torch::Tensor object.
 
template<typename T , std::size_t N>
torch::TensorAccessor< T, N > & from_xml (const pugi::xml_node &root, torch::TensorAccessor< T, N > &accessor, torch::IntArrayRef sizes, std::string tag="Matrix", int id=0, std::string label="", int index=-1)
 Converts an XML object to a torch::TensorAccessor object.
 
template<typename T , std::size_t N, std::size_t M>
utils::TensorArray< M > & from_xml (const pugi::xml_node &root, utils::TensorArray< M > &tensors, std::string tag="Matrix", int id=0, bool alloc=true, std::string label="")
 Converts an XML object to an std::array of torch::Tensor objects.
 
template<typename T , typename U , std::size_t... Dims>
auto gammainc (const BlockTensor< T, Dims... > &input, const BlockTensor< U, Dims... > &other)
 Returns a new block tensor with the regularized lower incomplete gamma function of each element of input
 
template<typename T , typename U , std::size_t... Dims>
auto gammaincc (const BlockTensor< T, Dims... > &input, const BlockTensor< U, Dims... > &other)
 Returns a new block tensor with the regularized upper incomplete gamma function of each element of input
 
template<typename T >
getenv (std::string variable, const T &default_value)
 Returns the value from an environment variable.
 
template<typename T >
std::vector< T > getenv (std::string variable, std::initializer_list< T > default_value)
 Returns the value from an environment variable.
 
template<typename T , typename U , std::size_t... Dims>
auto hypot (const BlockTensor< T, Dims... > &input, const BlockTensor< U, Dims... > &other)
 logit
 
template<typename T , std::size_t... Dims>
auto i0 (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the element-wise zeroth order modified Bessel function of the first kind for each element of input
 
template<typename T , typename U , std::size_t... Dims>
auto igamma (const BlockTensor< T, Dims... > &input, const BlockTensor< U, Dims... > &other)
 Alias for gammainc()
 
template<typename T , typename U , std::size_t... Dims>
auto igammac (const BlockTensor< T, Dims... > &input, const BlockTensor< U, Dims... > &other)
 Alias for gammainc()
 
template<typename T , std::size_t... Dims>
auto imag (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the imaginary values of the elements of input
 
template<short_t dim = 0, typename T , typename... Ts>
auto kronproduct (T &&t, Ts &&...ts)
 Computes the directional Kronecker-product between two or more tensors along the given dimension.
 
template<short_t dim = 0, typename T0 , typename T1 >
auto kronproduct (T0 &&t0, T1 &&t1)
 Computes the directional Kronecker-product between two tensors along the given dimension.
 
template<typename T , typename U , std::size_t... Dims>
auto ldexp (const BlockTensor< T, Dims... > &input, const BlockTensor< U, Dims... > &other)
 Returns a new block tensor with the elements of input multiplied by 2**other.
 
template<typename T , std::size_t... Dims>
auto lgamma (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the natural logarithm of the absolute value of the gamma function of the elements of input
 
template<typename T , std::size_t... Dims>
auto log (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the natural logarithm of the elements of input
 
template<typename T , std::size_t... Dims>
auto log10 (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the logarithm to the base-10 of the elements of input
 
template<typename T , std::size_t... Dims>
auto log1p (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the natural logarithm of (1 + the elements of input)
 
template<typename T , std::size_t... Dims>
auto log2 (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the logarithm to the base-2 of the elements of input
 
template<typename T , typename U , std::size_t... Dims>
auto logaddexp (const BlockTensor< T, Dims... > &input, const BlockTensor< U, Dims... > &other)
 Returns a new block-vector with the logarithm of the sum of exponentiations of the elements of input
 
template<typename T , typename U , std::size_t... Dims>
auto logaddexp2 (const BlockTensor< T, Dims... > &input, const BlockTensor< U, Dims... > &other)
 Returns a new block-vector with the logarithm of the sum of exponentiations of the elements of input in base-2.
 
template<typename T , typename U , std::size_t... Dims>
auto logical_and (const BlockTensor< T, Dims... > &input, const BlockTensor< U, Dims... > &other)
 Returns a new block tensor with the element-wise logical AND of the elements of input and other
 
template<typename T , std::size_t... Dims>
auto logical_not (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the element-wise logical NOT of the elements of input
 
template<typename T , typename U , std::size_t... Dims>
auto logical_or (const BlockTensor< T, Dims... > &input, const BlockTensor< U, Dims... > &other)
 Returns a new block tensor with the element-wise logical OR of the elements of input and other
 
template<typename T , typename U , std::size_t... Dims>
auto logical_xor (const BlockTensor< T, Dims... > &input, const BlockTensor< U, Dims... > &other)
 Returns a new block tensor with the element-wise logical XOR of the elements of input and other
 
template<typename T , typename U , std::size_t N>
constexpr std::array< T, Nmake_array (std::array< U, N > array)
 Creates an std::array object from another std::array object.
 
template<typename T , std::size_t N>
constexpr auto make_array (T value)
 Creates an std::array object filled with a constant.
 
template<typename T >
auto make_shared (T &&arg)
 Returns an std::shared_ptr<T> object from arg.
 
template<typename T , typename U , std::size_t... Dims>
auto mul (const BlockTensor< T, Dims... > &input, const BlockTensor< U, Dims... > &other)
 Returns a new block tensor with the product of each element of input and other
 
template<typename T , typename U , std::size_t... Dims>
auto multiply (const BlockTensor< T, Dims... > &input, const BlockTensor< U, Dims... > &other)
 Alias for mul()
 
template<typename T , std::size_t... Dims>
auto neg (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the negative of the elements of input
 
template<typename T , std::size_t... Dims>
auto negative (const BlockTensor< T, Dims... > &input)
 Alias for neg()
 
template<typename T , typename U , std::size_t... Dims>
auto nextafter (const BlockTensor< T, Dims... > &input, const BlockTensor< U, Dims... > &other)
 Return a new block tensor with the next elementwise floating-point value after input towards other
 
template<typename T , typename U , std::size_t... TDims, std::size_t... UDims>
bool operator!= (const BlockTensor< T, TDims... > &lhs, const BlockTensor< U, UDims... > &rhs)
 Returns true if both compile-time block tensors are not equal.
 
template<typename T , typename U , std::size_t... Dims>
auto operator* (const BlockTensor< T, Dims... > &lhs, const U &rhs)
 Multiplies a compile-time block tensor with a scalar and returns a new compile-time block tensor.
 
template<typename T , typename U , std::size_t Rows, std::size_t Common, std::size_t Cols>
auto operator* (const BlockTensor< T, Rows, Common > &lhs, const BlockTensor< U, Common, Cols > &rhs)
 Multiplies one compile-time rank-2 block tensor with another compile-time rank-2 block tensor.
 
template<typename T , typename U , std::size_t Rows, std::size_t Common, std::size_t Cols, std::size_t Slices>
auto operator* (const BlockTensor< T, Rows, Common > &lhs, const BlockTensor< U, Common, Cols, Slices > &rhs)
 Multiplies one compile-time rank-2 block tensor from the left with a compile-time rank-3 block tensor slice-by-slice.
 
template<typename T , typename U , std::size_t Rows, std::size_t Common, std::size_t Cols, std::size_t Slices>
auto operator* (const BlockTensor< T, Rows, Common, Slices > &lhs, const BlockTensor< U, Common, Cols > &rhs)
 Multiplies one compile-time rank-3 block tensor from the left with a compile-time rank-2 block tensor slice-by-slice.
 
template<typename T , typename U , std::size_t... Dims>
auto operator* (const T &lhs, const BlockTensor< U, Dims... > &rhs)
 Multiplies a scalar with a compile-time block tensor and returns a new compile-time block tensor.
 
template<typename T , std::size_t N>
constexpr std::array< T, Noperator* (std::array< T, N > lhs, std::array< T, N > rhs)
 Multiplies two std::arrays.
 
template<typename T , typename U , std::size_t... Dims>
auto operator+ (const BlockTensor< T, Dims... > &lhs, const BlockTensor< U, Dims... > &rhs)
 Adds one compile-time block tensor to another and returns a new compile-time block tensor.
 
template<typename T , typename U , std::size_t... Dims>
auto operator+ (const BlockTensor< T, Dims... > &lhs, const U &rhs)
 Adds a compile-time block tensor to a scalar and returns a new compile-time block tensor.
 
template<typename T , typename U , std::size_t... Dims>
auto operator+ (const T &lhs, const BlockTensor< U, Dims... > &rhs)
 Adds a scalar to a compile-time block tensor and returns a new compile-time block tensor.
 
template<typename T , std::size_t N>
constexpr auto operator+ (std::array< T, N > array, T data)
 Appends data to a std::array object.
 
template<typename T , std::size_t N>
constexpr std::array< T, Noperator+ (std::array< T, N > lhs, std::array< T, N > rhs)
 Adds two std::arrays.
 
template<typename T >
constexpr auto operator+ (std::vector< T > vector, T data)
 Appends data to a std::vector object.
 
template<typename T , std::size_t N>
constexpr auto operator+ (T data, std::array< T, N > array)
 Prepends data to a std::array object.
 
template<typename T >
constexpr auto operator+ (T data, std::vector< T > vector)
 Prepends data to a std::vector object.
 
template<typename T >
constexpr auto operator+ (T data, torch::ArrayRef< T > array)
 Prepends data to a torch::ArrayRef object.
 
template<typename T >
constexpr auto operator+ (torch::ArrayRef< T > array, T data)
 Appends data to a torch::ArrayRef object.
 
template<typename T , typename U , std::size_t... Dims>
auto operator+= (BlockTensor< T, Dims... > &lhs, const BlockTensor< U, Dims... > &rhs)
 Increments one compile-time block tensor by another.
 
template<typename T , typename U , std::size_t... Dims>
auto operator+= (BlockTensor< T, Dims... > &lhs, const U &rhs)
 Increments a compile-time block tensor by a scalar.
 
template<typename T , typename U , std::size_t... Dims>
auto operator- (const BlockTensor< T, Dims... > &lhs, const BlockTensor< U, Dims... > &rhs)
 Subtracts one compile-time block tensor from another and returns a new compile-time block tensor.
 
template<typename T , typename U , std::size_t... Dims>
auto operator- (const BlockTensor< T, Dims... > &lhs, const U &rhs)
 Subtracts a scalar from a compile-time block tensor and returns a new compile-time block tensor.
 
template<typename T , typename U , std::size_t... Dims>
auto operator- (const T &lhs, const BlockTensor< U, Dims... > &rhs)
 Subtracts a compile-time block tensor from a scalar and returns a new compile-time block tensor.
 
template<typename T , std::size_t N>
constexpr std::array< T, Noperator- (std::array< T, N > array)
 Negates all entries of an std::array.
 
template<typename T , std::size_t N>
constexpr std::array< T, Noperator- (std::array< T, N > lhs, std::array< T, N > rhs)
 Subtracts one std::array from another std::array.
 
template<typename T , typename U , std::size_t... Dims>
auto operator-= (BlockTensor< T, Dims... > &lhs, const BlockTensor< U, Dims... > &rhs)
 Decrements one compile-time block tensor by another.
 
template<typename T , typename U , std::size_t... Dims>
auto operator-= (BlockTensor< T, Dims... > &lhs, const U &rhs)
 Decrements a compile-time block tensor by a scalar.
 
template<typename T , std::size_t N>
constexpr std::array< T, Noperator/ (std::array< T, N > lhs, std::array< T, N > rhs)
 Divides one std::array by another std::array.
 
template<typename T , std::size_t... Dims>
std::ostream & operator<< (std::ostream &os, const BlockTensorCore< T, Dims... > &obj)
 Prints (as string) a compile-time block tensor object.
 
template<typename T , typename U , std::size_t... TDims, std::size_t... UDims>
bool operator== (const BlockTensor< T, TDims... > &lhs, const BlockTensor< U, UDims... > &rhs)
 Returns true if both compile-time block tensors are equal.
 
template<typename T , std::size_t... Dims>
auto positive (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the input
 
template<typename T , typename U , std::size_t... Dims>
auto pow (const BlockTensor< T, Dims... > &input, const BlockTensor< U, Dims... > &other)
 Returns a new block tensor with the power of each element in input with exponent other
 
template<typename T , std::size_t N>
prod (std::array< T, N > array, std::size_t start_index=0, std::size_t stop_index=N - 1)
 Computes the (partial) product of all std::array entries.
 
template<typename T , std::size_t... Dims>
auto rad2deg (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with each of the elements of input converted from angles in radians to degrees.
 
template<typename T , std::size_t... Dims>
auto real (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the real values of the elements of input
 
template<typename T , std::size_t... Dims>
auto reciprocal (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the reciprocal of the elements of input
 
template<typename T , typename U , std::size_t... Dims>
auto remainder (const BlockTensor< T, Dims... > &input, const BlockTensor< U, Dims... > &other)
 Returns a new block tensor with the modulus of the elements of input
 
template<typename T , std::size_t N, std::size_t M = 1>
constexpr std::array< T, N - Mremove_from_back (std::array< T, N > array)
 Derives an std::array object from a given std::array object dropping the last M entries.
 
template<typename T , std::size_t N, std::size_t M = 1>
constexpr std::array< T, N - Mremove_from_front (std::array< T, N > array)
 Derives an std::array object from a given std::array object dropping the first M entries.
 
template<typename T , std::size_t... Dims>
auto round (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the elements of input rounded to the nearest integer.
 
template<typename T , std::size_t... Dims>
auto rsqrt (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the reciprocal of the square-root of the elements of input
 
template<typename T , std::size_t... Dims>
auto sgn (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the signs of the elements of input, extension to complex value.
 
template<typename T , std::size_t... Dims>
auto sigmoid (const BlockTensor< T, Dims... > &input)
 Alias for expit()
 
template<typename T , std::size_t... Dims>
auto sign (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the signs of the elements of input
 
template<typename T , std::size_t... Dims>
auto signbit (const BlockTensor< T, Dims... > &input)
 Tests if each element of input has its sign bit set (is less than zero) or not.
 
template<typename T , std::size_t... Dims>
auto sin (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the sine of the elements of input
 
template<typename T , std::size_t... Dims>
auto sinc (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the normalized sinc of the elements of input
 
template<typename T , std::size_t... Dims>
auto sinh (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the hyperbolic sine of the elements of input
 
template<typename T , std::size_t... Dims>
auto sqrt (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the square-root of the elements of input
 
template<typename T , std::size_t... Dims>
auto square (const BlockTensor< T, Dims... > &input)
 Returns a new block tensor with the square of the elements of input
 
template<typename T , typename U , typename V , std::size_t... Dims>
auto sub (const BlockTensor< T, Dims... > &input, const BlockTensor< U, Dims... > &other, V alpha=1.0)
 Subtracts other, scaled by alpha, from input.
 
template<typename T , typename U , typename V , std::size_t... Dims>
auto subtract (const BlockTensor< T, Dims... > &input, const BlockTensor< U, Dims... > &other, V alpha=1.0)
 Alias for sub()
 
template<typename T , std::size_t N>
sum (std::array< T, N > array, std::size_t start_index=0, std::size_t stop_index=N - 1)
 Computes the (partial) sum of all std::array entries.
 
template<typename T , std::size_t... Dims>
auto tan (const BlockTensor< T, Dims... > &input)
 Returns a new tensor with the tangent of the elements of input.
 
template<typename T , std::size_t... Dims>
auto tanh (const BlockTensor< T, Dims... > &input)
 Returns a new tensor with the hyperbolic tangent of the elements of input.
 
template<typename... Args>
auto to_array (Args &&...args)
 Converts a list of arguments into std::array.
 
template<std::size_t N, typename T >
std::array< T, Nto_array (std::vector< T > &&vector)
 Converts an std::vector object into std::array.
 
template<typename T , std::size_t N>
auto to_ArrayRef (const std::array< T, N > &array)
 Converts an std::array<int64_t, N> to a at::IntArrayRef object.
 
template<typename T , std::size_t N>
auto to_json (const torch::Tensor &tensor)
 Converts a torch::Tensor object to a JSON object.
 
template<typename T , std::size_t N>
auto to_json (const torch::TensorAccessor< T, N > &accessor)
 Converts a torch::TensorAccessor object to a JSON object.
 
template<typename T , std::size_t N, std::size_t M>
auto to_json (const utils::TensorArray< M > &tensors)
 Converts an std::array of torch::Tensor objects to a JSON object.
 
template<typename... Args>
auto to_vector (Args &&...args)
 Converts a list of arguments into std::vector.
 
template<typename T , std::size_t N>
std::vector< T > to_vector (std::array< T, N > &&array)
 Converts an std::array object into std::vector.
 
template<typename T , std::size_t N>
pugi::xml_node & to_xml (const torch::Tensor &tensor, pugi::xml_node &root, std::string tag="Matrix", int id=0, std::string label="", int index=-1)
 Converts a torch::Tensor object to an XML object.
 
template<typename T , std::size_t N>
pugi::xml_document to_xml (const torch::Tensor &tensor, std::string tag="Matrix", int id=0, std::string label="", int index=-1)
 Converts a torch::Tensor object to an XML document object.
 
template<typename T , std::size_t N>
pugi::xml_node & to_xml (const torch::TensorAccessor< T, N > &accessor, torch::IntArrayRef sizes, pugi::xml_node &root, std::string tag="Matrix", int id=0, std::string label="", int index=-1)
 Converts a torch::TensorAccessor object to an XML object.
 
template<typename T , std::size_t N>
pugi::xml_document to_xml (const torch::TensorAccessor< T, N > &accessor, torch::IntArrayRef sizes, std::string tag="Matrix", int id=0, std::string label="", int index=-1)
 Converts a torch::TensorAccessor object to an XML document object.
 
template<typename T , std::size_t N, std::size_t M>
pugi::xml_node & to_xml (const utils::TensorArray< M > &tensors, pugi::xml_node &root, std::string tag="Matrix", int id=0, std::string label="")
 Converts an std::array of torch::Tensor objects to an XML object.
 
template<typename T , std::size_t N, std::size_t M>
pugi::xml_document to_xml (const utils::TensorArray< M > &tensors, std::string tag="Matrix", int id=0, std::string label="", int index=-1)
 Converts an std::array of torch::Tensor objects to an XML object.
 
template<typename T , std::size_t... Dims>
auto trunc (const BlockTensor< T, Dims... > &input)
 Returns a new tensor with the truncated integer values of the elements of input.
 
template<bool transpose = false, std::size_t N>
auto VSlice (const utils::TensorArray< N > &index, const std::array< int64_t, N > &start_offset, const std::array< int64_t, N > &stop_offset, const std::array< int64_t, N - 1 > &leading_dim=make_array< int64_t, N - 1 >(1))
 Vectorized version of torch::indexing::Slice (see https://pytorch.org/cppdocs/notes/tensor_indexing.html)
 
template<bool transpose = false>
auto VSlice (torch::Tensor index, int64_t start_offset, int64_t stop_offset)
 Vectorized version of torch::indexing::Slice (see https://pytorch.org/cppdocs/notes/tensor_indexing.html)
 
template<typename T , typename U , std::size_t... Dims>
auto xlogy (const BlockTensor< T, Dims... > &input, const BlockTensor< U, Dims... > &other)
 Computes input * log(other)
 
template<typename... T>
auto zip (T &&...seqs)
 

Variables

template<class T >
constexpr auto is_tuple_of_tuples_v = is_tuple_of_tuples<T>::value
 Alias for is_tuple_of_tuples::value.
 
template<class T >
constexpr bool is_tuple_v = is_tuple<T>::value
 
template<typename... Tuples>
constexpr auto tuple_cat_v = tuple_cat<Tuples...>::value
 Alias for tuple_cat::value.
 

Class Documentation

◆ iganet::utils::BlockTensor

class iganet::utils::BlockTensor
template<typename T, std::size_t... Dims>
class iganet::utils::BlockTensor< T, Dims >

Forward declaration of BlockTensor.

◆ iganet::utils::tuple_cat

struct iganet::utils::tuple_cat
template<typename... Tuples>
struct iganet::utils::tuple_cat< Tuples >

Type trait for concatenating std::tuples.

◆ iganet::utils::tuple_cat< std::tuple< Ts... >, Tuples... >

struct iganet::utils::tuple_cat< std::tuple< Ts... >, Tuples... >
template<typename... Ts, typename... Tuples>
struct iganet::utils::tuple_cat< std::tuple< Ts... >, Tuples... >
Class Members
typedef decltype(tuple_cat(declval< tuple< Ts... > >(), type >())) type

◆ iganet::utils::tuple_cat< T, Tuples... >

struct iganet::utils::tuple_cat< T, Tuples... >
template<typename T, typename... Tuples>
struct iganet::utils::tuple_cat< T, Tuples... >
Class Members
typedef decltype(tuple_cat(declval< tuple< T > >(), type >())) type

◆ iganet::utils::tuple_cat<>

struct iganet::utils::tuple_cat<>
Class Members
typedef tuple<> type

Typedef Documentation

◆ is_tuple_of_tuples_t

Alias for is_tuple_of_tuples::type.

◆ TensorArray

template<std::size_t N>
using iganet::utils::TensorArray = typedef std::array<torch::Tensor, N>

◆ TensorArray0

◆ TensorArray1

◆ TensorArray2

◆ TensorArray3

◆ TensorArray4

◆ tuple_cat_t

template<typename... Tuples>
using iganet::utils::tuple_cat_t = typedef typename tuple_cat<Tuples...>::type

Alias for tuple_cat::type.

Function Documentation

◆ abs()

template<typename T , std::size_t... Dims>
auto iganet::utils::abs ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the absolute value of the elements of input

◆ absolute()

template<typename T , std::size_t... Dims>
auto iganet::utils::absolute ( const BlockTensor< T, Dims... > &  input)
inline

Alias for abs()

◆ acos()

template<typename T , std::size_t... Dims>
auto iganet::utils::acos ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the inverse cosine of the elements of input

◆ acosh()

template<typename T , std::size_t... Dims>
auto iganet::utils::acosh ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the inverse hyperbolic cosine of the elements of input

◆ add() [1/3]

template<typename T , typename U , typename V , std::size_t... Dims>
auto iganet::utils::add ( const BlockTensor< T, Dims... > &  input,
const BlockTensor< U, Dims... > &  other,
V  alpha = 1.0 
)
inline

Returns a new block tensor with the elements of other, scaled by alpha, added to the elements of input

◆ add() [2/3]

template<typename T , typename U , typename V , std::size_t... Dims>
auto iganet::utils::add ( const BlockTensor< T, Dims... > &  input,
U  other,
V  alpha = 1.0 
)
inline

Returns a new block tensor with the elements of other, scaled by alpha, added to the elements of input

◆ add() [3/3]

template<typename T , typename U , typename V , std::size_t... Dims>
auto iganet::utils::add ( input,
const BlockTensor< U, Dims... > &  other,
V  alpha = 1.0 
)
inline

Returns a new block tensor with the elements of other, scaled by alpha, added to the elements of input

◆ addcdiv()

template<typename T , typename U , typename V , typename W , std::size_t... Dims>
auto iganet::utils::addcdiv ( const BlockTensor< T, Dims... > &  input,
const BlockTensor< U, Dims... > &  tensor1,
const BlockTensor< V, Dims... > &  tensor2,
W  value = 1.0 
)
inline

Returns a new block tensor with the elements of tensor1 divided by the elements of tensor2, with the result multiplied by the scalar value and added to the elements of input

◆ addcmul()

template<typename T , typename U , typename V , typename W , std::size_t... Dims>
auto iganet::utils::addcmul ( const BlockTensor< T, Dims... > &  input,
const BlockTensor< U, Dims... > &  tensor1,
const BlockTensor< V, Dims... > &  tensor2,
W  value = 1.0 
)
inline

Returns a new block tensor with the elements of tensor1 multiplied by the elements of tensor2, with the result multiplied by the scalar value and added to the elements of input

◆ angle()

template<typename T , std::size_t... Dims>
auto iganet::utils::angle ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the angle (in radians) of the elements of input

◆ arccos()

template<typename T , std::size_t... Dims>
auto iganet::utils::arccos ( const BlockTensor< T, Dims... > &  input)
inline

Alias for acos()

◆ arccosh()

template<typename T , std::size_t... Dims>
auto iganet::utils::arccosh ( const BlockTensor< T, Dims... > &  input)
inline

Alias for acosh()`.

◆ arcsin()

template<typename T , std::size_t... Dims>
auto iganet::utils::arcsin ( const BlockTensor< T, Dims... > &  input)
inline

Alias for asin()

◆ arcsinh()

template<typename T , std::size_t... Dims>
auto iganet::utils::arcsinh ( const BlockTensor< T, Dims... > &  input)
inline

Alias for asinh()

◆ arctan()

template<typename T , std::size_t... Dims>
auto iganet::utils::arctan ( const BlockTensor< T, Dims... > &  input)
inline

Alias for atan()

◆ arctanh()

template<typename T , std::size_t... Dims>
auto iganet::utils::arctanh ( const BlockTensor< T, Dims... > &  input)
inline

Alias for atanh()

◆ asin()

template<typename T , std::size_t... Dims>
auto iganet::utils::asin ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the arcsine of the elements of input

◆ asinh()

template<typename T , std::size_t... Dims>
auto iganet::utils::asinh ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the inverse hyperbolic sine of the elements of input

◆ atan()

template<typename T , std::size_t... Dims>
auto iganet::utils::atan ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the arctangent of the elements of input

◆ atan2()

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::atan2 ( const BlockTensor< T, Dims... > &  input,
const BlockTensor< U, Dims... > &  other 
)
inline

Returns a new block tensor with the arctangent of the elements in input and other with consideration of the quadrant.

◆ atanh()

template<typename T , std::size_t... Dims>
auto iganet::utils::atanh ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the inverse hyperbolic tangent of the elements of input

◆ bitwise_and()

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::bitwise_and ( const BlockTensor< T, Dims... > &  input,
const BlockTensor< U, Dims... > &  other 
)
inline

Returns a new block tensor with the bitwise AND of the elements of input and other

◆ bitwise_left_shift()

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::bitwise_left_shift ( const BlockTensor< T, Dims... > &  input,
const BlockTensor< U, Dims... > &  other 
)
inline

Returns a new block tensor with the left arithmetic shift of the elements of input by other bits.

◆ bitwise_not()

template<typename T , std::size_t... Dims>
auto iganet::utils::bitwise_not ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the bitwise NOT of the elements of input

◆ bitwise_or()

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::bitwise_or ( const BlockTensor< T, Dims... > &  input,
const BlockTensor< U, Dims... > &  other 
)
inline

Returns a new block tensor with the bitwise OR of the elements of input and other

◆ bitwise_right_shift()

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::bitwise_right_shift ( const BlockTensor< T, Dims... > &  input,
const BlockTensor< U, Dims... > &  other 
)
inline

Returns a new block tensor with the right arithmetic shift of the element of input by other bits.

◆ bitwise_xor()

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::bitwise_xor ( const BlockTensor< T, Dims... > &  input,
const BlockTensor< U, Dims... > &  other 
)
inline

Returns a new block tensor with the bitwise XOR of the elements of input and other

◆ ceil()

template<typename T , std::size_t... Dims>
auto iganet::utils::ceil ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the ceil of the elements of input, the smallest integer greater than or equal to each element.

◆ clamp()

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::clamp ( const BlockTensor< T, Dims... > &  input,
U  min,
U  max 
)
inline

Returns a new block tensor with the elements of input clamped into the range [ min, max ].

◆ clip()

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::clip ( const BlockTensor< T, Dims... > &  input,
U  min,
U  max 
)
inline

Alias for clamp()

◆ concat() [1/4]

template<typename T , std::size_t... N>
auto iganet::utils::concat ( const std::array< T, N > &...  arrays)
inline

Concatenates multiple std::array objects.

◆ concat() [2/4]

template<typename... Ts>
auto iganet::utils::concat ( const std::vector< Ts > &...  vectors)
inline

Concatenates multiple std::vector objects.

◆ concat() [3/4]

template<typename T , std::size_t... N>
auto iganet::utils::concat ( std::array< T, N > &&...  arrays)
inline

Concatenates multiple std::array objects.

◆ concat() [4/4]

template<typename... Ts>
auto iganet::utils::concat ( std::vector< Ts > &&...  vectors)
inline

Concatenates multiple std::vector objects.

◆ conj_physical()

template<typename T , std::size_t... Dims>
auto iganet::utils::conj_physical ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the conjugate of the elements of input tensor.

◆ copysign()

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::copysign ( const BlockTensor< T, Dims... > &  input,
const BlockTensor< U, Dims... > &  other 
)
inline

Returns a new block tensor with the magnitude of the elements of input and the sign of the elements of other

◆ cos()

template<typename T , std::size_t... Dims>
auto iganet::utils::cos ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the cosine of the elements of input

◆ cosh()

template<typename T , std::size_t... Dims>
auto iganet::utils::cosh ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the hyperbolic cosine of the elements of input

◆ deg2rad()

template<typename T , std::size_t... Dims>
auto iganet::utils::deg2rad ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the elements of input converted from angles in degrees to radians.

◆ digamma()

template<typename T , std::size_t... Dims>
auto iganet::utils::digamma ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the logarithmic derivative of the gamma function of the elements of input

◆ div()

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::div ( const BlockTensor< T, Dims... > &  input,
const BlockTensor< U, Dims... > &  other 
)
inline

Returns a new block tensor with the elements of input divided by the elements of other

◆ divide()

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::divide ( const BlockTensor< T, Dims... > &  input,
const BlockTensor< U, Dims... > &  other 
)
inline

Alias for div()

◆ dotproduct()

template<short_t dim = 0, typename T0 , typename T1 >
auto iganet::utils::dotproduct ( T0 &&  t0,
T1 &&  t1 
)
inline

Computes the directional dot-product between two tensors with summation along the given dimension.

Template Parameters
dimDimension along which the sum is computed
T0Type of the first argument
T1Type of the second argument
Parameters
[in]t0First argument
[in]t1Second argument
Returns
Tensor containing the directional dot-product

◆ erf()

template<typename T , std::size_t... Dims>
auto iganet::utils::erf ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the error function of the elements of input

◆ erfc()

template<typename T , std::size_t... Dims>
auto iganet::utils::erfc ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the complementary error function of the elements of input

◆ erfinv()

template<typename T , std::size_t... Dims>
auto iganet::utils::erfinv ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the inverse error function of the elements of input

◆ exp()

template<typename T , std::size_t... Dims>
auto iganet::utils::exp ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the exponential of the elements of input

◆ exp2()

template<typename T , std::size_t... Dims>
auto iganet::utils::exp2 ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the base-2 exponential of the elements of input

◆ expit()

template<typename T , std::size_t... Dims>
auto iganet::utils::expit ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the expit (also known as the logistic sigmoid function) of the elements of input

◆ expm1()

template<typename T , std::size_t... Dims>
auto iganet::utils::expm1 ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the exponential minus 1 of the elements of input

◆ fix()

template<typename T , std::size_t... Dims>
auto iganet::utils::fix ( const BlockTensor< T, Dims... > &  input)
inline

Alias for trunc()

◆ float_power()

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::float_power ( const BlockTensor< T, Dims... > &  input,
const BlockTensor< U, Dims... > &  other 
)
inline

Returns a new block tensor with the elements of input raised to the power of exponent, elementwise, in double precision.

◆ floor()

template<typename T , std::size_t... Dims>
auto iganet::utils::floor ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the floor of the elements of input, the largest integer less than or equal to each element.

◆ fmod()

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::fmod ( const BlockTensor< T, Dims... > &  input,
const BlockTensor< U, Dims... > &  other 
)
inline

Returns a new block tensor with the fmod of the elements of input and other

◆ frac()

template<typename T , std::size_t... Dims>
auto iganet::utils::frac ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the fractional portion of the elements of input

◆ frexp()

template<typename T , std::size_t... Dims>
auto iganet::utils::frexp ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the decomposition of the elements of input into mantissae and exponents.

◆ from_xml() [1/6]

template<typename T , std::size_t N>
torch::Tensor & iganet::utils::from_xml ( const pugi::xml_document &  doc,
torch::Tensor &  tensor,
std::string  tag = "Matrix",
int  id = 0,
std::string  label = "",
bool  alloc = true,
int  index = -1 
)
inline

Converts an XML document object to a torch::Tensor object.

◆ from_xml() [2/6]

template<typename T , std::size_t N>
torch::TensorAccessor< T, N > & iganet::utils::from_xml ( const pugi::xml_document &  doc,
torch::TensorAccessor< T, N > &  accessor,
torch::IntArrayRef  sizes,
std::string  tag = "Matrix",
int  id = 0,
std::string  label = "",
int  index = -1 
)
inline

Converts an XML documentobject to a torch::TensorAccessor object.

◆ from_xml() [3/6]

template<typename T , std::size_t N, std::size_t M>
utils::TensorArray< M > & iganet::utils::from_xml ( const pugi::xml_document &  doc,
utils::TensorArray< M > &  tensors,
std::string  tag = "Matrix",
int  id = 0,
bool  alloc = true,
std::string  label = "" 
)
inline

Converts an XML document object to an std::array of torch::Tensor objects.

◆ from_xml() [4/6]

template<typename T , std::size_t N>
torch::Tensor & iganet::utils::from_xml ( const pugi::xml_node &  root,
torch::Tensor &  tensor,
std::string  tag = "Matrix",
int  id = 0,
std::string  label = "",
bool  alloc = true,
int  index = -1 
)
inline

Converts an XML object to a torch::Tensor object.

◆ from_xml() [5/6]

template<typename T , std::size_t N>
torch::TensorAccessor< T, N > & iganet::utils::from_xml ( const pugi::xml_node &  root,
torch::TensorAccessor< T, N > &  accessor,
torch::IntArrayRef  sizes,
std::string  tag = "Matrix",
int  id = 0,
std::string  label = "",
int  index = -1 
)
inline

Converts an XML object to a torch::TensorAccessor object.

◆ from_xml() [6/6]

template<typename T , std::size_t N, std::size_t M>
utils::TensorArray< M > & iganet::utils::from_xml ( const pugi::xml_node &  root,
utils::TensorArray< M > &  tensors,
std::string  tag = "Matrix",
int  id = 0,
bool  alloc = true,
std::string  label = "" 
)
inline

Converts an XML object to an std::array of torch::Tensor objects.

◆ gammainc()

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::gammainc ( const BlockTensor< T, Dims... > &  input,
const BlockTensor< U, Dims... > &  other 
)
inline

Returns a new block tensor with the regularized lower incomplete gamma function of each element of input

◆ gammaincc()

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::gammaincc ( const BlockTensor< T, Dims... > &  input,
const BlockTensor< U, Dims... > &  other 
)
inline

Returns a new block tensor with the regularized upper incomplete gamma function of each element of input

◆ getenv() [1/2]

template<typename T >
T iganet::utils::getenv ( std::string  variable,
const T &  default_value 
)

Returns the value from an environment variable.

◆ getenv() [2/2]

template<typename T >
std::vector< T > iganet::utils::getenv ( std::string  variable,
std::initializer_list< T >  default_value 
)

Returns the value from an environment variable.

◆ hypot()

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::hypot ( const BlockTensor< T, Dims... > &  input,
const BlockTensor< U, Dims... > &  other 
)
inline

logit

Given the legs of a right triangle, return its hypotenuse

◆ i0()

template<typename T , std::size_t... Dims>
auto iganet::utils::i0 ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the element-wise zeroth order modified Bessel function of the first kind for each element of input

◆ igamma()

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::igamma ( const BlockTensor< T, Dims... > &  input,
const BlockTensor< U, Dims... > &  other 
)
inline

Alias for gammainc()

◆ igammac()

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::igammac ( const BlockTensor< T, Dims... > &  input,
const BlockTensor< U, Dims... > &  other 
)
inline

Alias for gammainc()

◆ imag()

template<typename T , std::size_t... Dims>
auto iganet::utils::imag ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the imaginary values of the elements of input

◆ kron() [1/2]

template<typename T , typename... Ts>
auto iganet::utils::kron ( T &&  t,
Ts &&...  ts 
)
inline

Computes the Kronecker-product between two or more tensors.

◆ kron() [2/2]

template<typename T0 , typename T1 >
auto iganet::utils::kron ( T0 &&  t0,
T1 &&  t1 
)
inline

Computes the Kronecker-product between two or more tensors.

◆ kronproduct() [1/2]

template<short_t dim = 0, typename T , typename... Ts>
auto iganet::utils::kronproduct ( T &&  t,
Ts &&...  ts 
)
inline

Computes the directional Kronecker-product between two or more tensors along the given dimension.

Template Parameters
dimDimension along which the Kronecker-product is computed
TType of the first argument
TsTypes of the variadic arguments
Parameters
[in]tFirst argument
[in]tsVariadic arguments
Returns
Tensor containing the dimensional Kronecker-product
Note
This is not the regular Kronecker-product but a directional variant, that is, the Kronecker-product is computed along the given direction. All other directions are left unchanged. For the regular Kronecker-product use utils::kron.

◆ kronproduct() [2/2]

template<short_t dim = 0, typename T0 , typename T1 >
auto iganet::utils::kronproduct ( T0 &&  t0,
T1 &&  t1 
)
inline

Computes the directional Kronecker-product between two tensors along the given dimension.

Template Parameters
dimDimension along which the Kronecker-product is computed
T0Type of the first argument
T1Type of the second argument
Parameters
[in]t0First argument
[in]t1Second argument
Returns
Tensor containing the dimensional Kronecker-product
Note
This is not the regular Kronecker-product but a directional variant, that is, the Kronecker-product is computed along the given direction. All other directions are left unchanged. For the regular Kronecker-product use utils::kron.

◆ ldexp()

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::ldexp ( const BlockTensor< T, Dims... > &  input,
const BlockTensor< U, Dims... > &  other 
)
inline

Returns a new block tensor with the elements of input multiplied by 2**other.

◆ lgamma()

template<typename T , std::size_t... Dims>
auto iganet::utils::lgamma ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the natural logarithm of the absolute value of the gamma function of the elements of input

◆ log()

template<typename T , std::size_t... Dims>
auto iganet::utils::log ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the natural logarithm of the elements of input

◆ log10()

template<typename T , std::size_t... Dims>
auto iganet::utils::log10 ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the logarithm to the base-10 of the elements of input

◆ log1p()

template<typename T , std::size_t... Dims>
auto iganet::utils::log1p ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the natural logarithm of (1 + the elements of input)

◆ log2()

template<typename T , std::size_t... Dims>
auto iganet::utils::log2 ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the logarithm to the base-2 of the elements of input

◆ logaddexp()

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::logaddexp ( const BlockTensor< T, Dims... > &  input,
const BlockTensor< U, Dims... > &  other 
)
inline

Returns a new block-vector with the logarithm of the sum of exponentiations of the elements of input

◆ logaddexp2()

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::logaddexp2 ( const BlockTensor< T, Dims... > &  input,
const BlockTensor< U, Dims... > &  other 
)
inline

Returns a new block-vector with the logarithm of the sum of exponentiations of the elements of input in base-2.

◆ logical_and()

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::logical_and ( const BlockTensor< T, Dims... > &  input,
const BlockTensor< U, Dims... > &  other 
)
inline

Returns a new block tensor with the element-wise logical AND of the elements of input and other

◆ logical_not()

template<typename T , std::size_t... Dims>
auto iganet::utils::logical_not ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the element-wise logical NOT of the elements of input

◆ logical_or()

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::logical_or ( const BlockTensor< T, Dims... > &  input,
const BlockTensor< U, Dims... > &  other 
)
inline

Returns a new block tensor with the element-wise logical OR of the elements of input and other

◆ logical_xor()

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::logical_xor ( const BlockTensor< T, Dims... > &  input,
const BlockTensor< U, Dims... > &  other 
)
inline

Returns a new block tensor with the element-wise logical XOR of the elements of input and other

◆ make_array() [1/2]

template<typename T , typename U , std::size_t N>
constexpr std::array< T, N > iganet::utils::make_array ( std::array< U, N array)
inlineconstexpr

Creates an std::array object from another std::array object.

◆ make_array() [2/2]

template<typename T , std::size_t N>
constexpr auto iganet::utils::make_array ( value)
inlineconstexpr

Creates an std::array object filled with a constant.

◆ make_shared()

template<typename T >
auto iganet::utils::make_shared ( T &&  arg)
inline

Returns an std::shared_ptr<T> object from arg.

◆ mul()

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::mul ( const BlockTensor< T, Dims... > &  input,
const BlockTensor< U, Dims... > &  other 
)
inline

Returns a new block tensor with the product of each element of input and other

◆ multiply()

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::multiply ( const BlockTensor< T, Dims... > &  input,
const BlockTensor< U, Dims... > &  other 
)
inline

Alias for mul()

◆ neg()

template<typename T , std::size_t... Dims>
auto iganet::utils::neg ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the negative of the elements of input

◆ negative()

template<typename T , std::size_t... Dims>
auto iganet::utils::negative ( const BlockTensor< T, Dims... > &  input)
inline

Alias for neg()

◆ nextafter()

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::nextafter ( const BlockTensor< T, Dims... > &  input,
const BlockTensor< U, Dims... > &  other 
)
inline

Return a new block tensor with the next elementwise floating-point value after input towards other

◆ operator!=()

template<typename T , typename U , std::size_t... TDims, std::size_t... UDims>
bool iganet::utils::operator!= ( const BlockTensor< T, TDims... > &  lhs,
const BlockTensor< U, UDims... > &  rhs 
)
inline

Returns true if both compile-time block tensors are not equal.

◆ operator*() [1/6]

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::operator* ( const BlockTensor< T, Dims... > &  lhs,
const U rhs 
)
inline

Multiplies a compile-time block tensor with a scalar and returns a new compile-time block tensor.

◆ operator*() [2/6]

template<typename T , typename U , std::size_t Rows, std::size_t Common, std::size_t Cols>
auto iganet::utils::operator* ( const BlockTensor< T, Rows, Common > &  lhs,
const BlockTensor< U, Common, Cols > &  rhs 
)
inline

Multiplies one compile-time rank-2 block tensor with another compile-time rank-2 block tensor.

◆ operator*() [3/6]

template<typename T , typename U , std::size_t Rows, std::size_t Common, std::size_t Cols, std::size_t Slices>
auto iganet::utils::operator* ( const BlockTensor< T, Rows, Common > &  lhs,
const BlockTensor< U, Common, Cols, Slices > &  rhs 
)
inline

Multiplies one compile-time rank-2 block tensor from the left with a compile-time rank-3 block tensor slice-by-slice.

◆ operator*() [4/6]

template<typename T , typename U , std::size_t Rows, std::size_t Common, std::size_t Cols, std::size_t Slices>
auto iganet::utils::operator* ( const BlockTensor< T, Rows, Common, Slices > &  lhs,
const BlockTensor< U, Common, Cols > &  rhs 
)
inline

Multiplies one compile-time rank-3 block tensor from the left with a compile-time rank-2 block tensor slice-by-slice.

◆ operator*() [5/6]

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::operator* ( const T &  lhs,
const BlockTensor< U, Dims... > &  rhs 
)
inline

Multiplies a scalar with a compile-time block tensor and returns a new compile-time block tensor.

◆ operator*() [6/6]

template<typename T , std::size_t N>
constexpr std::array< T, N > iganet::utils::operator* ( std::array< T, N lhs,
std::array< T, N rhs 
)
inlineconstexpr

Multiplies two std::arrays.

◆ operator+() [1/10]

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::operator+ ( const BlockTensor< T, Dims... > &  lhs,
const BlockTensor< U, Dims... > &  rhs 
)
inline

Adds one compile-time block tensor to another and returns a new compile-time block tensor.

◆ operator+() [2/10]

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::operator+ ( const BlockTensor< T, Dims... > &  lhs,
const U rhs 
)
inline

Adds a compile-time block tensor to a scalar and returns a new compile-time block tensor.

◆ operator+() [3/10]

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::operator+ ( const T &  lhs,
const BlockTensor< U, Dims... > &  rhs 
)
inline

Adds a scalar to a compile-time block tensor and returns a new compile-time block tensor.

◆ operator+() [4/10]

template<typename T , std::size_t N>
constexpr auto iganet::utils::operator+ ( std::array< T, N array,
data 
)
inlineconstexpr

Appends data to a std::array object.

◆ operator+() [5/10]

template<typename T , std::size_t N>
constexpr std::array< T, N > iganet::utils::operator+ ( std::array< T, N lhs,
std::array< T, N rhs 
)
inlineconstexpr

Adds two std::arrays.

◆ operator+() [6/10]

template<typename T >
constexpr auto iganet::utils::operator+ ( std::vector< T >  vector,
data 
)
inlineconstexpr

Appends data to a std::vector object.

◆ operator+() [7/10]

template<typename T , std::size_t N>
constexpr auto iganet::utils::operator+ ( data,
std::array< T, N array 
)
inlineconstexpr

Prepends data to a std::array object.

◆ operator+() [8/10]

template<typename T >
constexpr auto iganet::utils::operator+ ( data,
std::vector< T >  vector 
)
inlineconstexpr

Prepends data to a std::vector object.

◆ operator+() [9/10]

template<typename T >
constexpr auto iganet::utils::operator+ ( data,
torch::ArrayRef< T >  array 
)
inlineconstexpr

Prepends data to a torch::ArrayRef object.

◆ operator+() [10/10]

template<typename T >
constexpr auto iganet::utils::operator+ ( torch::ArrayRef< T >  array,
data 
)
inlineconstexpr

Appends data to a torch::ArrayRef object.

◆ operator+=() [1/2]

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::operator+= ( BlockTensor< T, Dims... > &  lhs,
const BlockTensor< U, Dims... > &  rhs 
)
inline

Increments one compile-time block tensor by another.

◆ operator+=() [2/2]

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::operator+= ( BlockTensor< T, Dims... > &  lhs,
const U rhs 
)
inline

Increments a compile-time block tensor by a scalar.

◆ operator-() [1/5]

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::operator- ( const BlockTensor< T, Dims... > &  lhs,
const BlockTensor< U, Dims... > &  rhs 
)
inline

Subtracts one compile-time block tensor from another and returns a new compile-time block tensor.

◆ operator-() [2/5]

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::operator- ( const BlockTensor< T, Dims... > &  lhs,
const U rhs 
)
inline

Subtracts a scalar from a compile-time block tensor and returns a new compile-time block tensor.

◆ operator-() [3/5]

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::operator- ( const T &  lhs,
const BlockTensor< U, Dims... > &  rhs 
)
inline

Subtracts a compile-time block tensor from a scalar and returns a new compile-time block tensor.

◆ operator-() [4/5]

template<typename T , std::size_t N>
constexpr std::array< T, N > iganet::utils::operator- ( std::array< T, N array)
inlineconstexpr

Negates all entries of an std::array.

◆ operator-() [5/5]

template<typename T , std::size_t N>
constexpr std::array< T, N > iganet::utils::operator- ( std::array< T, N lhs,
std::array< T, N rhs 
)
inlineconstexpr

Subtracts one std::array from another std::array.

◆ operator-=() [1/2]

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::operator-= ( BlockTensor< T, Dims... > &  lhs,
const BlockTensor< U, Dims... > &  rhs 
)
inline

Decrements one compile-time block tensor by another.

◆ operator-=() [2/2]

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::operator-= ( BlockTensor< T, Dims... > &  lhs,
const U rhs 
)
inline

Decrements a compile-time block tensor by a scalar.

◆ operator/()

template<typename T , std::size_t N>
constexpr std::array< T, N > iganet::utils::operator/ ( std::array< T, N lhs,
std::array< T, N rhs 
)
inlineconstexpr

Divides one std::array by another std::array.

◆ operator<<()

template<typename T , std::size_t... Dims>
std::ostream & iganet::utils::operator<< ( std::ostream &  os,
const BlockTensorCore< T, Dims... > &  obj 
)
inline

Prints (as string) a compile-time block tensor object.

◆ operator==()

template<typename T , typename U , std::size_t... TDims, std::size_t... UDims>
bool iganet::utils::operator== ( const BlockTensor< T, TDims... > &  lhs,
const BlockTensor< U, UDims... > &  rhs 
)
inline

Returns true if both compile-time block tensors are equal.

◆ positive()

template<typename T , std::size_t... Dims>
auto iganet::utils::positive ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the input

◆ pow()

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::pow ( const BlockTensor< T, Dims... > &  input,
const BlockTensor< U, Dims... > &  other 
)
inline

Returns a new block tensor with the power of each element in input with exponent other

◆ prod()

template<typename T , std::size_t N>
T iganet::utils::prod ( std::array< T, N array,
std::size_t  start_index = 0,
std::size_t  stop_index = N - 1 
)
inline

Computes the (partial) product of all std::array entries.

◆ rad2deg()

template<typename T , std::size_t... Dims>
auto iganet::utils::rad2deg ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with each of the elements of input converted from angles in radians to degrees.

◆ real()

template<typename T , std::size_t... Dims>
auto iganet::utils::real ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the real values of the elements of input

◆ reciprocal()

template<typename T , std::size_t... Dims>
auto iganet::utils::reciprocal ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the reciprocal of the elements of input

◆ remainder()

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::remainder ( const BlockTensor< T, Dims... > &  input,
const BlockTensor< U, Dims... > &  other 
)
inline

Returns a new block tensor with the modulus of the elements of input

◆ remove_from_back()

template<typename T , std::size_t N, std::size_t M = 1>
constexpr std::array< T, N - M > iganet::utils::remove_from_back ( std::array< T, N array)
inlineconstexpr

Derives an std::array object from a given std::array object dropping the last M entries.

◆ remove_from_front()

template<typename T , std::size_t N, std::size_t M = 1>
constexpr std::array< T, N - M > iganet::utils::remove_from_front ( std::array< T, N array)
inlineconstexpr

Derives an std::array object from a given std::array object dropping the first M entries.

◆ round()

template<typename T , std::size_t... Dims>
auto iganet::utils::round ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the elements of input rounded to the nearest integer.

◆ rsqrt()

template<typename T , std::size_t... Dims>
auto iganet::utils::rsqrt ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the reciprocal of the square-root of the elements of input

◆ sgn()

template<typename T , std::size_t... Dims>
auto iganet::utils::sgn ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the signs of the elements of input, extension to complex value.

◆ sigmoid()

template<typename T , std::size_t... Dims>
auto iganet::utils::sigmoid ( const BlockTensor< T, Dims... > &  input)
inline

Alias for expit()

◆ sign()

template<typename T , std::size_t... Dims>
auto iganet::utils::sign ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the signs of the elements of input

◆ signbit()

template<typename T , std::size_t... Dims>
auto iganet::utils::signbit ( const BlockTensor< T, Dims... > &  input)
inline

Tests if each element of input has its sign bit set (is less than zero) or not.

◆ sin()

template<typename T , std::size_t... Dims>
auto iganet::utils::sin ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the sine of the elements of input

◆ sinc()

template<typename T , std::size_t... Dims>
auto iganet::utils::sinc ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the normalized sinc of the elements of input

◆ sinh()

template<typename T , std::size_t... Dims>
auto iganet::utils::sinh ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the hyperbolic sine of the elements of input

◆ sqrt()

template<typename T , std::size_t... Dims>
auto iganet::utils::sqrt ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the square-root of the elements of input

◆ square()

template<typename T , std::size_t... Dims>
auto iganet::utils::square ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new block tensor with the square of the elements of input

◆ sub()

template<typename T , typename U , typename V , std::size_t... Dims>
auto iganet::utils::sub ( const BlockTensor< T, Dims... > &  input,
const BlockTensor< U, Dims... > &  other,
V  alpha = 1.0 
)
inline

Subtracts other, scaled by alpha, from input.

◆ subtract()

template<typename T , typename U , typename V , std::size_t... Dims>
auto iganet::utils::subtract ( const BlockTensor< T, Dims... > &  input,
const BlockTensor< U, Dims... > &  other,
V  alpha = 1.0 
)
inline

Alias for sub()

◆ sum()

template<typename T , std::size_t N>
T iganet::utils::sum ( std::array< T, N array,
std::size_t  start_index = 0,
std::size_t  stop_index = N - 1 
)
inline

Computes the (partial) sum of all std::array entries.

◆ tan()

template<typename T , std::size_t... Dims>
auto iganet::utils::tan ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new tensor with the tangent of the elements of input.

◆ tanh()

template<typename T , std::size_t... Dims>
auto iganet::utils::tanh ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new tensor with the hyperbolic tangent of the elements of input.

◆ to_array() [1/2]

template<typename... Args>
auto iganet::utils::to_array ( Args &&...  args)
inline

Converts a list of arguments into std::array.

◆ to_array() [2/2]

template<std::size_t N, typename T >
std::array< T, N > iganet::utils::to_array ( std::vector< T > &&  vector)
inline

Converts an std::vector object into std::array.

◆ to_ArrayRef()

template<typename T , std::size_t N>
auto iganet::utils::to_ArrayRef ( const std::array< T, N > &  array)
inline

Converts an std::array<int64_t, N> to a at::IntArrayRef object.

◆ to_json() [1/3]

template<typename T , std::size_t N>
auto iganet::utils::to_json ( const torch::Tensor &  tensor)
inline

Converts a torch::Tensor object to a JSON object.

◆ to_json() [2/3]

template<typename T , std::size_t N>
auto iganet::utils::to_json ( const torch::TensorAccessor< T, N > &  accessor)
inline

Converts a torch::TensorAccessor object to a JSON object.

◆ to_json() [3/3]

template<typename T , std::size_t N, std::size_t M>
auto iganet::utils::to_json ( const utils::TensorArray< M > &  tensors)
inline

Converts an std::array of torch::Tensor objects to a JSON object.

◆ to_tensor() [1/6]

template<typename T , std::size_t N>
auto iganet::utils::to_tensor ( const std::array< T, N > &  array,
const iganet::Options< T > &  options 
)
inline

Converts an std::array to torch::Tensor.

◆ to_tensor() [2/6]

template<typename T , std::size_t N>
auto iganet::utils::to_tensor ( const std::array< T, N > &  array,
torch::IntArrayRef  sizes = torch::IntArrayRef{-1},
const iganet::Options< T > &  options = iganet::Options<T>{} 
)
inline

Converts an std::array to torch::Tensor.

◆ to_tensor() [3/6]

template<typename T >
auto iganet::utils::to_tensor ( const std::vector< T > &  vector,
const iganet::Options< T > &  options 
)
inline

Converts an std::vector to torch::Tensor.

◆ to_tensor() [4/6]

template<typename T >
auto iganet::utils::to_tensor ( const std::vector< T > &  vector,
torch::IntArrayRef  sizes = torch::IntArrayRef{-1},
const iganet::Options< T > &  options = iganet::Options<T>{} 
)
inline

Converts an std::vector to torch::Tensor.

◆ to_tensor() [5/6]

template<typename T >
auto iganet::utils::to_tensor ( std::initializer_list< T > &  list,
const iganet::Options< T > &  options 
)
inline

Converts an std::initializer_list to torch::Tensor.

◆ to_tensor() [6/6]

template<typename T >
auto iganet::utils::to_tensor ( std::initializer_list< T >  list,
torch::IntArrayRef  sizes = torch::IntArrayRef{-1},
const iganet::Options< T > &  options = iganet::Options<T>{} 
)
inline

Converts an std::initializer_list to torch::Tensor.

◆ to_tensorAccessor() [1/5]

template<typename T , std::size_t N, std::size_t... Dims>
auto iganet::utils::to_tensorAccessor ( const BlockTensor< torch::Tensor, Dims... > &  blocktensor,
c10::DeviceType  deviceType 
)

Converts an std::array of torch::Tensor objects to an array of torch::TensorAccessor objects.

◆ to_tensorAccessor() [2/5]

template<typename T , std::size_t N, std::size_t M>
auto iganet::utils::to_tensorAccessor ( const TensorArray< M > &  tensorArray)

Converts an std::array of torch::Tensor objects to an array of torch::TensorAccessor objects.

◆ to_tensorAccessor() [3/5]

template<typename T , std::size_t N, std::size_t M>
auto iganet::utils::to_tensorAccessor ( const TensorArray< M > &  tensorArray,
c10::DeviceType  deviceType 
)

Converts an std::array of torch::Tensor objects to an array of torch::TensorAccessor objects.

◆ to_tensorAccessor() [4/5]

template<typename T , std::size_t N>
auto iganet::utils::to_tensorAccessor ( const torch::Tensor &  tensor)

Converts a torch::Tensor object to a torch::TensorAccessor object.

◆ to_tensorAccessor() [5/5]

template<typename T , std::size_t N>
auto iganet::utils::to_tensorAccessor ( const torch::Tensor &  tensor,
c10::DeviceType  deviceType 
)

Converts a torch::Tensor object to a torch::TensorAccessor object.

◆ to_tensorArray() [1/4]

template<typename... Ts, typename T >
constexpr TensorArray< sizeof...(Ts)> iganet::utils::to_tensorArray ( const iganet::Options< T > &  options,
std::initializer_list< Ts > &&...  lists 
)
inlineconstexpr

Converts a set of std::initializer_list objects to a TensorArray object.

◆ to_tensorArray() [2/4]

template<typename... Ts>
constexpr TensorArray< sizeof...(Ts)> iganet::utils::to_tensorArray ( std::initializer_list< Ts > &&...  lists)
inlineconstexpr

Converts a set of std::initializer_list objects to a TensorArray object.

◆ to_tensorArray() [3/4]

template<typename... Ts, typename T >
constexpr TensorArray< sizeof...(Ts)> iganet::utils::to_tensorArray ( torch::IntArrayRef  sizes,
const iganet::Options< T > &  options,
std::initializer_list< Ts > &&...  lists 
)
inlineconstexpr

Converts a set of std::initializer_list objects to a TensorArray object.

◆ to_tensorArray() [4/4]

template<typename... Ts>
constexpr TensorArray< sizeof...(Ts)> iganet::utils::to_tensorArray ( torch::IntArrayRef  sizes,
std::initializer_list< Ts > &&...  lists 
)
inlineconstexpr

Converts a set of std::initializer_list objects to a TensorArray object.

◆ to_vector() [1/2]

template<typename... Args>
auto iganet::utils::to_vector ( Args &&...  args)
inline

Converts a list of arguments into std::vector.

◆ to_vector() [2/2]

template<typename T , std::size_t N>
std::vector< T > iganet::utils::to_vector ( std::array< T, N > &&  array)
inline

Converts an std::array object into std::vector.

◆ to_xml() [1/6]

template<typename T , std::size_t N>
pugi::xml_node & iganet::utils::to_xml ( const torch::Tensor &  tensor,
pugi::xml_node &  root,
std::string  tag = "Matrix",
int  id = 0,
std::string  label = "",
int  index = -1 
)
inline

Converts a torch::Tensor object to an XML object.

◆ to_xml() [2/6]

template<typename T , std::size_t N>
pugi::xml_document iganet::utils::to_xml ( const torch::Tensor &  tensor,
std::string  tag = "Matrix",
int  id = 0,
std::string  label = "",
int  index = -1 
)
inline

Converts a torch::Tensor object to an XML document object.

◆ to_xml() [3/6]

template<typename T , std::size_t N>
pugi::xml_node & iganet::utils::to_xml ( const torch::TensorAccessor< T, N > &  accessor,
torch::IntArrayRef  sizes,
pugi::xml_node &  root,
std::string  tag = "Matrix",
int  id = 0,
std::string  label = "",
int  index = -1 
)
inline

Converts a torch::TensorAccessor object to an XML object.

◆ to_xml() [4/6]

template<typename T , std::size_t N>
pugi::xml_document iganet::utils::to_xml ( const torch::TensorAccessor< T, N > &  accessor,
torch::IntArrayRef  sizes,
std::string  tag = "Matrix",
int  id = 0,
std::string  label = "",
int  index = -1 
)
inline

Converts a torch::TensorAccessor object to an XML document object.

◆ to_xml() [5/6]

template<typename T , std::size_t N, std::size_t M>
pugi::xml_node & iganet::utils::to_xml ( const utils::TensorArray< M > &  tensors,
pugi::xml_node &  root,
std::string  tag = "Matrix",
int  id = 0,
std::string  label = "" 
)
inline

Converts an std::array of torch::Tensor objects to an XML object.

◆ to_xml() [6/6]

template<typename T , std::size_t N, std::size_t M>
pugi::xml_document iganet::utils::to_xml ( const utils::TensorArray< M > &  tensors,
std::string  tag = "Matrix",
int  id = 0,
std::string  label = "",
int  index = -1 
)
inline

Converts an std::array of torch::Tensor objects to an XML object.

◆ trunc()

template<typename T , std::size_t... Dims>
auto iganet::utils::trunc ( const BlockTensor< T, Dims... > &  input)
inline

Returns a new tensor with the truncated integer values of the elements of input.

◆ VSlice() [1/2]

template<bool transpose = false, std::size_t N>
auto iganet::utils::VSlice ( const utils::TensorArray< N > &  index,
const std::array< int64_t, N > &  start_offset,
const std::array< int64_t, N > &  stop_offset,
const std::array< int64_t, N - 1 > &  leading_dim = make_array<int64_tN - 1>(1) 
)
inline

Vectorized version of torch::indexing::Slice (see https://pytorch.org/cppdocs/notes/tensor_indexing.html)

Parameters
[in]indexarray of tensors of indices
[in]start_offsetarray of starting value of the offset
[in]stop_offsetarray of stopping value of the offset
[in]leading_dimarray of leading dimension

◆ VSlice() [2/2]

template<bool transpose = false>
auto iganet::utils::VSlice ( torch::Tensor  index,
int64_t  start_offset,
int64_t  stop_offset 
)
inline

Vectorized version of torch::indexing::Slice (see https://pytorch.org/cppdocs/notes/tensor_indexing.html)

Creates a one-dimensional torch::Tensor object of size index.numel() * (stop_offset-start_offset) with the following content

[ index[0]+start_offset, ..., index[N-1]+start_offset,
index[0]+start_offset+1, ..., index[N-1]+start_offset+1,
...
index[0]+stop_offset-1, ... index[N-1]+stop_offset-1 ]
constexpr bool is_SplineType_v
Alias to the value of is_SplineType.
Definition bspline.hpp:3243
Parameters
[in]indexTensor of indices
[in]start_offsetStarting value of the offset
[in]stop_offsetStopping value of the offset

◆ xlogy()

template<typename T , typename U , std::size_t... Dims>
auto iganet::utils::xlogy ( const BlockTensor< T, Dims... > &  input,
const BlockTensor< U, Dims... > &  other 
)
inline

Computes input * log(other)

◆ zip()

template<typename... T>
auto iganet::utils::zip ( T &&...  seqs)

Variable Documentation

◆ is_tuple_of_tuples_v

template<class T >
constexpr auto iganet::utils::is_tuple_of_tuples_v = is_tuple_of_tuples<T>::value
inlineconstexpr

Alias for is_tuple_of_tuples::value.

◆ is_tuple_v

template<class T >
constexpr bool iganet::utils::is_tuple_v = is_tuple<T>::value
inlineconstexpr

◆ tuple_cat_v

template<typename... Tuples>
constexpr auto iganet::utils::tuple_cat_v = tuple_cat<Tuples...>::value
inlineconstexpr

Alias for tuple_cat::value.