alpaka
Abstraction Library for Parallel Kernel Acceleration
Loading...
Searching...
No Matches
alpaka::Vec< T_Type, T_dim, T_Storage > Struct Template Reference

#include <Vec.hpp>

Inheritance diagram for alpaka::Vec< T_Type, T_dim, T_Storage >:

Public Types

using index_type = uint32_t
using ParamType = type
using rank_type = uint32_t
using size_type = uint32_t
using Storage = T_Storage
using type = T_Type
using UniVec = Vec<T_Type, T_dim>

Public Member Functions

constexpr Vec ()=default
template<typename F, std::enable_if_t< std::is_invocable_v< F, std::integral_constant< uint32_t, 0u > >, uint32_t > = 0u>
constexpr Vec (F &&generator)
 Initialize via a generator expression.
template<typename... T_Args>
constexpr Vec (T_Args const &... args)
 Constructor for N-dimensional vector.
constexpr Vec (T_Storage const &other)
constexpr Vec (Vec const &other)=default
template<typename T_OtherStorage>
constexpr Vec (Vec< T_Type, T_dim, T_OtherStorage > const &other)
 constructor allows changing the storage policy
constexpr Vec< T_Type, T_dim > assign (concepts::CVector auto const selection, concepts::Vector< T_Type > auto const &value) const
 Assign an value to the given index position.
template<uint32_t T_elementIdx = 0>
requires (T_elementIdx < T_dim)
constexpr Vec< T_Type, T_dim > assign (T_Type const &value) const
 Assign an value to the given index position.
constexpr decltype(auto) back ()
constexpr decltype(auto) back () const
constexpr Vec< T_Type, T_dim - 1u > eraseBack () const
 Shrink the vector.
template<typename T_OtherStorage>
constexpr auto min (Vec< T_Type, T_dim, T_OtherStorage > const &rhs) const
template<uint32_t T_deferDim = T_dim, typename = typename std::enable_if<T_deferDim == 1u>::type>
constexpr operator type ()
 Allow static_cast / explicit cast to member type for 1D vector.
template<typename T_OtherStorage>
constexpr bool operator!= (Vec< T_Type, T_dim, T_OtherStorage > const &rhs) const
 != comparison operator.
constexpr Vec operator- () const
constexpr Vecoperator= (Vec &&)=default
constexpr Vecoperator= (Vec const &)=default
template<typename T_OtherStorage>
constexpr bool operator== (Vec< T_Type, T_dim, T_OtherStorage > const &rhs) const
 == comparison operator.
constexpr decltype(auto) operator[] (std::integral auto const idx)
constexpr decltype(auto) operator[] (std::integral auto const idx) const
template<typename T, T... T_values>
constexpr auto operator[] (Vec< T, sizeof...(T_values), detail::CVec< T, T_values... > > const v) const
 swizzle operator
constexpr type product () const
 Returns product of all components.
template<uint32_t T_elementIdx = T_dim - 1u>
requires (T_elementIdx < T_dim)
constexpr Vec< T_Type, T_dim > rAssign (T_Type const &value) const
 Assign an value to the given index position.
constexpr auto reduce (auto &&reduceFunc) const -> decltype(reduceFunc(std::declval< type >(), std::declval< type >()))
 reduce all elements to a single value
template<typename T, T... T_values>
constexpr auto ref (Vec< T, sizeof...(T_values), detail::CVec< T, T_values... > > const v)
template<typename T, T... T_values>
constexpr auto ref (Vec< T, sizeof...(T_values), detail::CVec< T, T_values... > > const v) const
template<std::integral auto dimToRemove>
requires (T_dim >= 2u)
constexpr Vec< type, T_dim - 1u > remove () const
 Removes a component.
constexpr Vec revert () const
template<uint32_t T_numElements>
constexpr Vec< T_Type, T_numElements > rshrink () const
 Shrink the number of elements of a vector.
template<uint32_t T_numElements>
constexpr Vec< type, T_numElements > rshrink (std::integral auto const startIdx) const
 Shrink the number of elements of a vector.
constexpr type sum () const
 Returns sum of all components.
constexpr Vec toRT () const
std::string toString (std::string const separator=",", std::string const enclosings="{}") const
 create string out of the vector
template<typename T_OtherStorage>
constexpr Vecoperator+= (Vec< T_Type, T_dim, T_OtherStorage > const &rhs)
 assign operator
constexpr Vecoperator+= (concepts::LosslesslyConvertible< T_Type > auto const value)
 assign operator
template<typename T_OtherStorage>
constexpr Vecoperator-= (Vec< T_Type, T_dim, T_OtherStorage > const &rhs)
 assign operator
constexpr Vecoperator-= (concepts::LosslesslyConvertible< T_Type > auto const value)
 assign operator
template<typename T_OtherStorage>
constexpr Vecoperator/= (Vec< T_Type, T_dim, T_OtherStorage > const &rhs)
 assign operator
constexpr Vecoperator/= (concepts::LosslesslyConvertible< T_Type > auto const value)
 assign operator
template<typename T_OtherStorage>
constexpr Vecoperator*= (Vec< T_Type, T_dim, T_OtherStorage > const &rhs)
 assign operator
constexpr Vecoperator*= (concepts::LosslesslyConvertible< T_Type > auto const value)
 assign operator
template<typename T_OtherStorage>
constexpr Vecoperator= (Vec< T_Type, T_dim, T_OtherStorage > const &rhs)
 assign operator
constexpr Vecoperator= (concepts::LosslesslyConvertible< T_Type > auto const value)
 assign operator
constexpr decltype(auto) x ()
 named member access
constexpr decltype(auto) x () const
 named member access
constexpr decltype(auto) y ()
 named member access
constexpr decltype(auto) y () const
 named member access
constexpr decltype(auto) z ()
 named member access
constexpr decltype(auto) z () const
 named member access
constexpr decltype(auto) w ()
 named member access
constexpr decltype(auto) w () const
 named member access

Static Public Member Functions

static consteval uint32_t dim ()
template<auto T_v>
requires requires { T_Storage::template fill<T_v>(); }
static constexpr auto fill ()
static constexpr auto fill (concepts::Convertible< T_Type > auto const &value)
 Creates a Vec where all dimensions are set to the same value.

Detailed Description

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
struct alpaka::Vec< T_Type, T_dim, T_Storage >

Definition at line 178 of file Vec.hpp.

Member Typedef Documentation

◆ index_type

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
using alpaka::Vec< T_Type, T_dim, T_Storage >::index_type = uint32_t

Definition at line 184 of file Vec.hpp.

◆ ParamType

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
using alpaka::Vec< T_Type, T_dim, T_Storage >::ParamType = type

Definition at line 182 of file Vec.hpp.

◆ rank_type

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
using alpaka::Vec< T_Type, T_dim, T_Storage >::rank_type = uint32_t

Definition at line 186 of file Vec.hpp.

◆ size_type

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
using alpaka::Vec< T_Type, T_dim, T_Storage >::size_type = uint32_t

Definition at line 185 of file Vec.hpp.

◆ Storage

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
using alpaka::Vec< T_Type, T_dim, T_Storage >::Storage = T_Storage

Definition at line 180 of file Vec.hpp.

◆ type

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
using alpaka::Vec< T_Type, T_dim, T_Storage >::type = T_Type

Definition at line 181 of file Vec.hpp.

◆ UniVec

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
using alpaka::Vec< T_Type, T_dim, T_Storage >::UniVec = Vec<T_Type, T_dim>

Definition at line 189 of file Vec.hpp.

Constructor & Destructor Documentation

◆ Vec() [1/6]

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
alpaka::Vec< T_Type, T_dim, T_Storage >::Vec ( )
constexprdefault

◆ Vec() [2/6]

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
template<typename F, std::enable_if_t< std::is_invocable_v< F, std::integral_constant< uint32_t, 0u > >, uint32_t > = 0u>
alpaka::Vec< T_Type, T_dim, T_Storage >::Vec ( F && generator)
inlineexplicitconstexpr

Initialize via a generator expression.

The generator must return the value for the corresponding index of the component which is passed to the generator.

Definition at line 204 of file Vec.hpp.

◆ Vec() [3/6]

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
template<typename... T_Args>
alpaka::Vec< T_Type, T_dim, T_Storage >::Vec ( T_Args const &... args)
inlineconstexpr

Constructor for N-dimensional vector.

Attention
This constructor allows implicit casts.
Parameters
argsvalue of each dimension, x,y,z,...

A constexpr vector should be initialized with {} instead of () because at least CUDA 11.6 has problems in cases where a compile time evaluation is required.

constexpr auto vec1 = Vec{ 1 };
constexpr auto vec2 = Vec{ 1, 2 };
//or explicit
constexpr auto vec3 = Vec<int, 3u>{ 1, 2, 3 };
constexpr auto vec4 = Vec<int, 3u>{ {1, 2, 3} };
constexpr Vec()=default

Definition at line 235 of file Vec.hpp.

◆ Vec() [4/6]

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
alpaka::Vec< T_Type, T_dim, T_Storage >::Vec ( Vec< T_Type, T_dim, T_Storage > const & other)
constexprdefault

◆ Vec() [5/6]

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
alpaka::Vec< T_Type, T_dim, T_Storage >::Vec ( T_Storage const & other)
inlineconstexpr

Definition at line 241 of file Vec.hpp.

◆ Vec() [6/6]

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
template<typename T_OtherStorage>
alpaka::Vec< T_Type, T_dim, T_Storage >::Vec ( Vec< T_Type, T_dim, T_OtherStorage > const & other)
inlineconstexpr

constructor allows changing the storage policy

Definition at line 248 of file Vec.hpp.

Member Function Documentation

◆ assign() [1/2]

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
Vec< T_Type, T_dim > alpaka::Vec< T_Type, T_dim, T_Storage >::assign ( concepts::CVector auto const selection,
concepts::Vector< T_Type > auto const & value ) const
inlineconstexpr

Assign an value to the given index position.

Parameters
selectionCVec with the indices of the elements which shall be replaced; indices range must be [0; T_dim -1]
valuevalue to assign to the element at the given index position
Returns
copy of the vector with where the index positions are updated with value

Definition at line 472 of file Vec.hpp.

◆ assign() [2/2]

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
template<uint32_t T_elementIdx = 0>
requires (T_elementIdx < T_dim)
Vec< T_Type, T_dim > alpaka::Vec< T_Type, T_dim, T_Storage >::assign ( T_Type const & value) const
inlineconstexpr

Assign an value to the given index position.

Template Parameters
T_elementIdxIndex of the element from the begin which shall be replaced; range: [ 0; T_dim - 1 ]
Parameters
valuevalue to assign to the element at the given index position
Returns
copy of the vector with where the index positions are updated with value

Definition at line 458 of file Vec.hpp.

◆ back() [1/2]

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
decltype(auto) alpaka::Vec< T_Type, T_dim, T_Storage >::back ( )
inlineconstexpr

Definition at line 392 of file Vec.hpp.

◆ back() [2/2]

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
decltype(auto) alpaka::Vec< T_Type, T_dim, T_Storage >::back ( ) const
inlineconstexpr

Definition at line 397 of file Vec.hpp.

◆ dim()

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
consteval uint32_t alpaka::Vec< T_Type, T_dim, T_Storage >::dim ( )
inlinestaticconsteval

Definition at line 260 of file Vec.hpp.

◆ eraseBack()

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
Vec< T_Type, T_dim - 1u > alpaka::Vec< T_Type, T_dim, T_Storage >::eraseBack ( ) const
inlineconstexpr

Shrink the vector.

Removes the last value.

Definition at line 424 of file Vec.hpp.

◆ fill() [1/2]

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
template<auto T_v>
requires requires { T_Storage::template fill<T_v>(); }
constexpr auto alpaka::Vec< T_Type, T_dim, T_Storage >::fill ( )
inlinestaticconstexpr

Definition at line 285 of file Vec.hpp.

◆ fill() [2/2]

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
constexpr auto alpaka::Vec< T_Type, T_dim, T_Storage >::fill ( concepts::Convertible< T_Type > auto const & value)
inlinestaticconstexpr

Creates a Vec where all dimensions are set to the same value.

Parameters
valueValue which is set for all dimensions
Returns
new Vec<...>

Definition at line 271 of file Vec.hpp.

◆ min()

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
template<typename T_OtherStorage>
auto alpaka::Vec< T_Type, T_dim, T_Storage >::min ( Vec< T_Type, T_dim, T_OtherStorage > const & rhs) const
inlineconstexpr

Definition at line 571 of file Vec.hpp.

◆ operator type()

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
template<uint32_t T_deferDim = T_dim, typename = typename std::enable_if<T_deferDim == 1u>::type>
alpaka::Vec< T_Type, T_dim, T_Storage >::operator type ( )
inlineexplicitconstexpr

Allow static_cast / explicit cast to member type for 1D vector.

Definition at line 255 of file Vec.hpp.

◆ operator!=()

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
template<typename T_OtherStorage>
bool alpaka::Vec< T_Type, T_dim, T_Storage >::operator!= ( Vec< T_Type, T_dim, T_OtherStorage > const & rhs) const
inlineconstexpr

!= comparison operator.

Compares dims of two DataSpaces.

Parameters
otherVec to compare to
Returns
true if one component in both vectors are not equal, else false

Definition at line 565 of file Vec.hpp.

◆ operator*=() [1/2]

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
Vec & alpaka::Vec< T_Type, T_dim, T_Storage >::operator*= ( concepts::LosslesslyConvertible< T_Type > auto const value)
inlineconstexpr

assign operator

Definition at line 352 of file Vec.hpp.

◆ operator*=() [2/2]

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
template<typename T_OtherStorage>
Vec & alpaka::Vec< T_Type, T_dim, T_Storage >::operator*= ( Vec< T_Type, T_dim, T_OtherStorage > const & rhs)
inlineconstexpr

assign operator

Definition at line 352 of file Vec.hpp.

◆ operator+=() [1/2]

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
Vec & alpaka::Vec< T_Type, T_dim, T_Storage >::operator+= ( concepts::LosslesslyConvertible< T_Type > auto const value)
inlineconstexpr

assign operator

Definition at line 349 of file Vec.hpp.

◆ operator+=() [2/2]

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
template<typename T_OtherStorage>
Vec & alpaka::Vec< T_Type, T_dim, T_Storage >::operator+= ( Vec< T_Type, T_dim, T_OtherStorage > const & rhs)
inlineconstexpr

assign operator

Definition at line 349 of file Vec.hpp.

◆ operator-()

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
Vec alpaka::Vec< T_Type, T_dim, T_Storage >::operator- ( ) const
inlineconstexpr

Definition at line 308 of file Vec.hpp.

◆ operator-=() [1/2]

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
Vec & alpaka::Vec< T_Type, T_dim, T_Storage >::operator-= ( concepts::LosslesslyConvertible< T_Type > auto const value)
inlineconstexpr

assign operator

Definition at line 350 of file Vec.hpp.

◆ operator-=() [2/2]

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
template<typename T_OtherStorage>
Vec & alpaka::Vec< T_Type, T_dim, T_Storage >::operator-= ( Vec< T_Type, T_dim, T_OtherStorage > const & rhs)
inlineconstexpr

assign operator

Definition at line 350 of file Vec.hpp.

◆ operator/=() [1/2]

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
Vec & alpaka::Vec< T_Type, T_dim, T_Storage >::operator/= ( concepts::LosslesslyConvertible< T_Type > auto const value)
inlineconstexpr

assign operator

Definition at line 351 of file Vec.hpp.

◆ operator/=() [2/2]

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
template<typename T_OtherStorage>
Vec & alpaka::Vec< T_Type, T_dim, T_Storage >::operator/= ( Vec< T_Type, T_dim, T_OtherStorage > const & rhs)
inlineconstexpr

assign operator

Definition at line 351 of file Vec.hpp.

◆ operator=() [1/4]

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
Vec & alpaka::Vec< T_Type, T_dim, T_Storage >::operator= ( concepts::LosslesslyConvertible< T_Type > auto const value)
inlineconstexpr

assign operator

Definition at line 353 of file Vec.hpp.

◆ operator=() [2/4]

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
Vec & alpaka::Vec< T_Type, T_dim, T_Storage >::operator= ( Vec< T_Type, T_dim, T_Storage > && )
constexprdefault

◆ operator=() [3/4]

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
Vec & alpaka::Vec< T_Type, T_dim, T_Storage >::operator= ( Vec< T_Type, T_dim, T_Storage > const & )
constexprdefault

◆ operator=() [4/4]

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
template<typename T_OtherStorage>
Vec & alpaka::Vec< T_Type, T_dim, T_Storage >::operator= ( Vec< T_Type, T_dim, T_OtherStorage > const & rhs)
inlineconstexpr

assign operator

Definition at line 353 of file Vec.hpp.

◆ operator==()

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
template<typename T_OtherStorage>
bool alpaka::Vec< T_Type, T_dim, T_Storage >::operator== ( Vec< T_Type, T_dim, T_OtherStorage > const & rhs) const
inlineconstexpr

== comparison operator.

Compares dims of two DataSpaces.

Parameters
otherVec to compare to
Returns
true if all components in both vectors are equal, else false

Definition at line 548 of file Vec.hpp.

◆ operator[]() [1/3]

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
decltype(auto) alpaka::Vec< T_Type, T_dim, T_Storage >::operator[] ( std::integral auto const idx)
inlineconstexpr

Definition at line 358 of file Vec.hpp.

◆ operator[]() [2/3]

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
decltype(auto) alpaka::Vec< T_Type, T_dim, T_Storage >::operator[] ( std::integral auto const idx) const
inlineconstexpr

Definition at line 363 of file Vec.hpp.

◆ operator[]() [3/3]

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
template<typename T, T... T_values>
auto alpaka::Vec< T_Type, T_dim, T_Storage >::operator[] ( Vec< T, sizeof...(T_values), detail::CVec< T, T_values... > > const v) const
inlineconstexpr

swizzle operator

Definition at line 616 of file Vec.hpp.

◆ product()

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
type alpaka::Vec< T_Type, T_dim, T_Storage >::product ( ) const
inlineconstexpr

Returns product of all components.

Returns
product of components

Definition at line 519 of file Vec.hpp.

◆ rAssign()

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
template<uint32_t T_elementIdx = T_dim - 1u>
requires (T_elementIdx < T_dim)
Vec< T_Type, T_dim > alpaka::Vec< T_Type, T_dim, T_Storage >::rAssign ( T_Type const & value) const
inlineconstexpr

Assign an value to the given index position.

Template Parameters
T_elementIdxIndex of the element from the back which shall be replaced; range: [ 0; T_dim - 1 ]
Parameters
valuevalue to assign to the element at the given index position
Returns
copy of the vector with where the index positions are updated with value

Definition at line 488 of file Vec.hpp.

◆ reduce()

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
auto alpaka::Vec< T_Type, T_dim, T_Storage >::reduce ( auto && reduceFunc) const -> decltype(reduceFunc(std::declval< type >(), std::declval< type >()))
inlinenodiscardconstexpr

reduce all elements to a single value

For better numerical stability a tree reduce algorithm is used.

Template Parameters
BinaryOpbinary functor executed to reduce the range The binary operation must be associative.
Returns
the type of the result depends on the binary functor

Definition at line 648 of file Vec.hpp.

◆ ref() [1/2]

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
template<typename T, T... T_values>
auto alpaka::Vec< T_Type, T_dim, T_Storage >::ref ( Vec< T, sizeof...(T_values), detail::CVec< T, T_values... > > const v)
inlineconstexpr

Definition at line 623 of file Vec.hpp.

◆ ref() [2/2]

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
template<typename T, T... T_values>
auto alpaka::Vec< T_Type, T_dim, T_Storage >::ref ( Vec< T, sizeof...(T_values), detail::CVec< T, T_values... > > const v) const
inlineconstexpr

Definition at line 632 of file Vec.hpp.

◆ remove()

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
template<std::integral auto dimToRemove>
requires (T_dim >= 2u)
Vec< type, T_dim - 1u > alpaka::Vec< T_Type, T_dim, T_Storage >::remove ( ) const
inlineconstexpr

Removes a component.

It is not allowed to call this method on a vector with the dimensionality of one.

Template Parameters
dimToRemoveindex which shall be removed; range: [ 0; T_dim - 1 ]
Returns
vector with T_dim - 1 elements

Definition at line 503 of file Vec.hpp.

◆ revert()

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
Vec alpaka::Vec< T_Type, T_dim, T_Storage >::revert ( ) const
inlineconstexpr

Definition at line 296 of file Vec.hpp.

◆ rshrink() [1/2]

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
template<uint32_t T_numElements>
Vec< T_Type, T_numElements > alpaka::Vec< T_Type, T_dim, T_Storage >::rshrink ( ) const
inlineconstexpr

Shrink the number of elements of a vector.

Highest indices kept alive.

Template Parameters
T_numElementsNew dimension of the vector.
Returns
First T_numElements elements of the origin vector

Definition at line 410 of file Vec.hpp.

◆ rshrink() [2/2]

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
template<uint32_t T_numElements>
Vec< type, T_numElements > alpaka::Vec< T_Type, T_dim, T_Storage >::rshrink ( std::integral auto const startIdx) const
inlineconstexpr

Shrink the number of elements of a vector.

Template Parameters
T_numElementsNew dimension of the vector.
Parameters
startIdxIndex within the origin vector which will be the last element in the result.
Returns
T_numElements elements of the origin vector starting with the index startIdx. Indexing will wrapp around when the begin of the origin vector is reached.

Definition at line 442 of file Vec.hpp.

◆ sum()

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
type alpaka::Vec< T_Type, T_dim, T_Storage >::sum ( ) const
inlineconstexpr

Returns sum of all components.

Returns
sum of components

Definition at line 531 of file Vec.hpp.

◆ toRT()

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
Vec alpaka::Vec< T_Type, T_dim, T_Storage >::toRT ( ) const
inlineconstexpr

Definition at line 290 of file Vec.hpp.

◆ toString()

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
std::string alpaka::Vec< T_Type, T_dim, T_Storage >::toString ( std::string const separator = ",",
std::string const enclosings = "{}" ) const
inline

create string out of the vector

Parameters
separatorstring to separate components of the vector
enclosingsstring with dim 2 to enclose vector dim == 0 ? no enclose symbols dim == 1 ? means enclose symbol begin and end are equal dim >= 2 ? letter[0] = begin enclose symbol letter[1] = end enclose symbol

example: .toString(";","|") -> |x;...;z| .toString(",","[]") -> [x,...,z]

Definition at line 592 of file Vec.hpp.

◆ w() [1/2]

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
decltype(auto) alpaka::Vec< T_Type, T_dim, T_Storage >::w ( )
inlineconstexpr

named member access

index -> name [0->w, 1->z, 2->y, 3->x]

Definition at line 387 of file Vec.hpp.

◆ w() [2/2]

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
decltype(auto) alpaka::Vec< T_Type, T_dim, T_Storage >::w ( ) const
inlineconstexpr

named member access

index -> name [0->w, 1->z, 2->y, 3->x]

Definition at line 387 of file Vec.hpp.

◆ x() [1/2]

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
decltype(auto) alpaka::Vec< T_Type, T_dim, T_Storage >::x ( )
inlineconstexpr

named member access

index -> name [0->w, 1->z, 2->y, 3->x]

Definition at line 384 of file Vec.hpp.

◆ x() [2/2]

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
decltype(auto) alpaka::Vec< T_Type, T_dim, T_Storage >::x ( ) const
inlineconstexpr

named member access

index -> name [0->w, 1->z, 2->y, 3->x]

Definition at line 384 of file Vec.hpp.

◆ y() [1/2]

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
decltype(auto) alpaka::Vec< T_Type, T_dim, T_Storage >::y ( )
inlineconstexpr

named member access

index -> name [0->w, 1->z, 2->y, 3->x]

Definition at line 385 of file Vec.hpp.

◆ y() [2/2]

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
decltype(auto) alpaka::Vec< T_Type, T_dim, T_Storage >::y ( ) const
inlineconstexpr

named member access

index -> name [0->w, 1->z, 2->y, 3->x]

Definition at line 385 of file Vec.hpp.

◆ z() [1/2]

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
decltype(auto) alpaka::Vec< T_Type, T_dim, T_Storage >::z ( )
inlineconstexpr

named member access

index -> name [0->w, 1->z, 2->y, 3->x]

Definition at line 386 of file Vec.hpp.

◆ z() [2/2]

template<typename T_Type, uint32_t T_dim, typename T_Storage = alpaka::ArrayStorage<T_Type, T_dim>>
decltype(auto) alpaka::Vec< T_Type, T_dim, T_Storage >::z ( ) const
inlineconstexpr

named member access

index -> name [0->w, 1->z, 2->y, 3->x]

Definition at line 386 of file Vec.hpp.


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