Template Class Transpose#

Class Documentation#

template<typename T>
class Transpose#

Public Types

using ArrayType = T#
using BaseType = typename std::decay_t<T>#
using Scalar = typename typetraits::TypeInfo<BaseType>::Scalar#
using Reference = BaseType&#
using ConstReference = const BaseType&#
using ShapeType = typename BaseType::ShapeType#
using Device = typename typetraits::TypeInfo<BaseType>::Device#

Public Functions

Transpose() = delete#

Default constructor should never be used.

explicit Transpose(T &array, const ShapeType &axes)#

Create a Transpose object from an array/operation

Parameters
  • array – The array to copy

  • axes – The transposition axes

Transpose(const Transpose &other) = default#

Copy a Transpose object.

Transpose(Transpose &&other) = default#

Move constructor.

Transpose &operator=(const Transpose &other) = default#

Assign another Transpose object to this one

Parameters

other – The Transpose to assign

Returns

*this;

ArrayView<ArrayType> operator[](int64_t index) const#

Access sub-array of this Transpose object

Parameters

index – Array index

Returns

ArrayView<T>

ShapeType shape() const#

Get the shape of this Transpose object

Returns

Shape

int64_t ndim() const#

Return the number of dimensions of the Transpose object

Returns

Number of dimensions

auto scalar(int64_t index) const#

Access a scalar at a given index in the object. The index will be converted into a multi-dimensional index using the shape of the object, and counts in row-major order

Parameters

index – Index of the scalar

Returns

Scalar type at the given index

template<typename Container>
void applyTo(Container &out) const#
auto eval() const#

Evaluate the Transpose object and return the result. Depending on your use case, calling this function mid-expression might result in better performance, but you should always test the available options before making a decision.

Returns

Evaluated expression

std::string str(const std::string &format = "{}") const#

Return a string representation of the Transpose object, formatting each scalar with the given format string

Parameters

format – Format string

Returns

Stringified object

Public Static Attributes

static constexpr bool allowVectorisation = typetraits::TypeInfo<Scalar>::allowVectorisation#
static constexpr bool isArray = typetraits::IsArrayContainer<BaseType>::value#
static constexpr bool isHost = std::is_same_v<Device, device::CPU>#