xshape

Defined in xtensor/xshape.hpp

group xt_xshape

Typedefs

template<class ...S>
using promote_shape_t = typename promote_shape<S...>::type
template<class ...S>
using promote_strides_t = typename promote_strides<S...>::type
template<class S>
using index_from_shape_t = typename index_from_shape<S>::type
template<class S>
using filter_fixed_shape_t = typename filter_fixed_shape<S>::type

Functions

template<class S1, class S2>
inline bool same_shape(const S1 &s1, const S2 &s2) noexcept

Check if two objects have the same shape.

Parameters:
  • s1 – an array

  • s2 – an array

Returns:

bool

template<class E, class S>
inline bool has_shape(const E &e, std::initializer_list<S> shape) noexcept

Check if an object has a certain shape.

Parameters:
  • a – an array

  • shape – the shape to test

Returns:

bool

template<layout_type L, class S>
struct select_layout
#include <xshape.hpp>

Compute a layout based on a layout and a shape type.

The main functionality of this function is that it reduces vectors to xt::layout_type::any so that assigning a row major 1D container to another row_major container becomes free.