MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
Loading...
Searching...
No Matches
slice.hpp File Reference
#include <algorithm>
#include <array>
#include <cstddef>
#include <stdexcept>
#include <string>
#include <tuple>
#include <type_traits>
#include <mtl/array/ndarray.hpp>
#include <mtl/detail/exceptions.hpp>

Classes

struct  mtl::array::all_t
 Select all elements along a dimension. More...
struct  mtl::array::range
 Select a contiguous range [start, stop) with optional step. More...
struct  mtl::array::detail_slice::is_index_arg< T >
struct  mtl::array::detail_slice::is_index_arg< all_t >
struct  mtl::array::detail_slice::is_index_arg< range >

Namespaces

namespace  mtl
namespace  mtl::array
namespace  mtl::array::detail_slice

Concepts

concept  mtl::array::detail_slice::SliceIndex

Functions

template<typename... Args>
constexpr std::size_t mtl::array::detail_slice::count_kept_dims ()
template<std::size_t M, std::size_t N, typename... Args>
void mtl::array::detail_slice::slice_layout (const shape< N > &ext, const std::array< std::size_t, N > &strides, shape< M > &new_shape, std::array< std::size_t, M > &new_strides, std::size_t &base_offset, Args... args)
 The shape, strides and base offset of a slice of an array with the given extents and strides.
template<typename Value, std::size_t N, typename Order, typename... Args>
requires (sizeof...(Args) == N)
auto mtl::array::slice (ndarray< Value, N, Order > &arr, Args... args)
 Slice an ndarray, returning a view with potentially reduced rank.
template<typename Value, std::size_t N, typename Order, typename... Args>
requires (sizeof...(Args) == N)
auto mtl::array::slice (const ndarray< Value, N, Order > &arr, Args... args)
 Const overload: returns a view over const data.

Variables

constexpr all_t mtl::array::all {}