Shortcuts

Struct BlockExtractor

Struct Documentation

struct ripple::BlockExtractor

This struct extracts the blocks from a tensor.

Public Types

template<typename T>
using NotModifierOrSharedOrTensorEnable = std::enable_if_t<!is_modifier_v<T> && !is_shared_wrapper_v<T> && !is_tensor_v<T>, int>

Defines a valid enable if not a modifier, shared wrapper, or tensor.

Template Parameters
  • T: The type to base the enable on.

Public Static Functions

template<typename T, NotModifierOrSharedOrTensorEnable<T> = 0>
auto extract_blocks_if_tensor(T &&t) noexcept -> T&&

Extracts the blocks from a tensor.

Note

This overload is for non tensor types and simply forward the given type.

Return

An rvalue rerence to the object.

Parameters
  • t: The object to extract the blocks from.

Template Parameters
  • T: The type of the object.

template<typename T, tensor_enable_t<T> = 0>
auto extract_blocks_if_tensor(T &t) noexcept -> std::remove_reference_t<decltype(t.blocks_)>&

Extracts the blocks from a tensor.

Note

This overload is for tensor types and returns a reference to the blocks which define the tensor.

Return

An reference to the tensor blocks.

Parameters
  • t: The tensor object to extract the blocks from.

Template Parameters
  • T: The type of the tensor object.

template<typename T, Modifier M, tensor_enable_t<T> = 0>
auto extract_blocks_if_tensor(const ModificationSpecifier<T, M> &specifier) noexcept

Extracts the blocks from a tensor.

Note

This overload is for tensor types wrapped in a modification specifier and returns a reference to blocks, rewrapped in the specifier.

Return

A new modification specifier which references the tensor blocks.

Parameters
  • specifier: The modification specifier to extract the blocks from.

Template Parameters
  • T: The type of the tensor object. \tparmam M The type of the modification.

template<typename T, tensor_enable_t<T> = 0>
auto extract_blocks_if_tensor(const SharedWrapper<T> &wrapper) noexcept

Extracts the blocks from a tensor.

Note

This overload is for tensor types wrapped in a shared wrapper and returns a reference to blocks, rewrapped in the wrapper. specifier.

Return

A new shared wrapper which references the tensor blocks.

Parameters
  • wrapper: The shared wrapper to extract the blocks from.

Template Parameters
  • T: The type of the tensor object.

template<typename T, tensor_enable_t<T> = 0>
auto extract_blocks_if_tensor(const ExpansionWrapper<T> &wrapper) noexcept

Extracts the blocks from a tensor.

Note

This overload is for tensor types wrapped in a shared wrapper and returns a reference to blocks, rewrapped in the wrapper. specifier.

Return

A new shared wrapper which references the tensor blocks.

Parameters
  • wrapper: The shared wrapper to extract the blocks from.

Template Parameters
  • T: The type of the tensor object.

Docs

Access comprehensive developer documentation for Ripple

View Docs

Tutorials

Get tutorials to help with understand all features

View Tutorials

Examples

Find examples to help get started

View Examples