Template Class Transpose#

Class Documentation#

template<typename TransposeType>
class Transpose#

Public Types

using ArrayType = TransposeType#
using BaseType = typename std::decay_t<TransposeType>#
using Scalar = typename typetraits::TypeInfo<BaseType>::Scalar#
using ShapeType = typename BaseType::ShapeType#
using Backend = typename typetraits::TypeInfo<BaseType>::Backend#

Public Functions

Transpose() = delete#

Default constructor should never be used.

Transpose(TransposeType &&array, const ShapeType &axes, Scalar alpha = Scalar(1.0))#

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) noexcept = default#

Move constructor.

auto operator=(const Transpose &other) -> Transpose& = default#

Assign another Transpose object to this one

Parameters

other – The Transpose to assign

Returns

*this;

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

Access sub-array of this Transpose object

Parameters

index – Array index

Returns

GeneralArrayView<T>

ShapeType shape() const#

Get the shape of this Transpose object

Returns

Shape

auto size() const -> size_t#
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

const ShapeType &axes() const#

Return the axes of the Transpose object.

Returns

ShapeType containing the axes

const Scalar &alpha() const#

Return the alpha value of the Transpose object.

Returns

Alpha scaling factor

const ArrayType &array() const#

Return the untransposed array object.

Returns

Array object

ArrayType &array()#
template<typename ShapeType_, typename StorageType_>
void applyTo(ArrayContainer<ShapeType_, StorageType_> &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

template<typename T, typename Char, typename Ctx>
void str(const fmt::formatter<T, Char> &format, char bracket, char separator, Ctx &ctx) const#

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<Backend, backend::CPU>#
static constexpr bool isOpenCL = std::is_same_v<Backend, backend::OpenCL>#
static constexpr bool isCUDA = std::is_same_v<Backend, backend::CUDA>#