xtensor
Loading...
Searching...
No Matches
Support functions to get/check a shape array.

Classes

struct  xt::select_layout< L, S >
 Compute a layout based on a layout and a shape type. More...
 

Typedefs

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

Functions

template<class S1 , class S2 >
bool xt::same_shape (const S1 &s1, const S2 &s2) noexcept
 Check if two objects have the same shape.
 
template<class E , class S >
bool xt::has_shape (const E &e, std::initializer_list< S > shape) noexcept
 Check if an object has a certain shape.
 

Detailed Description

Typedef Documentation

◆ filter_fixed_shape_t

template<class S >
using xt::filter_fixed_shape_t = typename filter_fixed_shape<S>::type

Definition at line 575 of file xshape.hpp.

◆ index_from_shape_t

template<class S >
using xt::index_from_shape_t = typename index_from_shape<S>::type

Definition at line 545 of file xshape.hpp.

◆ promote_shape_t

template<class... S>
using xt::promote_shape_t = typename promote_shape<S...>::type

Definition at line 521 of file xshape.hpp.

◆ promote_strides_t

template<class... S>
using xt::promote_strides_t = typename promote_strides<S...>::type

Definition at line 533 of file xshape.hpp.

Function Documentation

◆ has_shape()

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

Check if an object has a certain shape.

Parameters
aan array
shapethe shape to test
Returns
bool

Definition at line 130 of file xshape.hpp.

◆ same_shape()

template<class S1 , class S2 >
bool xt::same_shape ( const S1 & s1,
const S2 & s2 )
inlinenoexcept

Check if two objects have the same shape.

Parameters
s1an array
s2an array
Returns
bool

Definition at line 112 of file xshape.hpp.