Template Class Function#

Class Documentation#

template<typename desc, typename Functor_, typename ...Args>
class Function#

Public Types

using Type = Function<desc, Functor_, Args...>#
using Functor = Functor_#
using ShapeType = typename typetraits::TypeInfo<Type>::ShapeType#
using StrideType = ShapeType#
using Scalar = typename typetraits::TypeInfo<Type>::Scalar#
using Backend = typename typetraits::TypeInfo<Type>::Backend#
using Packet = typename typetraits::TypeInfo<Scalar>::Packet#
using Iterator = detail::ArrayIterator<Function>#
using Descriptor = desc#

Public Functions

Function() = default#
explicit Function(Functor &&functor, Args&&... args)#

Constructs a Function from a functor and arguments.

Parameters
  • functor – The functor to use.

  • args – The arguments to use.

Function(const Function &other) = default#

Constructs a Function from another function.

Parameters

other – The Function to copy.

Function(Function &&other) noexcept = default#

Construct a Function from a temporary function.

Parameters

other – The Function to move.

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

Assigns a Function to this function.

Parameters

other – The Function to copy.

Returns

A reference to this Function.

Function &operator=(Function &&other) noexcept = default#

Assigns a temporary Function to this Function.

Parameters

other – The Function to move.

Returns

A reference to this Function.

auto size() const -> size_t#
auto ndim() const -> size_t#
auto shape() const -> const ShapeType&#

Return the shape of the Function’s result

Returns

The shape of the Function’s result

auto &args() const#

Return the arguments in the Function

Returns

The arguments in the Function

auto eval() const#

Return an evaluated Array object

Returns

auto operator[](int64_t index) const#
Packet packet(size_t index) const#

Evaluates the function at the given index, returning a Packet result.

Parameters

index – The index to evaluate at.

Returns

The result of the function (vectorized).

Scalar scalar(size_t index) const#

Evaluates the function at the given index, returning a Scalar result.

Parameters

index – The index to evaluate at.

Returns

The result of the function (scalar).

Iterator begin() const#
Iterator end() const#
template<typename T, typename Char, typename Ctx>
void str(const fmt::formatter<T, Char> &format, char bracket, char separator, Ctx &ctx) const#
template<size_t... I>
auto packetImpl(std::index_sequence<I...>, size_t index) const -> Packet#
template<size_t... I>
auto scalarImpl(std::index_sequence<I...>, size_t index) const -> Scalar#

Public Static Attributes

static constexpr bool argsAreSameType = !std::is_same_v<decltype(scalarTypesAreSame<Args...>()), std::false_type>#