xtensor
Loading...
Searching...
No Matches
xt Namespace Reference

standard mathematical functions for xexpressions More...

Classes

struct  acquire_ownership
 
class  aligned_array
 This array class is modeled after std::array but adds optional alignment through a template parameter. More...
 
struct  apply_cv
 
struct  big_promote_value_type
 
class  broadcast_error
 
struct  buffer_inner_types
 
struct  buffer_inner_types< xbuffer_adaptor< CP, O, A > >
 
struct  buffer_inner_types< xiterator_adaptor< I, CI > >
 
struct  buffer_inner_types< xiterator_owner_adaptor< C, IG > >
 
struct  can_assign
 
struct  can_assign< xstrided_view< CT, S, L, FST >, RHS >
 
struct  check_strides_overlap
 
struct  check_strides_overlap< layout_type::column_major >
 
struct  check_strides_overlap< layout_type::row_major >
 
struct  common_difference_type
 
struct  common_difference_type<>
 
struct  common_size_type
 
struct  common_size_type<>
 
struct  common_tensor_type
 
struct  common_value_type
 
class  concatenate_error
 
struct  conditional_cast_functor
 
struct  conditional_cast_functor< false, T >
 
struct  conditional_cast_functor< true, T >
 
struct  const_array
 A std::array like class with all member function (except reverse iterators) as constexpr. More...
 
struct  const_value
 
struct  const_xclosure
 
struct  const_xclosure< E, disable_xexpression< std::decay_t< E > > >
 
struct  const_xclosure< xshared_expression< E > &, std::enable_if_t< true > >
 
struct  container_simd_return_type
 
struct  decay_all
 
struct  decay_all< S< X... > >
 
struct  disable_indexed_stepper
 
struct  driven_align_mode
 
struct  enable_indexed_stepper
 
struct  filter_fixed_shape
 
class  fixed_shape
 Fixed shape implementation for compile time defined arrays. More...
 
struct  fixed_xreducer_shape_type
 
struct  fixed_xreducer_shape_type< fixed_shape< I... >, fixed_shape< J... > >
 
struct  forbid_simd
 
struct  forbid_simd< const std::vector< bool, A > >
 
struct  forbid_simd< const xtl::xdynamic_bitset< B, A > >
 
struct  forbid_simd< std::vector< bool, A > >
 
struct  forbid_simd< xtl::xdynamic_bitset< B, A > >
 
struct  get_init_type
 
struct  get_init_type< V, fixed_shape< X... > >
 
struct  get_rank
 
struct  get_rank< E, decltype((void) E::rank, void())>
 
struct  get_strides_type
 
struct  get_strides_type< fixed_shape< I... > >
 
struct  get_strides_type< xbuffer_adaptor< CP, O, A > >
 
struct  get_value_type
 
struct  get_value_type< T, void_t< typename T::value_type > >
 
struct  has_assign_conversion
 
struct  has_assign_to
 
struct  has_assign_to< E1, E2, void_t< decltype(std::declval< const E2 & >().assign_to(std::declval< E1 & >()))> >
 
struct  has_data_interface
 
struct  has_data_interface< E, void_t< decltype(std::declval< E >().data())> >
 
struct  has_fixed_rank
 
struct  has_iterator_interface
 
struct  has_iterator_interface< E, void_t< decltype(std::declval< E >().begin())> >
 
struct  has_memory_address
 
struct  has_memory_address< T, void_t< decltype(std::addressof(*std::declval< T >().begin()))> >
 
struct  has_rank
 
struct  has_sign_conversion
 
struct  has_simd_apply
 
struct  has_simd_interface
 
struct  has_simd_interface< xfunction< F, CT... >, T >
 
struct  has_simd_interface< xfunctor_adaptor< F, CT >, T >
 
struct  has_simd_interface< xfunctor_applier_base< D >, T >
 
struct  has_simd_interface< xfunctor_view< F, CT >, T >
 
struct  has_simd_interface< xtensor_view< EC, N, L, Tag > >
 
struct  has_simd_type
 
struct  has_storage_type
 
struct  has_storage_type< T, void_t< typename xcontainer_inner_types< T >::storage_type > >
 
struct  has_strides
 
struct  has_strides< E, void_t< decltype(std::declval< E >().strides())> >
 
struct  index_from_shape
 
struct  initializer_dimension
 
struct  inner_aligned_mode
 
struct  inner_reference
 
struct  invalid_type
 
struct  is_chunked_t
 
struct  is_contiguous_container
 
struct  is_contiguous_container< xiterator< St, S, L > >
 
struct  is_contiguous_container< xiterator_adaptor< I, CI > >
 
struct  is_contiguous_container< xiterator_owner_adaptor< C, IG > >
 
struct  is_evaluation_strategy
 
struct  is_indexed_stepper
 
struct  is_indexed_stepper< xindexed_stepper< T, B > >
 
struct  is_iterator
 
struct  is_iterator< E, void_t< decltype(*std::declval< const E >(), std::declval< const E >()==std::declval< const E >(), std::declval< const E >() !=std::declval< const E >(),++(*std::declval< E * >()),(*std::declval< E * >())++, std::true_type())> >
 
struct  is_narrowing_conversion
 
struct  is_not_xdummy_iterator
 
struct  is_not_xdummy_iterator< xdummy_iterator< is_const, CT > >
 
struct  is_reducer_options
 
struct  is_reducer_options_impl
 
struct  is_reducer_options_impl< std::tuple< X... > >
 
struct  is_specialization_of
 
struct  is_specialization_of< TT, TT< Ts... > >
 
struct  is_xoptional_expression
 
struct  is_xtensor_expression
 
struct  keep_dims_type
 
class  linear_assigner
 
class  linear_assigner< false >
 
struct  make_invalid_type
 
struct  make_void
 
struct  memory_range
 
struct  meta_identity
 
struct  missing_type
 
struct  nested_initializer_list
 
struct  nested_initializer_list< T, 0 >
 
struct  no_ownership
 
class  noalias_proxy
 
struct  norm_type
 Traits class for the result type of the norm_l2() function. More...
 
struct  numeric_constants
 
struct  overlapping_memory_checker
 
struct  overlapping_memory_checker< Dst, std::enable_if_t< has_memory_address< Dst >::value > >
 
struct  overlapping_memory_checker_base
 
struct  overlapping_memory_checker_traits
 
struct  overlapping_memory_checker_traits< E, std::enable_if_t< has_memory_address< E >::value > >
 
struct  overlapping_memory_checker_traits< E, std::enable_if_t<!has_memory_address< E >::value &&is_crtp_base_of< xview_semantic, E >::value > >
 
struct  overlapping_memory_checker_traits< E, std::enable_if_t<!has_memory_address< E >::value &&is_specialization_of< xbroadcast, E >::value > >
 
struct  overlapping_memory_checker_traits< E, std::enable_if_t<!has_memory_address< E >::value &&is_specialization_of< xfunction, E >::value > >
 
struct  overlapping_memory_checker_traits< E, std::enable_if_t<!has_memory_address< E >::value &&is_specialization_of< xgenerator, E >::value > >
 
struct  promote_shape
 
struct  promote_strides
 
struct  rebind_container
 
struct  rebind_container< X, C< T, A > >
 
struct  rebind_container< X, C< T, N > >
 
struct  rebind_container< X, svector< T, N, A, B > >
 
struct  reducer_options
 
struct  remove_class
 
struct  remove_class< R(C::*)(Args...) const >
 
struct  remove_class< R(C::*)(Args...)>
 
struct  select_dim_mapping_type
 
struct  select_dim_mapping_type< fixed_shape< I... > >
 
struct  select_iterable_base
 
struct  select_layout
 Compute a layout based on a layout and a shape type. More...
 
class  sequence_view
 
struct  squared_norm_type
 Traits class for the result type of the norm_sq() function. More...
 
struct  static_dimension
 
struct  static_string
 
class  stepper_assigner
 
struct  stepper_tools
 
class  strided_loop_assigner
 
class  svector
 
struct  temporary_container
 
struct  temporary_container< xbuffer_adaptor< CP, O, A > >
 
struct  temporary_container< xiterator_adaptor< I, CI > >
 
struct  temporary_container< xiterator_owner_adaptor< C, IG > >
 
struct  temporary_type
 
struct  temporary_type< T, void_t< typename std::decay_t< T >::temporary_type > >
 
struct  temporary_type_from_tag
 
struct  temporary_type_from_tag< xtensor_expression_tag, T >
 
struct  tracking_allocator
 
class  transpose_error
 
struct  tuple_idx_of
 
struct  tuple_idx_of_impl
 
struct  tuple_idx_of_impl< I, T, std::tuple< T, Types... > >
 
struct  tuple_idx_of_impl< I, T, std::tuple< U, Types... > >
 
struct  tuple_idx_of_impl< I, T, std::tuple<> >
 
class  uvector
 
struct  view_temporary_type
 
class  xaccessible
 Base class for implementation of common expression access methods. More...
 
struct  xaccumulator_functor
 
class  xall
 
struct  xall_tag
 
class  xarray_adaptor
 Dense multidimensional container adaptor with tensor semantic. More...
 
class  xarray_container
 Dense multidimensional container with tensor semantic. More...
 
class  xassign_traits
 
class  xaxis_iterator
 Class for iteration over (N-1)-dimensional slices, where N is the dimension of the underlying expression. More...
 
class  xaxis_slice_iterator
 Class for iteration over one-dimensional slices. More...
 
class  xblockwise_reducer
 
class  xbounded_iterator
 
class  xbroadcast
 Broadcasted xexpression to a specified shape. More...
 
class  xbuffer_adaptor
 
class  xbuffer_adaptor_base
 
class  xchunk_iterator
 
class  xchunked_array
 
class  xchunked_assigner
 
class  xchunked_semantic
 
class  xchunked_view
 
struct  xclosure
 
struct  xclosure< E, disable_xexpression< std::decay_t< E > > >
 
struct  xclosure< xshared_expression< E >, std::enable_if_t< true > >
 
class  xconst_accessible
 Base class for implementation of common expression constant access methods. More...
 
class  xconst_iterable
 Base class for multidimensional iterable constant expressions. More...
 
class  xcontainer
 Base class for dense multidimensional containers. More...
 
struct  xcontainer_inner_types
 
struct  xcontainer_inner_types< xarray_adaptor< EC, L, SC, Tag > >
 
struct  xcontainer_inner_types< xarray_container< EC, L, SC, Tag > >
 
struct  xcontainer_inner_types< xbroadcast< CT, X > >
 
struct  xcontainer_inner_types< xchunked_array< chunk_storage > >
 
struct  xcontainer_inner_types< xdynamic_view< CT, S, L, FST > >
 
struct  xcontainer_inner_types< xfixed_adaptor< EC, S, L, SH, Tag > >
 
struct  xcontainer_inner_types< xfixed_container< ET, S, L, SH, Tag > >
 
struct  xcontainer_inner_types< xfunction< F, CT... > >
 
struct  xcontainer_inner_types< xfunctor_adaptor< F, CT > >
 
struct  xcontainer_inner_types< xfunctor_view< F, CT > >
 
struct  xcontainer_inner_types< xgenerator< C, R, S > >
 
struct  xcontainer_inner_types< xindex_view< CT, I > >
 
struct  xcontainer_inner_types< xmasked_view< CTD, CTM > >
 
struct  xcontainer_inner_types< xoptional_assembly< VE, FE > >
 
struct  xcontainer_inner_types< xoptional_assembly_adaptor< VEC, FEC > >
 
struct  xcontainer_inner_types< xreducer< F, CT, X, O > >
 
struct  xcontainer_inner_types< xrepeat< CT, R > >
 
struct  xcontainer_inner_types< xscalar< CT > >
 
struct  xcontainer_inner_types< xstrided_view< CT, S, L, FST > >
 
struct  xcontainer_inner_types< xtensor_adaptor< EC, N, L, Tag > >
 
struct  xcontainer_inner_types< xtensor_container< EC, N, L, Tag > >
 
struct  xcontainer_inner_types< xtensor_view< EC, N, L, Tag > >
 
struct  xcontainer_inner_types< xview< CT, S... > >
 
struct  xcontainer_iterable_types
 
class  xcontainer_semantic
 Implementation of the xsemantic_base interface for dense multidimensional containers. More...
 
class  xcontiguous_iterable
 Base class for multidimensional iterable expressions with contiguous storage. More...
 
struct  xcsv_config
 
class  xdrop_slice
 
class  xdummy_iterator
 
class  xdynamic_view
 
struct  xellipsis_tag
 
class  xexpression
 Base class for xexpressions. More...
 
class  xexpression_assigner
 
class  xexpression_assigner_base
 
class  xexpression_assigner_base< xoptional_expression_tag >
 
class  xexpression_assigner_base< xtensor_expression_tag >
 
class  xexpression_holder
 
struct  xexpression_tag
 
class  xfiltration
 Filter of a xexpression for fast scalar assign. More...
 
class  xfixed_adaptor
 Dense multidimensional container adaptor with tensor semantic and fixed dimension. More...
 
class  xfixed_container
 Dense multidimensional container with tensor semantic and fixed dimension. More...
 
class  xfunction
 Multidimensional function operating on xtensor expressions. More...
 
struct  xfunction_cache
 
class  xfunction_iterator
 
class  xfunction_stepper
 
class  xfunctor_adaptor
 Adapt a container with a functor, forwarding methods such as resize / reshape. More...
 
class  xfunctor_applier_base
 
class  xfunctor_iterator
 
class  xfunctor_stepper
 
class  xfunctor_view
 View of an xexpression . More...
 
struct  xfunctor_view_temporary_type
 
class  xgenerator
 Multidimensional function operating on indices. More...
 
class  xindex_view
 View of an xexpression from vector of indices. More...
 
class  xindexed_stepper
 
struct  xinitial
 
class  xiterable
 Base class for multidimensional iterable expressions. More...
 
struct  xiterable_inner_types
 
struct  xiterable_inner_types< xarray_adaptor< EC, L, SC, Tag > >
 
struct  xiterable_inner_types< xarray_container< EC, L, SC, Tag > >
 
struct  xiterable_inner_types< xbroadcast< CT, X > >
 
struct  xiterable_inner_types< xchunked_array< chunk_storage > >
 
struct  xiterable_inner_types< xdynamic_view< CT, S, L, FST > >
 
struct  xiterable_inner_types< xfixed_adaptor< EC, S, L, SH, Tag > >
 
struct  xiterable_inner_types< xfixed_container< ET, S, L, SH, Tag > >
 
struct  xiterable_inner_types< xfunction< F, CT... > >
 
struct  xiterable_inner_types< xgenerator< C, R, S > >
 
struct  xiterable_inner_types< xindex_view< CT, I > >
 
struct  xiterable_inner_types< xmasked_view< CTD, CTM > >
 
struct  xiterable_inner_types< xoptional_assembly< VE, FE > >
 
struct  xiterable_inner_types< xoptional_assembly_adaptor< VEC, FEC > >
 
struct  xiterable_inner_types< xreducer< F, CT, X, O > >
 
struct  xiterable_inner_types< xrepeat< CT, R > >
 
struct  xiterable_inner_types< xscalar< CT > >
 
struct  xiterable_inner_types< xstrided_view< CT, S, L, FST > >
 
struct  xiterable_inner_types< xtensor_adaptor< EC, N, L, Tag > >
 
struct  xiterable_inner_types< xtensor_container< EC, N, L, Tag > >
 
struct  xiterable_inner_types< xtensor_view< EC, N, L, Tag > >
 
struct  xiterable_inner_types< xview< CT, S... > >
 
class  xiterator
 
class  xiterator_adaptor
 
class  xiterator_owner_adaptor
 
class  xkeep_slice
 
class  xmasked_value
 
class  xmasked_view
 View on an xoptional_assembly or xoptional_assembly_adaptor hiding values depending on a given mask. More...
 
class  xmasked_view_stepper
 
class  xmultiindex_iterator
 
class  xnewaxis
 
struct  xnewaxis_tag
 
class  xoptional_assembly
 Dense multidimensional container holding optional values, optimized for tensor operations. More...
 
class  xoptional_assembly_adaptor
 Dense multidimensional adaptor holding optional values, optimized for tensor operations. More...
 
class  xoptional_assembly_base
 Base class for dense multidimensional optional assemblies. More...
 
class  xoptional_assembly_linear_iterator
 
struct  xoptional_assembly_linear_iterator_traits
 
class  xoptional_assembly_stepper
 
class  xoptional_assembly_storage
 
struct  xoptional_comparable
 
struct  xoptional_expression_tag
 
struct  xproxy_inner_types
 
class  xrange
 
struct  xrange_adaptor
 
class  xreducer
 Reducing function operating over specified axes. More...
 
struct  xreducer_functors
 
struct  xreducer_shape_type
 
struct  xreducer_shape_type< fixed_shape< I... >, fixed_shape< J... >, O >
 
struct  xreducer_shape_type< fixed_shape< I... >, std::array< I2, N2 >, std::false_type >
 
struct  xreducer_shape_type< fixed_shape< I... >, std::array< I2, N2 >, std::true_type >
 
struct  xreducer_shape_type< std::array< I1, N1 >, std::array< I2, N2 >, std::false_type >
 
struct  xreducer_shape_type< std::array< I1, N1 >, std::array< I2, N2 >, std::true_type >
 
class  xreducer_stepper
 
class  xrepeat
 Expression with repeated values along an axis. More...
 
class  xrepeat_stepper
 
class  xscalar
 
class  xscalar_stepper
 
class  xsemantic_base
 Base interface for assignable xexpressions. More...
 
class  xsharable_expression
 
class  xshared_expression
 Shared xexpressions. More...
 
class  xslice
 
class  xstepped_range
 
class  xstepper
 
class  xstrided_container
 Partial implementation of xcontainer that embeds the strides and the shape. More...
 
class  xstrided_view
 View of an xexpression using strides. More...
 
class  xstrided_view_base
 
class  xtensor_adaptor
 Dense multidimensional container adaptor with tensor semantics and fixed dimension. More...
 
class  xtensor_container
 Dense multidimensional container with tensor semantic and fixed dimension. More...
 
struct  xtensor_expression_tag
 
class  xtensor_view
 Dense multidimensional container adaptor with view semantics and fixed dimension. More...
 
class  xvectorizer
 
class  xview
 Multidimensional view with tensor semantic. More...
 
class  xview_semantic
 Implementation of the xsemantic_base interface for multidimensional views. More...
 
struct  xview_shape_type
 
struct  xview_shape_type< fixed_shape< I... >, S... >
 
struct  xview_shape_type< std::array< I, L >, S... >
 
class  xview_stepper
 

Typedefs

template<class T , std::size_t N, layout_type L = ::xt::layout_type::row_major>
using xtensor_pointer
 xtensor adaptor for a pointer.
 
template<class T , layout_type L = ::xt::layout_type::row_major, class SC = xt::svector<typename uvector< T , std::allocator<std::size_t> >::size_type, 4, std::allocator<std::size_t> , true>>
using xarray_pointer
 xarray adaptor for a pointer.
 
using smart_ownership = no_ownership
 
template<class C >
using temporary_container_t = typename temporary_container<C>::type
 
template<class T >
using allocator_type_t = typename detail::allocator_type_impl<T>::type
 
template<class T , class A = std::allocator<T>>
using xcsv_tensor = xtensor_container<std::vector<T, A>, 2, layout_type::row_major>
 
template<class T >
using xdynamic_slice
 
using xdynamic_slice_vector = std::vector<xdynamic_slice<std::ptrdiff_t>>
 
template<class E >
using xvalue_type = detail::xvalue_type_impl<E>
 
template<class E >
using xvalue_type_t = typename xvalue_type<E>::type
 
template<class... C>
using common_value_type_t = typename common_value_type<C...>::type
 
template<class... Args>
using common_size_type_t = typename common_size_type<Args...>::type
 
template<class... Args>
using common_difference_type_t = typename common_difference_type<Args...>::type
 
template<class T >
using temporary_type_t = typename temporary_type<T>::type
 
template<class... C>
using common_tensor_type_t = typename common_tensor_type<C...>::type
 
template<class E >
using big_promote_value_type_t = typename big_promote_value_type<E>::type
 
template<class V , class S >
using get_init_type_t = typename get_init_type<V, S>::type
 
template<class C >
using get_stepper_iterator = typename detail::get_stepper_iterator_impl<C>::type
 
template<class C >
using xindex_type_t = typename detail::index_type_impl<C>::type
 
template<class T , class R = T>
using enable_indexed_stepper_t = typename enable_indexed_stepper<T, R>::type
 
template<class T , class R = T>
using disable_indexed_stepper_t = typename disable_indexed_stepper<T, R>::type
 
template<class T >
using norm_type_t = typename norm_type<T>::type
 Abbreviation of 'typename norm_type<T>::type'.
 
template<class T >
using squared_norm_type_t = typename squared_norm_type<T>::type
 Abbreviation of 'typename squared_norm_type<T>::type'.
 
template<class CT , class M , std::size_t I>
using xoffset_view = xfunctor_view<detail::offset_forwarder<M, I>, CT>
 
template<class CT , class M , std::size_t I>
using xoffset_adaptor = xfunctor_adaptor<detail::offset_forwarder<M, I>, CT>
 
template<class E >
using is_xscalar = detail::is_xscalar_impl<E>
 
template<class... E>
using all_xscalar = detail::all_xscalar<E...>
 
template<class D >
using select_expression_base_t
 
template<class E >
using is_assignable = is_crtp_base_of<xsemantic_base, E>
 
template<class E , class R = void>
using enable_assignable = typename std::enable_if<is_assignable<E>::value, R>::type
 
template<class E , class R = void>
using disable_assignable = typename std::enable_if<!is_assignable<E>::value, R>::type
 
template<class E >
using has_container_semantics = is_crtp_base_of<xcontainer_semantic, E>
 
template<class E , class R = void>
using enable_xcontainer_semantics = typename std::enable_if<has_container_semantics<E>::value, R>::type
 
template<class E , class R = void>
using disable_xcontainer_semantics = typename std::enable_if<!has_container_semantics<E>::value, R>::type
 
template<class E >
using has_view_semantics = is_crtp_base_of<xview_semantic, E>
 
template<class E , class R = void>
using enable_xview_semantics = typename std::enable_if<has_view_semantics<E>::value, R>::type
 
template<class E , class R = void>
using disable_xview_semantics = typename std::enable_if<!has_view_semantics<E>::value, R>::type
 
template<class T >
using dynamic_shape = svector<T, 4>
 
template<class T , std::size_t N>
using static_shape = std::array<T, N>
 
using xindex = dynamic_shape<std::size_t>
 
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
 
template<class S >
using is_xslice = std::is_base_of<xslice<S>, S>
 
template<class E , class R = void>
using disable_xslice = typename std::enable_if<!is_xslice<E>::value, R>::type
 
template<class... E>
using has_xslice = xtl::disjunction<is_xslice<E>...>
 
template<class E , class SL >
using get_slice_type = typename detail::get_slice_type_impl<E, std::remove_reference_t<SL>>::type
 
template<layout_type L1, layout_type L2, class T >
using select_iterable_base_t = typename select_iterable_base<L1, L2, T>::type
 
template<class T >
using xstrided_slice
 
using xstrided_slice_vector = std::vector<xstrided_slice<std::ptrdiff_t>>
 vector of slices used to build a xstrided_view
 
template<class T , layout_type L = ::xt::layout_type::row_major, class A = std::allocator< T >, class SA = std::allocator<typename std::vector<T, A>::size_type>>
using xarray = xarray_container<uvector< T , A >, L, xt::svector<typename uvector< T , A >::size_type, 4, SA , true>>
 Alias template on xarray_container with default parameters for data container type and shape / strides container type.
 
template<class T , layout_type L = ::xt::layout_type::row_major, class A = std::allocator< T >, class BC = xtl::xdynamic_bitset<std::size_t>, class SA = std::allocator<typename std::vector<T, A>::size_type>>
using xarray_optional
 Alias template on xarray_container for handling missing values.
 
template<class T , std::size_t N, layout_type L = ::xt::layout_type::row_major, class A = std::allocator< T >>
using xtensor = xtensor_container<uvector< T , A >, N, L>
 Alias template on xtensor_container with default parameters for data container type.
 
template<std::size_t... N>
using xshape = fixed_shape<N...>
 Alias template for fixed_shape allows for a shorter template shape definition in xtensor_fixed.
 
template<class T , class FSH , layout_type L = ::xt::layout_type::row_major, bool Sharable = true>
using xtensor_fixed = xfixed_container<T, FSH, L, Sharable>
 Alias template on xfixed_container with default parameters for layout type.
 
template<class T , std::size_t N, layout_type L = ::xt::layout_type::row_major, class A = std::allocator< T >, class BC = xtl::xdynamic_bitset<std::size_t>>
using xtensor_optional = xtensor_container<xtl::xoptional_vector<T, A, BC>, N, L, xoptional_expression_tag>
 Alias template on xtensor_container for handling missing values.
 
template<class A1 , class A2 >
using driven_align_mode_t = typename detail::driven_align_mode_impl<A1, A2>::type
 
template<class T >
using bool_load_type = std::conditional_t<std::is_same<T, bool>::value, uint8_t, T>
 
template<class C , class T1 , class T2 >
using container_simd_return_type_t = typename container_simd_return_type<C, T1, T2>::type
 
template<class X , class C >
using rebind_container_t = typename rebind_container<X, C>::type
 
template<class... T>
using void_t = typename make_void<T...>::type
 
template<class T , class R >
using disable_integral_t = std::enable_if_t<!xtl::is_integral<T>::value, R>
 
template<class T >
using remove_class_t = typename remove_class<T>::type
 
template<class T , std::size_t I>
using nested_initializer_list_t = typename nested_initializer_list<T, I>::type
 
template<class T >
using get_value_type_t = typename get_value_type<T>::type
 
template<class T , class U >
using apply_cv_t = typename apply_cv<T, U>::type
 
template<class T >
using xtrivially_default_constructible = std::is_trivially_default_constructible<T>
 
template<class C >
using get_strides_t = typename get_strides_type<C>::type
 
template<class ST >
using inner_reference_t = typename inner_reference<ST>::type
 
template<class E >
using has_fixed_rank_t = typename has_fixed_rank<std::decay_t<E>>::type
 
template<class E , size_t N>
using has_rank_t = typename has_rank<std::decay_t<E>, N>::type
 
template<class V >
using get_stepper = typename detail::get_stepper_impl<V>::type
 
template<class E , class... SL>
using view_temporary_type_t = typename view_temporary_type<E, SL...>::type
 

Enumerations

enum class  histogram_algorithm { automatic , linspace , logspace , uniform }
 Defines different algorithms to be used in "histogram_bin_edges". More...
 
enum class  layout_type { dynamic = 0x00 , any = 0xFF , row_major = 0x01 , column_major = 0x02 }
 
enum class  pad_mode {
  constant , symmetric , reflect , wrap ,
  periodic , edge
}
 Defines different algorithms to be used in xt::pad: More...
 
enum class  sorting_method { quick , stable }
 Sorting method. More...
 
enum class  quantile_method {
  quantile_method::interpolated_inverted_cdf = 4 , quantile_method::hazen , quantile_method::weibull , quantile_method::linear ,
  quantile_method::median_unbiased , quantile_method::normal_unbiased
}
 Quantile interpolation method. More...
 
enum class  stride_type { stride_type::internal = 0 , stride_type::normal = 1 , stride_type::bytes = 2 }
 Choose stride type. More...
 

Functions

template<class RF >
auto make_xaccumulator_functor (RF &&accumulate_func)
 
template<class RF , class IF >
auto make_xaccumulator_functor (RF &&accumulate_func, IF &&init_func)
 
template<class F , class E , class EVS = evaluation_strategy::immediate_type, xtl::check_concept< is_evaluation_strategy< EVS > > = 0>
auto accumulate (F &&f, E &&e, EVS evaluation_strategy=EVS())
 Accumulate and flatten array NOTE This function is not lazy!
 
template<class F , class E , class EVS = evaluation_strategy::immediate_type>
auto accumulate (F &&f, E &&e, std::ptrdiff_t axis, EVS evaluation_strategy=EVS())
 Accumulate over axis NOTE This function is not lazy!
 
template<layout_type L = ::xt::layout_type::row_major, class C , class SC >
auto adapt (C &&container, const SC &shape, layout_type l=L)
 Constructs:
 
template<class C , class SC , class SS >
auto adapt (C &&container, SC &&shape, SS &&strides)
 Constructs:
 
template<layout_type L = ::xt::layout_type::row_major, class P , class O , class SC , class A = detail::default_allocator_for_ptr_t<P>>
auto adapt (P &&pointer, typename A::size_type size, O ownership, const SC &shape, layout_type l=L, const A &alloc=A())
 Constructs:
 
template<class P , class O , class SC , class SS , class A = detail::default_allocator_for_ptr_t<P>>
auto adapt (P &&pointer, typename A::size_type size, O ownership, SC &&shape, SS &&strides, const A &alloc=A())
 Constructs:
 
template<layout_type L = ::xt::layout_type::row_major, class T , std::size_t N, class SC >
auto adapt (T(&c_array)[N], const SC &shape, layout_type l=L)
 Constructs:
 
template<class T , std::size_t N, class SC , class SS >
auto adapt (T(&c_array)[N], SC &&shape, SS &&strides)
 Constructs:
 
template<layout_type L = ::xt::layout_type::row_major, class C , std::size_t... X>
auto adapt (C &&pointer, const fixed_shape< X... > &)
 Constructs an non-owning xtensor_fixed_adaptor from a pointer with the specified shape and layout.
 
template<layout_type L = ::xt::layout_type::row_major, class C >
xtensor_adaptor< C, 1, Ladapt (C &&container, layout_type l=L)
 Constructs a 1-D xtensor_adaptor of the given stl-like container, with the specified layout_type.
 
template<layout_type L = ::xt::layout_type::row_major, class P , class O , class A = detail::default_allocator_for_ptr_t<P>>
xtensor_adaptor< xbuffer_adaptor< xtl::closure_type_t< P >, O, A >, 1, Ladapt (P &&pointer, typename A::size_type size, O ownership, layout_type l=L, const A &alloc=A())
 Constructs a 1-D xtensor_adaptor of the given dynamically allocated C array, with the specified layout.
 
template<layout_type L = ::xt::layout_type::row_major, class P , class SC , xtl::check_concept< detail::not_an_array< std::decay_t< SC > > > = 0>
auto adapt_smart_ptr (P &&smart_ptr, const SC &shape, layout_type l=L)
 Adapt a smart pointer to a typed memory block (unique_ptr or shared_ptr)
 
template<layout_type L = ::xt::layout_type::row_major, class P , class SC , class D , xtl::check_concept< detail::not_an_array< std::decay_t< SC > >, detail::not_a_layout< std::decay_t< D > > > = 0>
auto adapt_smart_ptr (P &&data_ptr, const SC &shape, D &&smart_ptr, layout_type l=L)
 Adapt a smart pointer (shared_ptr or unique_ptr)
 
template<layout_type L = ::xt::layout_type::row_major, class P , class I , std::size_t N>
auto adapt_smart_ptr (P &&smart_ptr, const I(&shape)[N], layout_type l=L)
 Adapt a smart pointer to a typed memory block (unique_ptr or shared_ptr)
 
template<layout_type L = ::xt::layout_type::row_major, class P , class I , std::size_t N, class D , xtl::check_concept< detail::not_a_layout< std::decay_t< D > > > = 0>
auto adapt_smart_ptr (P &&data_ptr, const I(&shape)[N], D &&smart_ptr, layout_type l=L)
 Adapt a smart pointer (shared_ptr or unique_ptr)
 
template<class E1 , class E2 >
void assign_data (xexpression< E1 > &e1, const xexpression< E2 > &e2, bool trivial)
 
template<class E1 , class E2 >
void assign_xexpression (xexpression< E1 > &e1, const xexpression< E2 > &e2)
 
template<class E1 , class E2 >
void computed_assign (xexpression< E1 > &e1, const xexpression< E2 > &e2)
 
template<class E1 , class E2 , class F >
void scalar_computed_assign (xexpression< E1 > &e1, const E2 &e2, F &&f)
 
template<class E1 , class E2 >
void assert_compatible_shape (const xexpression< E1 > &e1, const xexpression< E2 > &e2)
 
template<class E1 , class E2 >
void strided_assign (E1 &e1, const E2 &e2, std::false_type)
 
template<class E1 , class E2 >
void strided_assign (E1 &e1, const E2 &e2, std::true_type)
 
template<class E >
auto xaxis_slice_begin (E &&e)
 
template<class E >
auto xaxis_slice_begin (E &&e, typename std::decay_t< E >::size_type axis)
 
template<class E >
auto xaxis_slice_end (E &&e)
 
template<class E >
auto xaxis_slice_end (E &&e, typename std::decay_t< E >::size_type axis)
 
template<class E , class CS , class A , class O , class FF >
auto blockwise_reducer (E &&e, CS &&chunk_shape, A &&axes, O &&raw_options, FF &&functor)
 
template<class E , class S >
auto broadcast (E &&e, const S &s)
 Returns an xexpression broadcasting the given expression to a specified shape.
 
template<class E , class I , std::size_t L>
auto broadcast (E &&e, const I(&s)[L])
 
template<class CT , class X >
constexpr auto linear_begin (xbroadcast< CT, X > &c) noexcept
 
template<class CT , class X >
constexpr auto linear_end (xbroadcast< CT, X > &c) noexcept
 
template<class CT , class X >
constexpr auto linear_begin (const xbroadcast< CT, X > &c) noexcept
 
template<class CT , class X >
constexpr auto linear_end (const xbroadcast< CT, X > &c) noexcept
 
template<class D >
bool operator== (const xbuffer_adaptor_base< D > &lhs, const xbuffer_adaptor_base< D > &rhs)
 
template<class D >
bool operator!= (const xbuffer_adaptor_base< D > &lhs, const xbuffer_adaptor_base< D > &rhs)
 
template<class D >
bool operator< (const xbuffer_adaptor_base< D > &lhs, const xbuffer_adaptor_base< D > &rhs)
 
template<class D >
bool operator<= (const xbuffer_adaptor_base< D > &lhs, const xbuffer_adaptor_base< D > &rhs)
 
template<class D >
bool operator> (const xbuffer_adaptor_base< D > &lhs, const xbuffer_adaptor_base< D > &rhs)
 
template<class D >
bool operator>= (const xbuffer_adaptor_base< D > &lhs, const xbuffer_adaptor_base< D > &rhs)
 
template<class CP , class O , class A >
void swap (xbuffer_adaptor< CP, O, A > &lhs, xbuffer_adaptor< CP, O, A > &rhs) noexcept
 
template<class I , class CI >
void swap (xiterator_adaptor< I, CI > &lhs, xiterator_adaptor< I, CI > &rhs) noexcept
 
template<class C , class IG >
void swap (xiterator_owner_adaptor< C, IG > &lhs, xiterator_owner_adaptor< C, IG > &rhs) noexcept
 
template<class C , class IG >
auto make_xiterator_adaptor (C &&container, IG iterator_getter)
 
template<class T , class S >
auto ones (S shape) noexcept
 Returns an xexpression containing ones of the specified shape.
 
template<class T , class I , std::size_t L>
auto ones (const I(&shape)[L]) noexcept
 
template<class T , class S >
auto zeros (S shape) noexcept
 Returns an xexpression containing zeros of the specified shape.
 
template<class T , class I , std::size_t L>
auto zeros (const I(&shape)[L]) noexcept
 
template<class T , layout_type L = ::xt::layout_type::row_major, class S >
xarray< T, Lempty (const S &shape)
 Create a xcontainer (xarray, xtensor or xtensor_fixed) with uninitialized values of with value_type T and shape.
 
template<class T , layout_type L = ::xt::layout_type::row_major, class ST , std::size_t N>
xtensor< T, N, Lempty (const std::array< ST, N > &shape)
 
template<class T , layout_type L = ::xt::layout_type::row_major, class I , std::size_t N>
xtensor< T, N, Lempty (const I(&shape)[N])
 
template<class T , layout_type L = ::xt::layout_type::row_major, std::size_t... N>
xtensor_fixed< T, fixed_shape< N... >, Lempty (const fixed_shape< N... > &)
 
template<class E >
auto empty_like (const xexpression< E > &e)
 Create a xcontainer (xarray, xtensor or xtensor_fixed) with uninitialized values of the same shape, value type and layout as the input xexpression e.
 
template<class E >
auto full_like (const xexpression< E > &e, typename E::value_type fill_value)
 Create a xcontainer (xarray, xtensor or xtensor_fixed), filled with fill_value and of the same shape, value type and layout as the input xexpression e.
 
template<class E >
auto zeros_like (const xexpression< E > &e)
 Create a xcontainer (xarray, xtensor or xtensor_fixed), filled with zeros and of the same shape, value type and layout as the input xexpression e.
 
template<class E >
auto ones_like (const xexpression< E > &e)
 Create a xcontainer (xarray, xtensor or xtensor_fixed), filled with ones and of the same shape, value type and layout as the input xexpression e.
 
template<class T = bool>
auto eye (const std::vector< std::size_t > &shape, int k=0)
 Generates an array with ones on the diagonal.
 
template<class T = bool>
auto eye (std::size_t n, int k=0)
 Generates a (n x n) array with ones on the diagonal.
 
template<class T , class S = T>
auto arange (T start, T stop, S step=1) noexcept
 Generates numbers evenly spaced within given half-open interval [start, stop).
 
template<class T >
auto arange (T stop) noexcept
 Generate numbers evenly spaced within given half-open interval [0, stop) with a step size of 1.
 
template<class T >
auto linspace (T start, T stop, std::size_t num_samples=50, bool endpoint=true) noexcept
 Generates num_samples evenly spaced numbers over given interval.
 
template<class T >
auto logspace (T start, T stop, std::size_t num_samples, T base=10, bool endpoint=true) noexcept
 Generates num_samples numbers evenly spaced on a log scale over given interval.
 
template<class... Types>
auto xtuple (Types &&... args)
 Creates tuples from arguments for concatenate and stack.
 
template<class... CT>
auto concatenate (std::tuple< CT... > &&t, std::size_t axis=0)
 Concatenates xexpressions along axis.
 
template<std::size_t axis, class... CT, typename = std::enable_if_t<detail::all_fixed_shapes<CT...>::value>>
auto concatenate (std::tuple< CT... > &&t)
 
template<class... CT>
auto stack (std::tuple< CT... > &&t, std::size_t axis=0)
 Stack xexpressions along axis.
 
template<class... CT>
auto hstack (std::tuple< CT... > &&t)
 Stack xexpressions in sequence horizontally (column wise).
 
template<class... CT>
auto vstack (std::tuple< CT... > &&t)
 Stack xexpressions in sequence vertically (row wise).
 
template<class... E>
auto meshgrid (E &&... e) noexcept
 Return coordinate tensors from coordinate vectors.
 
template<class E >
auto diagonal (E &&arr, int offset=0, std::size_t axis_1=0, std::size_t axis_2=1)
 Returns the elements on the diagonal of arr If arr has more than two dimensions, then the axes specified by axis_1 and axis_2 are used to determine the 2-D sub-array whose diagonal is returned.
 
template<class E >
auto diag (E &&arr, int k=0)
 xexpression with values of arr on the diagonal, zeroes otherwise
 
template<class E >
auto tril (E &&arr, int k=0)
 Extract lower triangular matrix from xexpression.
 
template<class E >
auto triu (E &&arr, int k=0)
 Extract upper triangular matrix from xexpression.
 
template<class E >
constexpr bool is_chunked (const xexpression< E > &e)
 
template<class E >
constexpr bool is_chunked ()
 
template<class T , layout_type L = ::xt::layout_type::row_major, class S >
xchunked_array< xarray< xarray< T > > > chunked_array (S &&shape, S &&chunk_shape, layout_type chunk_memory_layout=::xt::layout_type::row_major)
 Creates an in-memory chunked array.
 
template<class T , layout_type L = ::xt::layout_type::row_major, class S >
xchunked_array< xarray< xarray< T > > > chunked_array (std::initializer_list< S > shape, std::initializer_list< S > chunk_shape, layout_type chunk_memory_layout=::xt::layout_type::row_major)
 
template<layout_type L = ::xt::layout_type::row_major, class E , class S >
xchunked_array< xarray< xarray< typename E::value_type > > > chunked_array (const xexpression< E > &e, S &&chunk_shape, layout_type chunk_memory_layout=::xt::layout_type::row_major)
 Creates an in-memory chunked array.
 
template<layout_type L = ::xt::layout_type::row_major, class E >
xchunked_array< xarray< xarray< typename E::value_type > > > chunked_array (const xexpression< E > &e, layout_type chunk_memory_layout=::xt::layout_type::row_major)
 Creates an in-memory chunked array.
 
template<class E , class S >
xchunked_view< E > as_chunked (E &&e, S &&chunk_shape)
 
template<class E >
xchunked_view< E > as_chunked (E &&e)
 
template<class E >
decltype(autoreal (E &&e) noexcept
 Return an xt::xexpression representing the real part of the given expression.
 
template<class E >
decltype(autoimag (E &&e) noexcept
 Return an xt::xexpression representing the imaginary part of the given expression.
 
template<class E >
auto conj (E &&e) noexcept
 Return an xt::xfunction evaluating to the complex conjugate of the given expression.
 
template<class E >
auto arg (E &&e) noexcept
 Calculates the phase angle (in radians) elementwise for the complex numbers in e.
 
template<class E >
auto angle (E &&e, bool deg=false) noexcept
 Calculates the phase angle elementwise for the complex numbers in e.
 
template<class E >
auto norm (E &&e) noexcept
 Calculates the squared magnitude elementwise for the complex numbers in e.
 
template<class T , class A = std::allocator<T>>
xcsv_tensor< T, A > load_csv (std::istream &stream, const char delimiter, const std::size_t skip_rows, const std::ptrdiff_t max_rows, const std::string comments)
 Load tensor from CSV.
 
template<class E >
void dump_csv (std::ostream &stream, const xexpression< E > &e)
 Dump tensor to CSV.
 
template<class E >
void load_file (std::istream &stream, xexpression< E > &e, const xcsv_config &config)
 
template<class E >
void dump_file (std::ostream &stream, const xexpression< E > &e, const xcsv_config &)
 
template<class E >
auto dynamic_view (E &&e, const xdynamic_slice_vector &slices)
 
template<class T >
auto eval (T &&t) -> std::enable_if_t< detail::is_container< std::decay_t< T > >::value, T && >
 Force evaluation of xexpression.
 
template<layout_type L = layout_type::any, class E >
auto as_strided (E &&e) -> std::enable_if_t< has_data_interface< std::decay_t< E > >::value &&detail::has_same_layout< L, E >(), E && >
 Force evaluation of xexpression not providing a data interface and convert to the required layout.
 
template<class S1 , class S2 >
void throw_broadcast_error (const S1 &lhs, const S2 &rhs)
 
template<class S1 , class S2 >
void throw_concatenate_error (const S1 &lhs, const S2 &rhs)
 
template<class S , class... Args>
void check_index (const S &shape, Args... args)
 
template<class S , class It >
void check_element_index (const S &shape, It first, It last)
 
template<class S >
void check_index (const S &)
 
template<class S >
void check_index (const S &, missing_type)
 
template<class S , class Arg , class... Args>
void check_index (const S &shape, Arg arg, Args... args)
 
template<class S , class... Args>
void check_dimension (const S &shape, Args...)
 
template<class A , class D >
void check_axis_in_dim (A axis, D dim, const char *subject="Axis")
 
template<class S , class... Args>
void check_access (const S &shape, Args... args)
 
template<layout_type L, class R , std::size_t... X>
constexpr R get_strides (const fixed_shape< X... > &shape) noexcept
 
template<class S , class T >
constexprget_backstrides (const S &shape, const T &strides) noexcept
 
template<class E1 , class E2 >
auto digitize (E1 &&data, E2 &&bin_edges, bool right=false)
 Return the indices of the bins to which each value in input array belongs.
 
template<class R = double, class E1 , class E2 , class E3 >
auto histogram (E1 &&data, E2 &&bin_edges, E3 &&weights, bool density=false)
 Compute the histogram of a set of data.
 
template<class R = double, class E1 , class E2 >
auto histogram (E1 &&data, E2 &&bin_edges, bool density=false)
 Compute the histogram of a set of data.
 
template<class R = double, class E1 >
auto histogram (E1 &&data, std::size_t bins=10, bool density=false)
 Compute the histogram of a set of data.
 
template<class R = double, class E1 , class E2 >
auto histogram (E1 &&data, std::size_t bins, E2 left, E2 right, bool density=false)
 Compute the histogram of a set of data.
 
template<class R = double, class E1 , class E2 >
auto histogram (E1 &&data, std::size_t bins, E2 &&weights, bool density=false)
 Compute the histogram of a set of data.
 
template<class R = double, class E1 , class E2 , class E3 >
auto histogram (E1 &&data, std::size_t bins, E2 &&weights, E3 left, E3 right, bool density=false)
 Compute the histogram of a set of data.
 
template<class E1 , class E2 , class E3 >
auto histogram_bin_edges (E1 &&data, E2 &&weights, E3 left, E3 right, std::size_t bins=10, histogram_algorithm mode=histogram_algorithm::automatic)
 Compute the bin-edges of a histogram of a set of data using different algorithms.
 
template<class E1 , class E2 >
auto histogram_bin_edges (E1 &&data, E2 &&weights, std::size_t bins=10, histogram_algorithm mode=histogram_algorithm::automatic)
 Compute the bin-edges of a histogram of a set of data using different algorithms.
 
template<class E1 >
auto histogram_bin_edges (E1 &&data, std::size_t bins=10, histogram_algorithm mode=histogram_algorithm::automatic)
 Compute the bin-edges of a histogram of a set of data using different algorithms.
 
template<class E1 , class E2 >
auto histogram_bin_edges (E1 &&data, E2 left, E2 right, std::size_t bins=10, histogram_algorithm mode=histogram_algorithm::automatic)
 Compute the bin-edges of a histogram of a set of data using different algorithms.
 
template<class E1 , class E2 , xtl::check_concept< is_xexpression< std::decay_t< E2 > > > = 0>
auto bincount (E1 &&data, E2 &&weights, std::size_t minlength=0)
 Count number of occurrences of each value in array of non-negative ints.
 
template<class E1 >
auto bincount (E1 &&data, std::size_t minlength=0)
 
template<class E >
xt::xtensor< size_t, 1 > bin_items (size_t N, E &&weights)
 Get the number of items in each bin, given the fraction of items per bin.
 
xt::xtensor< size_t, 1 > bin_items (size_t N, size_t bins)
 Get the number of items in each bin, with each bin having approximately the same number of items in it,under the constraint that the total number of items of all bins is exactly "N".
 
template<class T >
static_string type_name ()
 
template<class T >
std::string type_to_string ()
 
template<class T >
std::string info (const T &t)
 
template<class E >
std::ostream & operator<< (std::ostream &out, const xexpression< E > &e)
 
print_options::print_options_impl get_print_options (std::ostream &out)
 
template<class E , class F >
std::ostream & pretty_print (const xexpression< E > &e, F &&func, std::ostream &out=std::cout)
 
template<class E >
std::ostream & pretty_print (const xexpression< E > &e, std::ostream &out=std::cout)
 
template<class St , class S , layout_type L>
bool operator== (const xiterator< St, S, L > &lhs, const xiterator< St, S, L > &rhs)
 
template<class St , class S , layout_type L>
bool operator< (const xiterator< St, S, L > &lhs, const xiterator< St, S, L > &rhs)
 
template<class It , class BIt >
bool operator== (const xbounded_iterator< It, BIt > &lhs, const xbounded_iterator< It, BIt > &rhs)
 
template<class It , class BIt >
bool operator< (const xbounded_iterator< It, BIt > &lhs, const xbounded_iterator< It, BIt > &rhs)
 
template<class C >
constexpr auto linear_begin (C &c) noexcept
 
template<class C >
constexpr auto linear_end (C &c) noexcept
 
template<class C >
constexpr auto linear_begin (const C &c) noexcept
 
template<class C >
constexpr auto linear_end (const C &c) noexcept
 
template<template< typename U, typename V, typename... Args > class M, class E >
enable_xexpression< E > to_json (nlohmann::basic_json< M > &j, const E &e)
 JSON serialization of an xtensor expression.
 
template<template< typename U, typename V, typename... Args > class M, class E >
enable_xcontainer_semantics< E > from_json (const nlohmann::basic_json< M > &j, E &e)
 JSON deserialization of a xtensor expression with a container or a view semantics.
 
template<class... Args>
constexpr layout_type compute_layout (Args... args) noexcept
 Implementation of the following logical table:
 
constexpr layout_type default_assignable_layout (layout_type l) noexcept
 
constexpr layout_type layout_remove_any (const layout_type layout) noexcept
 
template<class E >
auto transpose (E &&e) noexcept
 Returns a transpose view by reversing the dimensions of xexpression e.
 
template<class E , class S , class Tag = check_policy::none>
auto transpose (E &&e, S &&permutation, Tag check_policy)
 Returns a transpose view by permuting the xexpression e with permutation.
 
template<class E >
auto swapaxes (E &&e, std::ptrdiff_t axis1, std::ptrdiff_t axis2)
 Return a new expression with two axes interchanged.
 
template<layout_type L = ::xt::layout_type::row_major, class E >
auto ravel (E &&e)
 Return a flatten view of the given expression.
 
template<layout_type L = ::xt::layout_type::row_major, class E >
auto flatten (E &&e)
 Return a flatten view of the given expression.
 
template<layout_type L, class T >
auto flatnonzero (const T &arr)
 Return indices that are non-zero in the flattened version of arr.
 
template<class E >
auto trim_zeros (E &&e, const std::string &direction)
 Trim zeros at beginning, end or both of 1D sequence.
 
template<class E >
auto squeeze (E &&e)
 Returns a squeeze view of the given expression.
 
template<class E , class S , class Tag = check_policy::none, std::enable_if_t<!xtl::is_integral< S >::value, int > = 0>
auto squeeze (E &&e, S &&axis, Tag check_policy)
 Remove single-dimensional entries from the shape of an xexpression.
 
template<class E >
auto expand_dims (E &&e, std::size_t axis)
 Expand the shape of an xexpression.
 
template<std::size_t N, class E >
auto atleast_Nd (E &&e)
 Expand dimensions of xexpression to at least N
 
template<class E >
auto atleast_1d (E &&e)
 Expand to at least 1D.
 
template<class E >
auto atleast_2d (E &&e)
 Expand to at least 2D.
 
template<class E >
auto atleast_3d (E &&e)
 Expand to at least 3D.
 
template<class E >
auto split (E &e, std::size_t n, std::size_t axis)
 Split xexpression along axis into subexpressions.
 
template<class E >
auto hsplit (E &e, std::size_t n)
 Split an xexpression into subexpressions horizontally (column-wise)
 
template<class E >
auto vsplit (E &e, std::size_t n)
 Split an xexpression into subexpressions vertically (row-wise)
 
template<class E >
auto flip (E &&e)
 Reverse the order of elements in an xexpression along every axis.
 
template<class E >
auto flip (E &&e, std::size_t axis)
 Reverse the order of elements in an xexpression along the given axis.
 
template<std::ptrdiff_t N = 1, class E >
auto rot90 (E &&e, const std::array< std::ptrdiff_t, 2 > &axes)
 Rotate an array by 90 degrees in the plane specified by axes.
 
template<class E >
auto roll (E &&e, std::ptrdiff_t shift)
 Roll an expression.
 
template<class E >
auto roll (E &&e, std::ptrdiff_t shift, std::ptrdiff_t axis)
 Roll an expression along a given axis.
 
template<class E >
auto repeat (E &&e, std::size_t repeats, std::size_t axis)
 Repeat elements of an expression along a given axis.
 
template<class E >
auto repeat (E &&e, const std::vector< std::size_t > &repeats, std::size_t axis)
 Repeat elements of an expression along a given axis.
 
template<class E >
auto repeat (E &&e, std::vector< std::size_t > &&repeats, std::size_t axis)
 Repeat elements of an expression along a given axis.
 
template<class E >
auto moveaxis (E &&e, std::ptrdiff_t src, std::ptrdiff_t dest)
 Return a new expression with an axis move to a new position.
 
template<class E >
auto abs (E &&e) noexcept -> detail::xfunction_type_t< math::abs_fun, E >
 Absolute value function.
 
template<class E >
auto fabs (E &&e) noexcept -> detail::xfunction_type_t< math::fabs_fun, E >
 Absolute value function.
 
template<class E1 , class E2 >
auto fmod (E1 &&e1, E2 &&e2) noexcept -> detail::xfunction_type_t< math::fmod_fun, E1, E2 >
 Remainder of the floating point division operation.
 
template<class E1 , class E2 >
auto remainder (E1 &&e1, E2 &&e2) noexcept -> detail::xfunction_type_t< math::remainder_fun, E1, E2 >
 Signed remainder of the division operation.
 
template<class E1 , class E2 , class E3 >
auto fma (E1 &&e1, E2 &&e2, E3 &&e3) noexcept -> detail::xfunction_type_t< math::fma_fun, E1, E2, E3 >
 Fused multiply-add operation.
 
template<class E1 , class E2 >
auto fmax (E1 &&e1, E2 &&e2) noexcept -> detail::xfunction_type_t< math::fmax_fun, E1, E2 >
 Maximum function.
 
template<class E1 , class E2 >
auto fmin (E1 &&e1, E2 &&e2) noexcept -> detail::xfunction_type_t< math::fmin_fun, E1, E2 >
 Minimum function.
 
template<class E1 , class E2 >
auto fdim (E1 &&e1, E2 &&e2) noexcept -> detail::xfunction_type_t< math::fdim_fun, E1, E2 >
 Positive difference function.
 
template<class E >
auto deg2rad (E &&e) noexcept -> detail::xfunction_type_t< math::deg2rad, E >
 Convert angles from degrees to radians.
 
template<class E >
auto radians (E &&e) noexcept -> detail::xfunction_type_t< math::deg2rad, E >
 Convert angles from degrees to radians.
 
template<class E >
auto rad2deg (E &&e) noexcept -> detail::xfunction_type_t< math::rad2deg, E >
 Convert angles from radians to degrees.
 
template<class E >
auto degrees (E &&e) noexcept -> detail::xfunction_type_t< math::rad2deg, E >
 Convert angles from radians to degrees.
 
template<class E1 , class E2 >
auto maximum (E1 &&e1, E2 &&e2) noexcept -> detail::xfunction_type_t< math::maximum< void >, E1, E2 >
 Elementwise maximum.
 
template<class E1 , class E2 >
auto minimum (E1 &&e1, E2 &&e2) noexcept -> detail::xfunction_type_t< math::minimum< void >, E1, E2 >
 Elementwise minimum.
 
template<class T = void, class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > >, xtl::negation< xtl::is_integral< std::decay_t< X > > > > = 0>
auto amax (E &&e, X &&axes, EVS es=EVS())
 Maximum element along given axis.
 
template<class T = void, class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > >, xtl::is_integral< std::decay_t< X > > > = 0>
auto amax (E &&e, X axis, EVS es=EVS())
 
template<class T = void, class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS > > = 0>
auto amax (E &&e, EVS es=EVS())
 
template<class T = void, class E , class I , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto amax (E &&e, const I(&axes)[N], EVS es=EVS())
 
template<class T = void, class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > >, xtl::negation< xtl::is_integral< std::decay_t< X > > > > = 0>
auto amin (E &&e, X &&axes, EVS es=EVS())
 Minimum element along given axis.
 
template<class T = void, class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > >, xtl::is_integral< std::decay_t< X > > > = 0>
auto amin (E &&e, X axis, EVS es=EVS())
 
template<class T = void, class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS > > = 0>
auto amin (E &&e, EVS es=EVS())
 
template<class T = void, class E , class I , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto amin (E &&e, const I(&axes)[N], EVS es=EVS())
 
template<class E1 , class E2 , class E3 >
auto clip (E1 &&e1, E2 &&lo, E3 &&hi) noexcept -> detail::xfunction_type_t< math::clamp_fun, E1, E2, E3 >
 Clip values between hi and lo.
 
template<class E >
auto sign (E &&e) noexcept -> detail::xfunction_type_t< math::sign_fun, E >
 Returns an element-wise indication of the sign of a number.
 
template<class E >
auto exp (E &&e) noexcept -> detail::xfunction_type_t< math::exp_fun, E >
 Natural exponential function.
 
template<class E >
auto exp2 (E &&e) noexcept -> detail::xfunction_type_t< math::exp2_fun, E >
 Base 2 exponential function.
 
template<class E >
auto expm1 (E &&e) noexcept -> detail::xfunction_type_t< math::expm1_fun, E >
 Natural exponential minus one function.
 
template<class E >
auto log (E &&e) noexcept -> detail::xfunction_type_t< math::log_fun, E >
 Natural logarithm function.
 
template<class E >
auto log10 (E &&e) noexcept -> detail::xfunction_type_t< math::log10_fun, E >
 Base 10 logarithm function.
 
template<class E >
auto log2 (E &&e) noexcept -> detail::xfunction_type_t< math::log2_fun, E >
 Base 2 logarithm function.
 
template<class E >
auto log1p (E &&e) noexcept -> detail::xfunction_type_t< math::log1p_fun, E >
 Natural logarithm of one plus function.
 
template<class E1 , class E2 >
auto pow (E1 &&e1, E2 &&e2) noexcept -> detail::xfunction_type_t< math::pow_fun, E1, E2 >
 Power function.
 
template<class F , class... E>
auto make_lambda_xfunction (F &&lambda, E &&... args)
 Create a xfunction from a lambda.
 
template<class E1 >
auto square (E1 &&e1) noexcept
 Square power function, equivalent to e1 * e1.
 
template<class E1 >
auto cube (E1 &&e1) noexcept
 Cube power function, equivalent to e1 * e1 * e1.
 
template<std::size_t N, class E >
auto pow (E &&e) noexcept
 Integer power function.
 
template<class E >
auto sqrt (E &&e) noexcept -> detail::xfunction_type_t< math::sqrt_fun, E >
 Square root function.
 
template<class E >
auto cbrt (E &&e) noexcept -> detail::xfunction_type_t< math::cbrt_fun, E >
 Cubic root function.
 
template<class E1 , class E2 >
auto hypot (E1 &&e1, E2 &&e2) noexcept -> detail::xfunction_type_t< math::hypot_fun, E1, E2 >
 Hypotenuse function.
 
template<class E >
auto sin (E &&e) noexcept -> detail::xfunction_type_t< math::sin_fun, E >
 Sine function.
 
template<class E >
auto cos (E &&e) noexcept -> detail::xfunction_type_t< math::cos_fun, E >
 Cosine function.
 
template<class E >
auto tan (E &&e) noexcept -> detail::xfunction_type_t< math::tan_fun, E >
 Tangent function.
 
template<class E >
auto asin (E &&e) noexcept -> detail::xfunction_type_t< math::asin_fun, E >
 Arcsine function.
 
template<class E >
auto acos (E &&e) noexcept -> detail::xfunction_type_t< math::acos_fun, E >
 Arccosine function.
 
template<class E >
auto atan (E &&e) noexcept -> detail::xfunction_type_t< math::atan_fun, E >
 Arctangent function.
 
template<class E1 , class E2 >
auto atan2 (E1 &&e1, E2 &&e2) noexcept -> detail::xfunction_type_t< math::atan2_fun, E1, E2 >
 Artangent function, using signs to determine quadrants.
 
template<class E >
auto sinh (E &&e) noexcept -> detail::xfunction_type_t< math::sinh_fun, E >
 Hyperbolic sine function.
 
template<class E >
auto cosh (E &&e) noexcept -> detail::xfunction_type_t< math::cosh_fun, E >
 Hyperbolic cosine function.
 
template<class E >
auto tanh (E &&e) noexcept -> detail::xfunction_type_t< math::tanh_fun, E >
 Hyperbolic tangent function.
 
template<class E >
auto asinh (E &&e) noexcept -> detail::xfunction_type_t< math::asinh_fun, E >
 Inverse hyperbolic sine function.
 
template<class E >
auto acosh (E &&e) noexcept -> detail::xfunction_type_t< math::acosh_fun, E >
 Inverse hyperbolic cosine function.
 
template<class E >
auto atanh (E &&e) noexcept -> detail::xfunction_type_t< math::atanh_fun, E >
 Inverse hyperbolic tangent function.
 
template<class E >
auto erf (E &&e) noexcept -> detail::xfunction_type_t< math::erf_fun, E >
 Error function.
 
template<class E >
auto erfc (E &&e) noexcept -> detail::xfunction_type_t< math::erfc_fun, E >
 Complementary error function.
 
template<class E >
auto tgamma (E &&e) noexcept -> detail::xfunction_type_t< math::tgamma_fun, E >
 Gamma function.
 
template<class E >
auto lgamma (E &&e) noexcept -> detail::xfunction_type_t< math::lgamma_fun, E >
 Natural logarithm of the gamma function.
 
template<class E >
auto ceil (E &&e) noexcept -> detail::xfunction_type_t< math::ceil_fun, E >
 ceil function.
 
template<class E >
auto floor (E &&e) noexcept -> detail::xfunction_type_t< math::floor_fun, E >
 floor function.
 
template<class E >
auto trunc (E &&e) noexcept -> detail::xfunction_type_t< math::trunc_fun, E >
 trunc function.
 
template<class E >
auto round (E &&e) noexcept -> detail::xfunction_type_t< math::round_fun, E >
 round function.
 
template<class E >
auto nearbyint (E &&e) noexcept -> detail::xfunction_type_t< math::nearbyint_fun, E >
 nearbyint function.
 
template<class E >
auto rint (E &&e) noexcept -> detail::xfunction_type_t< math::rint_fun, E >
 rint function.
 
template<class E >
auto isfinite (E &&e) noexcept -> detail::xfunction_type_t< math::isfinite_fun, E >
 finite value check
 
template<class E >
auto isinf (E &&e) noexcept -> detail::xfunction_type_t< math::isinf_fun, E >
 infinity check
 
template<class E >
auto isnan (E &&e) noexcept -> detail::xfunction_type_t< math::isnan_fun, E >
 NaN check.
 
template<class E1 , class E2 >
auto isclose (E1 &&e1, E2 &&e2, double rtol=1e-05, double atol=1e-08, bool equal_nan=false) noexcept
 Element-wise closeness detection.
 
template<class E1 , class E2 >
auto allclose (E1 &&e1, E2 &&e2, double rtol=1e-05, double atol=1e-08) noexcept
 Check if all elements in e1 are close to the corresponding elements in e2.
 
template<class T = void, class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > >, xtl::negation< xtl::is_integral< std::decay_t< X > > > > = 0>
auto sum (E &&e, X &&axes, EVS es=EVS())
 Sum of elements over given axes.
 
template<class T = void, class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > >, xtl::is_integral< std::decay_t< X > > > = 0>
auto sum (E &&e, X axis, EVS es=EVS())
 
template<class T = void, class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS > > = 0>
auto sum (E &&e, EVS es=EVS())
 
template<class T = void, class E , class I , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto sum (E &&e, const I(&axes)[N], EVS es=EVS())
 
template<class T = void, class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > >, xtl::negation< xtl::is_integral< std::decay_t< X > > > > = 0>
auto prod (E &&e, X &&axes, EVS es=EVS())
 Product of elements over given axes.
 
template<class T = void, class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > >, xtl::is_integral< std::decay_t< X > > > = 0>
auto prod (E &&e, X axis, EVS es=EVS())
 
template<class T = void, class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS > > = 0>
auto prod (E &&e, EVS es=EVS())
 
template<class T = void, class E , class I , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto prod (E &&e, const I(&axes)[N], EVS es=EVS())
 
template<class T = void, class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > > > = 0>
auto mean (E &&e, X &&axes, EVS es=EVS())
 Mean of elements over given axes.
 
template<class T = void, class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS > > = 0>
auto mean (E &&e, EVS es=EVS())
 
template<class T = void, class E , class I , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto mean (E &&e, const I(&axes)[N], EVS es=EVS())
 
template<class T = void, class E , class W , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS >, xtl::negation< xtl::is_integral< X > > > = 0>
auto average (E &&e, W &&weights, X &&axes, EVS ev=EVS())
 Average of elements over given axes using weights.
 
template<class T = void, class E , class W , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS >, xtl::is_integral< X > > = 0>
auto average (E &&e, W &&weights, X axis, EVS ev=EVS())
 
template<class T = void, class E , class W , class X , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto average (E &&e, W &&weights, const X(&axes)[N], EVS ev=EVS())
 
template<class T = void, class E , class W , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS > > = 0>
auto average (E &&e, W &&weights, EVS ev=EVS())
 
template<class T = void, class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS > > = 0>
auto average (E &&e, EVS ev=EVS())
 
template<class T = void, class E , class D , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS >, xtl::is_integral< D > > = 0>
auto variance (E &&e, const D &ddof, EVS es=EVS())
 
template<class T = void, class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS > > = 0>
auto variance (E &&e, EVS es=EVS())
 
template<class T = void, class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS > > = 0>
auto stddev (E &&e, EVS es=EVS())
 
template<class T = void, class E , class X , class D , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > >, xtl::is_integral< D > > = 0>
auto variance (E &&e, X &&axes, const D &ddof, EVS es=EVS())
 Compute the variance along the specified axes.
 
template<class T = void, class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > >, xtl::negation< xtl::is_integral< std::decay_t< X > > >, is_reducer_options< EVS > > = 0>
auto variance (E &&e, X &&axes, EVS es=EVS())
 
template<class T = void, class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > > > = 0>
auto stddev (E &&e, X &&axes, EVS es=EVS())
 Compute the standard deviation along the specified axis.
 
template<class T = void, class E , class A , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto stddev (E &&e, const A(&axes)[N], EVS es=EVS())
 
template<class T = void, class E , class A , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS > > = 0>
auto variance (E &&e, const A(&axes)[N], EVS es=EVS())
 
template<class T = void, class E , class A , std::size_t N, class D , class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto variance (E &&e, const A(&axes)[N], const D &ddof, EVS es=EVS())
 
template<class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS > > = 0>
auto minmax (E &&e, EVS es=EVS())
 Minimum and maximum among the elements of an array or expression.
 
template<class T = void, class E >
auto cumsum (E &&e, std::ptrdiff_t axis)
 Cumulative sum.
 
template<class T = void, class E >
auto cumsum (E &&e)
 
template<class T = void, class E >
auto cumprod (E &&e, std::ptrdiff_t axis)
 Cumulative product.
 
template<class T = void, class E >
auto cumprod (E &&e)
 
template<class E >
auto nan_to_num (E &&e)
 Convert nan or +/- inf to numbers.
 
template<class T = void, class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > >, xtl::negation< xtl::is_integral< std::decay_t< X > > > > = 0>
auto nanmin (E &&e, X &&axes, EVS es=EVS())
 Minimum element over given axes, ignoring NaNs.
 
template<class T = void, class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > >, xtl::is_integral< std::decay_t< X > > > = 0>
auto nanmin (E &&e, X axis, EVS es=EVS())
 
template<class T = void, class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS > > = 0>
auto nanmin (E &&e, EVS es=EVS())
 
template<class T = void, class E , class I , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto nanmin (E &&e, const I(&axes)[N], EVS es=EVS())
 
template<class T = void, class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > >, xtl::negation< xtl::is_integral< std::decay_t< X > > > > = 0>
auto nanmax (E &&e, X &&axes, EVS es=EVS())
 Maximum element along given axes, ignoring NaNs.
 
template<class T = void, class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > >, xtl::is_integral< std::decay_t< X > > > = 0>
auto nanmax (E &&e, X axis, EVS es=EVS())
 
template<class T = void, class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS > > = 0>
auto nanmax (E &&e, EVS es=EVS())
 
template<class T = void, class E , class I , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto nanmax (E &&e, const I(&axes)[N], EVS es=EVS())
 
template<class T = void, class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > >, xtl::negation< xtl::is_integral< std::decay_t< X > > > > = 0>
auto nansum (E &&e, X &&axes, EVS es=EVS())
 Sum of elements over given axes, replacing NaN with 0.
 
template<class T = void, class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > >, xtl::is_integral< std::decay_t< X > > > = 0>
auto nansum (E &&e, X axis, EVS es=EVS())
 
template<class T = void, class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS > > = 0>
auto nansum (E &&e, EVS es=EVS())
 
template<class T = void, class E , class I , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto nansum (E &&e, const I(&axes)[N], EVS es=EVS())
 
template<class T = void, class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > >, xtl::negation< xtl::is_integral< std::decay_t< X > > > > = 0>
auto nanprod (E &&e, X &&axes, EVS es=EVS())
 Product of elements over given axes, replacing NaN with 1.
 
template<class T = void, class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > >, xtl::is_integral< std::decay_t< X > > > = 0>
auto nanprod (E &&e, X axis, EVS es=EVS())
 
template<class T = void, class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS > > = 0>
auto nanprod (E &&e, EVS es=EVS())
 
template<class T = void, class E , class I , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto nanprod (E &&e, const I(&axes)[N], EVS es=EVS())
 
template<class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS > > = 0>
auto count_nonzero (E &&e, EVS es=EVS())
 
template<class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > >, xtl::negation< xtl::is_integral< X > > > = 0>
auto count_nonzero (E &&e, X &&axes, EVS es=EVS())
 
template<class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > >, xtl::is_integral< X > > = 0>
auto count_nonzero (E &&e, X axis, EVS es=EVS())
 
template<class E , class I , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto count_nonzero (E &&e, const I(&axes)[N], EVS es=EVS())
 
template<class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS > > = 0>
auto count_nonnan (E &&e, EVS es=EVS())
 
template<class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > >, xtl::negation< xtl::is_integral< X > > > = 0>
auto count_nonnan (E &&e, X &&axes, EVS es=EVS())
 
template<class E , class I , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto count_nonnan (E &&e, const I(&axes)[N], EVS es=EVS())
 
template<class T = void, class E >
auto nancumsum (E &&e, std::ptrdiff_t axis)
 Cumulative sum, replacing nan with 0.
 
template<class T = void, class E >
auto nancumsum (E &&e)
 
template<class T = void, class E >
auto nancumprod (E &&e, std::ptrdiff_t axis)
 Cumulative product, replacing nan with 1.
 
template<class T = void, class E >
auto nancumprod (E &&e)
 
template<class T = void, class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > > > = 0>
auto nanmean (E &&e, X &&axes, EVS es=EVS())
 Mean of elements over given axes, excluding NaNs.
 
template<class T = void, class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS > > = 0>
auto nanmean (E &&e, EVS es=EVS())
 
template<class T = void, class E , class I , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto nanmean (E &&e, const I(&axes)[N], EVS es=EVS())
 
template<class T = void, class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS > > = 0>
auto nanvar (E &&e, EVS es=EVS())
 
template<class T = void, class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS > > = 0>
auto nanstd (E &&e, EVS es=EVS())
 
template<class T = void, class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > > > = 0>
auto nanvar (E &&e, X &&axes, EVS es=EVS())
 Compute the variance along the specified axes, excluding NaNs.
 
template<class T = void, class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > > > = 0>
auto nanstd (E &&e, X &&axes, EVS es=EVS())
 Compute the standard deviation along the specified axis, excluding nans.
 
template<class T = void, class E , class A , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto nanstd (E &&e, const A(&axes)[N], EVS es=EVS())
 
template<class T = void, class E , class A , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto nanvar (E &&e, const A(&axes)[N], EVS es=EVS())
 
template<class T >
auto diff (const xexpression< T > &a, std::size_t n=1, std::ptrdiff_t axis=-1)
 Calculate the n-th discrete difference along the given axis.
 
template<class T >
auto trapz (const xexpression< T > &y, double dx=1.0, std::ptrdiff_t axis=-1)
 Integrate along the given axis using the composite trapezoidal rule.
 
template<class T , class E >
auto trapz (const xexpression< T > &y, const xexpression< E > &x, std::ptrdiff_t axis=-1)
 Integrate along the given axis using the composite trapezoidal rule.
 
template<class E1 , class E2 , class E3 , typename T >
auto interp (const E1 &x, const E2 &xp, const E3 &fp, T left, T right)
 Returns the one-dimensional piecewise linear interpolant to a function with given discrete data points (xp, fp), evaluated at x.
 
template<class E1 , class E2 = xt::placeholders::xtuph, class E3 = double>
auto unwrap (E1 &&p, E2 discontinuity=xnone(), std::ptrdiff_t axis=-1, E3 period=2.0 *xt::numeric_constants< double >::PI)
 Unwrap by taking the complement of large deltas with respect to the period.
 
template<class E1 , class E2 , class E3 >
auto interp (const E1 &x, const E2 &xp, const E3 &fp)
 Returns the one-dimensional piecewise linear interpolant to a function with given discrete data points (xp, fp), evaluated at x.
 
template<class E1 >
auto cov (const E1 &x, const E1 &y=E1())
 Returns the covariance matrix.
 
template<class E1 , class E2 , class E3 >
auto convolve (E1 &&a, E2 &&v, E3 mode)
 
template<class P , class T >
void compute_0d_table (std::stringstream &out, P &, const T &expr)
 
template<class P >
void compute_1d_row (std::stringstream &out, P &printer, const std::size_t &row_idx)
 
template<class P , class T >
void compute_1d_table (std::stringstream &out, P &printer, const T &expr, const std::size_t &edgeitems)
 
template<class P >
void compute_2d_element (std::stringstream &out, P &printer, const std::string &idx_str, const std::size_t &row_idx, const std::size_t &column_idx)
 
template<class P , class T >
void compute_2d_row (std::stringstream &out, P &printer, const T &expr, const std::size_t &edgeitems, const std::string &idx_str, const std::size_t &row_idx)
 
template<class P , class T , class I >
void compute_2d_table (std::stringstream &out, P &printer, const T &expr, const std::size_t &edgeitems, const std::vector< I > &idx)
 
template<class P , class T , class I >
void compute_nd_row (std::stringstream &out, P &printer, const T &expr, const std::size_t &edgeitems, const std::vector< I > &idx)
 
template<class P , class T , class I >
void compute_nd_table_impl (std::stringstream &out, P &printer, const T &expr, const std::size_t &edgeitems, const std::vector< I > &idx)
 
template<class P , class T >
void compute_nd_table (std::stringstream &out, P &printer, const T &expr, const std::size_t &edgeitems)
 
template<class E >
nlohmann::json mime_bundle_repr_impl (const E &expr)
 
template<class F , class CT >
nlohmann::json mime_bundle_repr (const xfunctor_view< F, CT > &expr)
 
template<class F , class... CT>
nlohmann::json mime_bundle_repr (const xfunction< F, CT... > &expr)
 
template<class EC , layout_type L, class SC , class Tag >
nlohmann::json mime_bundle_repr (const xarray_container< EC, L, SC, Tag > &expr)
 
template<class EC , std::size_t N, layout_type L, class Tag >
nlohmann::json mime_bundle_repr (const xtensor_container< EC, N, L, Tag > &expr)
 
template<class ET , class S , layout_type L, bool SH, class Tag >
nlohmann::json mime_bundle_repr (const xfixed_container< ET, S, L, SH, Tag > &expr)
 
template<class F , class CT , class X , class O >
nlohmann::json mime_bundle_repr (const xreducer< F, CT, X, O > &expr)
 
template<class VE , class FE >
nlohmann::json mime_bundle_repr (const xoptional_assembly< VE, FE > &expr)
 
template<class VEC , class FEC >
nlohmann::json mime_bundle_repr (const xoptional_assembly_adaptor< VEC, FEC > &expr)
 
template<class CT >
nlohmann::json mime_bundle_repr (const xscalar< CT > &expr)
 
template<class CT , class X >
nlohmann::json mime_bundle_repr (const xbroadcast< CT, X > &expr)
 
template<class F , class R , class S >
nlohmann::json mime_bundle_repr (const xgenerator< F, R, S > &expr)
 
template<class CT , class... S>
nlohmann::json mime_bundle_repr (const xview< CT, S... > &expr)
 
template<class CT , class S , layout_type L, class FST >
nlohmann::json mime_bundle_repr (const xstrided_view< CT, S, L, FST > &expr)
 
template<class CTD , class CTM >
nlohmann::json mime_bundle_repr (const xmasked_view< CTD, CTM > &expr)
 
template<class T , class B >
nlohmann::json mime_bundle_repr (const xmasked_value< T, B > &v)
 
template<class S , class B , class E >
auto multiindex_iterator_begin (B &&roi_begin, E &&roi_end)
 
template<class S , class B , class E >
auto multiindex_iterator_end (B &&roi_begin, E &&roi_end)
 
template<class A >
noalias_proxy< xtl::closure_type_t< A > > noalias (A &&a) noexcept
 
template<class E , class X , class EVS , class >
auto norm_l0 (E &&e, X &&axes, EVS es) noexcept
 L0 (count) pseudo-norm of an array-like argument over given axes.
 
template<class E , class X , class EVS , class >
auto norm_l1 (E &&e, X &&axes, EVS es) noexcept
 L1 norm of an array-like argument over given axes.
 
template<class E , class X , class EVS , class >
auto norm_sq (E &&e, X &&axes, EVS es) noexcept
 Squared L2 norm of an array-like argument over given axes.
 
template<class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_xexpression< E > > = 0>
auto norm_l2 (E &&e, EVS es=EVS()) noexcept
 L2 norm of a scalar or array-like argument.
 
template<class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_xexpression< E >, xtl::negation< is_reducer_options< X > > > = 0>
auto norm_l2 (E &&e, X &&axes, EVS es=EVS()) noexcept
 L2 norm of an array-like argument over given axes.
 
template<class E , class I , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto norm_l2 (E &&e, const I(&axes)[N], EVS es=EVS()) noexcept
 
template<class E , class X , class EVS , class >
auto norm_linf (E &&e, X &&axes, EVS es) noexcept
 Infinity (maximum) norm of an array-like argument over given axes.
 
template<class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > > > = 0>
auto norm_lp_to_p (E &&e, double p, X &&axes, EVS es=EVS()) noexcept
 p-th power of the Lp norm of an array-like argument over given axes.
 
template<class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_xexpression< E > > = 0>
auto norm_lp_to_p (E &&e, double p, EVS es=EVS()) noexcept
 
template<class E , class I , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto norm_lp_to_p (E &&e, double p, const I(&axes)[N], EVS es=EVS()) noexcept
 
template<class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > > > = 0>
auto norm_lp (E &&e, double p, X &&axes, EVS es=EVS())
 Lp norm of an array-like argument over given axes.
 
template<class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_xexpression< E > > = 0>
auto norm_lp (E &&e, double p, EVS es=EVS())
 
template<class E , class I , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto norm_lp (E &&e, double p, const I(&axes)[N], EVS es=EVS())
 
template<class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_xexpression< E > > = 0>
auto norm_induced_l1 (E &&e, EVS es=EVS())
 Induced L1 norm of a matrix.
 
template<class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_xexpression< E > > = 0>
auto norm_induced_linf (E &&e, EVS es=EVS())
 Induced L-infinity norm of a matrix.
 
template<typename E >
void dump_npy (const std::string &filename, const xexpression< E > &e)
 Save xexpression to NumPy npy format.
 
template<typename E >
std::string dump_npy (const xexpression< E > &e)
 Save xexpression to NumPy npy format in a string.
 
template<typename T , layout_type L = layout_type::dynamic>
auto load_npy (std::istream &stream)
 Loads a npy file (the NumPy storage format)
 
template<typename T , layout_type L = layout_type::dynamic>
auto load_npy (const std::string &filename)
 Loads a npy file (the NumPy storage format)
 
template<class E >
auto operator+ (E &&e) noexcept -> detail::xfunction_type_t< detail::identity, E >
 Identity.
 
template<class E >
auto operator- (E &&e) noexcept -> detail::xfunction_type_t< detail::negate, E >
 Opposite.
 
template<class E1 , class E2 >
auto operator+ (E1 &&e1, E2 &&e2) noexcept -> detail::xfunction_type_t< detail::plus, E1, E2 >
 Addition.
 
template<class E1 , class E2 >
auto operator- (E1 &&e1, E2 &&e2) noexcept -> detail::xfunction_type_t< detail::minus, E1, E2 >
 Substraction.
 
template<class E1 , class E2 >
auto operator* (E1 &&e1, E2 &&e2) noexcept -> detail::xfunction_type_t< detail::multiplies, E1, E2 >
 Multiplication.
 
template<class E1 , class E2 >
auto operator/ (E1 &&e1, E2 &&e2) noexcept -> detail::xfunction_type_t< detail::divides, E1, E2 >
 Division.
 
template<class E1 , class E2 >
auto operator% (E1 &&e1, E2 &&e2) noexcept -> detail::xfunction_type_t< detail::modulus, E1, E2 >
 Modulus.
 
template<class E1 , class E2 >
auto operator|| (E1 &&e1, E2 &&e2) noexcept -> detail::xfunction_type_t< detail::logical_or, E1, E2 >
 Or.
 
template<class E1 , class E2 >
auto operator&& (E1 &&e1, E2 &&e2) noexcept -> detail::xfunction_type_t< detail::logical_and, E1, E2 >
 And.
 
template<class E >
auto operator! (E &&e) noexcept -> detail::xfunction_type_t< detail::logical_not, E >
 Not.
 
template<class E1 , class E2 >
auto operator& (E1 &&e1, E2 &&e2) noexcept -> detail::xfunction_type_t< detail::bitwise_and, E1, E2 >
 Bitwise and.
 
template<class E1 , class E2 >
auto operator| (E1 &&e1, E2 &&e2) noexcept -> detail::xfunction_type_t< detail::bitwise_or, E1, E2 >
 Bitwise or.
 
template<class E1 , class E2 >
auto operator^ (E1 &&e1, E2 &&e2) noexcept -> detail::xfunction_type_t< detail::bitwise_xor, E1, E2 >
 Bitwise xor.
 
template<class E >
auto operator~ (E &&e) noexcept -> detail::xfunction_type_t< detail::bitwise_not, E >
 Bitwise not.
 
template<class E1 , class E2 >
auto left_shift (E1 &&e1, E2 &&e2) noexcept -> detail::xfunction_type_t< detail::left_shift, E1, E2 >
 Bitwise left shift.
 
template<class E1 , class E2 >
auto right_shift (E1 &&e1, E2 &&e2) noexcept -> detail::xfunction_type_t< detail::right_shift, E1, E2 >
 Bitwise left shift.
 
template<class E1 , class E2 >
auto operator<< (E1 &&e1, E2 &&e2) noexcept -> detail::shift_return_type_t< detail::left_shift, E1, E2 >
 Bitwise left shift.
 
template<class E1 , class E2 >
auto operator>> (E1 &&e1, E2 &&e2) -> detail::shift_return_type_t< detail::right_shift, E1, E2 >
 Bitwise right shift.
 
template<class E1 , class E2 >
auto operator< (E1 &&e1, E2 &&e2) noexcept -> detail::xfunction_type_t< detail::less, E1, E2 >
 Lesser than.
 
template<class E1 , class E2 >
auto operator<= (E1 &&e1, E2 &&e2) noexcept -> detail::xfunction_type_t< detail::less_equal, E1, E2 >
 Lesser or equal.
 
template<class E1 , class E2 >
auto operator> (E1 &&e1, E2 &&e2) noexcept -> detail::xfunction_type_t< detail::greater, E1, E2 >
 Greater than.
 
template<class E1 , class E2 >
auto operator>= (E1 &&e1, E2 &&e2) noexcept -> detail::xfunction_type_t< detail::greater_equal, E1, E2 >
 Greater or equal.
 
template<class E1 , class E2 >
std::enable_if_t< xoptional_comparable< E1, E2 >::value, booloperator== (const xexpression< E1 > &e1, const xexpression< E2 > &e2)
 Equality.
 
template<class E1 , class E2 >
bool operator!= (const xexpression< E1 > &e1, const xexpression< E2 > &e2)
 Inequality.
 
template<class E1 , class E2 >
auto equal (E1 &&e1, E2 &&e2) noexcept -> detail::xfunction_type_t< detail::equal_to, E1, E2 >
 Element-wise equality.
 
template<class E1 , class E2 >
auto not_equal (E1 &&e1, E2 &&e2) noexcept -> detail::xfunction_type_t< detail::not_equal_to, E1, E2 >
 Element-wise inequality.
 
template<class E1 , class E2 >
auto less (E1 &&e1, E2 &&e2) noexcept -> decltype(std::forward< E1 >(e1)< std::forward< E2 >(e2))
 Lesser than.
 
template<class E1 , class E2 >
auto less_equal (E1 &&e1, E2 &&e2) noexcept -> decltype(std::forward< E1 >(e1)<=std::forward< E2 >(e2))
 Lesser or equal.
 
template<class E1 , class E2 >
auto greater (E1 &&e1, E2 &&e2) noexcept -> decltype(std::forward< E1 >(e1) > std::forward< E2 >(e2))
 Greater than.
 
template<class E1 , class E2 >
auto greater_equal (E1 &&e1, E2 &&e2) noexcept -> decltype(std::forward< E1 >(e1) >=std::forward< E2 >(e2))
 Greater or equal.
 
template<class E1 , class E2 , class E3 >
auto where (E1 &&e1, E2 &&e2, E3 &&e3) noexcept -> detail::xfunction_type_t< detail::conditional_ternary, E1, E2, E3 >
 Ternary selection.
 
template<class T >
auto nonzero (const T &arr)
 return vector of indices where T is not zero
 
template<class T >
auto where (const T &condition)
 return vector of indices where condition is true (equivalent to nonzero(condition))
 
template<layout_type L = ::xt::layout_type::row_major, class T >
auto argwhere (const T &arr)
 return vector of indices where arr is not zero
 
template<class E >
bool any (E &&e)
 Any.
 
template<class E >
bool all (E &&e)
 Any.
 
template<class R , class E >
auto cast (E &&e) noexcept -> detail::xfunction_type_t< typename detail::cast< R >::functor, E >
 Element-wise static_cast.
 
template<class T , class B >
auto sign (const xtl::xoptional< T, B > &e)
 
template<class E , xtl::check_concept< is_xexpression< E > > = 0>
auto value (E &&e) -> detail::value_expression_t< E >
 
template<class E , xtl::check_concept< is_xexpression< E > > = 0>
auto has_value (E &&e) -> detail::flag_expression_t< E >
 
template<class VE , class FE >
bool operator== (const xoptional_assembly_storage< VE, FE > &lhs, const xoptional_assembly_storage< VE, FE > &rhs)
 
template<class VE , class FE >
bool operator!= (const xoptional_assembly_storage< VE, FE > &lhs, const xoptional_assembly_storage< VE, FE > &rhs)
 
template<class VE , class FE >
bool operator< (const xoptional_assembly_storage< VE, FE > &lhs, const xoptional_assembly_storage< VE, FE > &rhs)
 
template<class VE , class FE >
bool operator<= (const xoptional_assembly_storage< VE, FE > &lhs, const xoptional_assembly_storage< VE, FE > &rhs)
 
template<class VE , class FE >
bool operator> (const xoptional_assembly_storage< VE, FE > &lhs, const xoptional_assembly_storage< VE, FE > &rhs)
 
template<class VE , class FE >
bool operator>= (const xoptional_assembly_storage< VE, FE > &lhs, const xoptional_assembly_storage< VE, FE > &rhs)
 
template<class VE , class FE >
void swap (xoptional_assembly_storage< VE, FE > &lhs, xoptional_assembly_storage< VE, FE > &rhs) noexcept
 
template<class VE , class FE >
xoptional_assembly_storage< VE, FEoptional_assembly_storage (const VE &value, const FE &flag)
 
template<class VE , class FE >
xoptional_assembly_storage< VE, FEoptional_assembly_storage (VE &value, FE &flag)
 
template<class E , class S = typename std::decay_t<E>::size_type, class V = typename std::decay_t<E>::value_type>
auto pad (E &&e, const std::vector< std::vector< S > > &pad_width, pad_mode mode=pad_mode::constant, V constant_value=0)
 Pad an array.
 
template<class E , class S = typename std::decay_t<E>::size_type, class V = typename std::decay_t<E>::value_type>
auto pad (E &&e, const std::vector< S > &pad_width, pad_mode mode=pad_mode::constant, V constant_value=0)
 Pad an array.
 
template<class E , class S = typename std::decay_t<E>::size_type, class V = typename std::decay_t<E>::value_type>
auto pad (E &&e, S pad_width, pad_mode mode=pad_mode::constant, V constant_value=0)
 Pad an array.
 
template<class E , class S = typename std::decay_t<E>::size_type>
auto tile (E &&e, std::initializer_list< S > reps)
 Tile an array.
 
template<class E , class C , xtl::check_concept< xtl::negation< xtl::is_integral< C > > > = 0>
auto tile (E &&e, const C &reps)
 
template<class E , class S = typename std::decay_t<E>::size_type, xtl::check_concept< xtl::is_integral< S > > = 0>
auto tile (E &&e, S reps)
 Tile an array.
 
template<template< class... > class A, class... AX, class X , xtl::check_concept< is_evaluation_strategy< AX >..., is_evaluation_strategy< X > > = 0>
auto operator| (const A< AX... > &args, const A< X > &rhs)
 
template<class T >
constexpr auto initial (T val)
 
template<class F , class E , class R , xtl::check_concept< std::is_convertible< typename E::value_type, typename R::value_type > > = 0>
void copy_to_reduced (F &, const E &e, R &result)
 
template<class F , class E , class X , class O >
auto reduce_immediate (F &&f, E &&e, X &&axes, O &&raw_options)
 
template<class RF >
auto make_xreducer_functor (RF &&reduce_func)
 
template<class RF , class IF >
auto make_xreducer_functor (RF &&reduce_func, IF &&init_func)
 
template<class RF , class IF , class MF >
auto make_xreducer_functor (RF &&reduce_func, IF &&init_func, MF &&merge_func)
 
template<class F , class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > >, detail::is_xreducer_functors< F > > = 0>
auto reduce (F &&f, E &&e, X &&axes, EVS &&options=EVS())
 Returns an xexpression applying the specified reducing function to an expression over the given axes.
 
template<class F , class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS >, detail::is_xreducer_functors< F > > = 0>
auto reduce (F &&f, E &&e, EVS &&options=EVS())
 
template<class F , class E , class I , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< detail::is_xreducer_functors< F > > = 0>
auto reduce (F &&f, E &&e, const I(&axes)[N], EVS options=EVS())
 
template<class T >
xscalar< T & > xref (T &t)
 
template<class T >
xscalar< const T & > xcref (T &t)
 
template<bool is_const, class CT >
bool operator== (const xdummy_iterator< is_const, CT > &lhs, const xdummy_iterator< is_const, CT > &rhs) noexcept
 
template<bool is_const, class CT >
bool operator< (const xdummy_iterator< is_const, CT > &lhs, const xdummy_iterator< is_const, CT > &rhs) noexcept
 
template<class CT >
constexpr auto linear_begin (xscalar< CT > &c) noexcept -> decltype(c.dummy_begin())
 
template<class CT >
constexpr auto linear_end (xscalar< CT > &c) noexcept -> decltype(c.dummy_end())
 
template<class CT >
constexpr auto linear_begin (const xscalar< CT > &c) noexcept -> decltype(c.dummy_begin())
 
template<class CT >
constexpr auto linear_end (const xscalar< CT > &c) noexcept -> decltype(c.dummy_end())
 
template<class E , class T >
auto isin (E &&element, std::initializer_list< T > test_elements) noexcept
 isin
 
template<class E , class F , class = typename std::enable_if_t<has_iterator_interface<F>::value>>
auto isin (E &&element, F &&test_elements) noexcept
 isin
 
template<class E , class I , class = typename std::enable_if_t<is_iterator<I>::value>>
auto isin (E &&element, I &&test_elements_begin, I &&test_elements_end) noexcept
 isin
 
template<class E , class T >
auto in1d (E &&element, std::initializer_list< T > test_elements) noexcept
 in1d
 
template<class E , class F , class = typename std::enable_if_t<has_iterator_interface<F>::value>>
auto in1d (E &&element, F &&test_elements) noexcept
 in1d
 
template<class E , class I , class = typename std::enable_if_t<is_iterator<I>::value>>
auto in1d (E &&element, I &&test_elements_begin, I &&test_elements_end) noexcept
 in1d
 
template<class E1 , class E2 >
auto searchsorted (E1 &&a, E2 &&v, bool right=true)
 Find indices where elements should be inserted to maintain order.
 
template<class S1 , class S2 >
bool same_shape (const S1 &s1, const S2 &s2) noexcept
 Check if two objects have the same shape.
 
template<class R , class T >
constexpr R shape (T t)
 
template<class R = std::size_t, class T , std::size_t N>
xt::static_shape< R, N > shape (const T(&list)[N])
 Generate an xt::static_shape of the given size.
 
template<class E , class S >
bool has_shape (const E &e, std::initializer_list< S > shape) noexcept
 Check if an object has a certain shape.
 
template<class E , class S , class = typename std::enable_if_t<has_iterator_interface<S>::value>>
bool has_shape (const E &e, const S &shape)
 Check if an object has a certain shape.
 
auto all () noexcept
 Returns a slice representing a full dimension, to be used as an argument of view function.
 
auto ellipsis () noexcept
 Returns a slice representing all remaining dimensions, and selecting all in these dimensions.
 
auto newaxis () noexcept
 Returns a slice representing a new axis of length one, to be used as an argument of view function.
 
template<class T >
detail::disable_integral_keep< T > keep (T &&indices)
 Create a non-contigous slice from a container of indices to keep.
 
template<class R = std::ptrdiff_t, class T >
detail::enable_integral_keep< T, Rkeep (T i)
 
template<class R = std::ptrdiff_t, class Arg0 , class Arg1 , class... Args>
xkeep_slice< Rkeep (Arg0 i0, Arg1 i1, Args... args)
 
template<class T >
detail::disable_integral_drop< T > drop (T &&indices)
 Create a non-contigous slice from a container of indices to drop.
 
template<class R = std::ptrdiff_t, class T >
detail::enable_integral_drop< T, Rdrop (T i)
 
template<class R = std::ptrdiff_t, class Arg0 , class Arg1 , class... Args>
xdrop_slice< Rdrop (Arg0 i0, Arg1 i1, Args... args)
 
auto xnone ()
 
template<class A , class B >
auto range (A start_val, B stop_val)
 Select a range from start_val to stop_val (excluded).
 
template<class A , class B , class C >
auto range (A start_val, B stop_val, C step)
 Select a range from start_val to stop_val (excluded) with step You can use the shorthand _ syntax to select from the start or until the end.
 
template<class S >
disable_xslice< S, std::size_t > get_size (const S &) noexcept
 
template<class S >
auto get_size (const xslice< S > &slice) noexcept
 
template<class S >
disable_xslice< S, std::size_t > step_size (const S &, std::size_t) noexcept
 
template<class S >
disable_xslice< S, std::size_t > step_size (const S &, std::size_t, std::size_t) noexcept
 
template<class S >
auto step_size (const xslice< S > &slice, std::size_t idx) noexcept
 
template<class S >
auto step_size (const xslice< S > &slice, std::size_t idx, std::size_t n) noexcept
 
template<class S , class I >
disable_xslice< S, std::size_t > value (const S &s, I) noexcept
 
template<class S , class I >
auto value (const xslice< S > &slice, I i) noexcept
 
template<class E , class SL >
auto get_slice_implementation (E &e, SL &&slice, std::size_t index)
 
template<class E >
auto sort (const xexpression< E > &e, placeholders::xtuph)
 
template<class E >
auto sort (const xexpression< E > &e, std::ptrdiff_t axis=-1)
 Sort xexpression (optionally along axis) The sort is performed using the std::sort functions.
 
template<class E >
auto argsort (const xexpression< E > &e, placeholders::xtuph, sorting_method method=sorting_method::quick)
 
template<class E >
auto argsort (const xexpression< E > &e, std::ptrdiff_t axis=-1, sorting_method method=sorting_method::quick)
 Argsort xexpression (optionally along axis) Performs an indirect sort along the given axis.
 
template<class E , class C , class R = detail::flatten_sort_result_type_t<E>, class = std::enable_if_t<!xtl::is_integral<C>::value, int>>
R partition (const xexpression< E > &e, C kth_container, placeholders::xtuph)
 Partially sort xexpression.
 
template<class E , class I , std::size_t N, class R = detail::flatten_sort_result_type_t<E>>
R partition (const xexpression< E > &e, const I(&kth_container)[N], placeholders::xtuph tag)
 
template<class E , class R = detail::flatten_sort_result_type_t<E>>
R partition (const xexpression< E > &e, std::size_t kth, placeholders::xtuph tag)
 
template<class E , class C , class = std::enable_if_t<!xtl::is_integral<C>::value, int>>
auto partition (const xexpression< E > &e, C kth_container, std::ptrdiff_t axis=-1)
 
template<class E , class T , std::size_t N>
auto partition (const xexpression< E > &e, const T(&kth_container)[N], std::ptrdiff_t axis=-1)
 
template<class E >
auto partition (const xexpression< E > &e, std::size_t kth, std::ptrdiff_t axis=-1)
 
template<class E , class C , class R = typename detail::linear_argsort_result_type<typename detail::sort_eval_type<E>::type>::type, class = std::enable_if_t<!xtl::is_integral<C>::value, int>>
R argpartition (const xexpression< E > &e, C kth_container, placeholders::xtuph)
 Partially sort arguments.
 
template<class E , class I , std::size_t N>
auto argpartition (const xexpression< E > &e, const I(&kth_container)[N], placeholders::xtuph tag)
 
template<class E >
auto argpartition (const xexpression< E > &e, std::size_t kth, placeholders::xtuph tag)
 
template<class E , class C , class = std::enable_if_t<!xtl::is_integral<C>::value, int>>
auto argpartition (const xexpression< E > &e, C kth_container, std::ptrdiff_t axis=-1)
 
template<class E , class I , std::size_t N>
auto argpartition (const xexpression< E > &e, const I(&kth_container)[N], std::ptrdiff_t axis=-1)
 
template<class E >
auto argpartition (const xexpression< E > &e, std::size_t kth, std::ptrdiff_t axis=-1)
 
template<class T = double, class E , class P >
auto quantile (E &&e, const P &probas, std::ptrdiff_t axis, T alpha, T beta)
 Compute quantiles over the given axis.
 
template<class T = double, class E , std::size_t N>
auto quantile (E &&e, const T(&probas)[N], std::ptrdiff_t axis, T alpha, T beta)
 
template<class T = double, class E , class P >
auto quantile (E &&e, const P &probas, T alpha, T beta)
 Compute quantiles of the whole expression.
 
template<class T = double, class E , std::size_t N>
auto quantile (E &&e, const T(&probas)[N], T alpha, T beta)
 
template<class T = double, class E , class P >
auto quantile (E &&e, const P &probas, std::ptrdiff_t axis, quantile_method method=quantile_method::linear)
 Compute quantiles over the given axis.
 
template<class T = double, class E , std::size_t N>
auto quantile (E &&e, const T(&probas)[N], std::ptrdiff_t axis, quantile_method method=quantile_method::linear)
 
template<class T = double, class E , class P >
auto quantile (E &&e, const P &probas, quantile_method method=quantile_method::linear)
 Compute quantiles of the whole expression.
 
template<class T = double, class E , std::size_t N>
auto quantile (E &&e, const T(&probas)[N], quantile_method method=quantile_method::linear)
 
template<class E >
std::decay_t< E >::value_type median (E &&e)
 
template<class E >
auto median (E &&e, std::ptrdiff_t axis)
 Find the median along the specified axis.
 
template<layout_type L = ::xt::layout_type::row_major, class E >
auto argmin (const xexpression< E > &e)
 
template<layout_type L = ::xt::layout_type::row_major, class E >
auto argmin (const xexpression< E > &e, std::ptrdiff_t axis)
 Find position of minimal value in xexpression.
 
template<layout_type L = ::xt::layout_type::row_major, class E >
auto argmax (const xexpression< E > &e)
 
template<layout_type L = ::xt::layout_type::row_major, class E >
auto argmax (const xexpression< E > &e, std::ptrdiff_t axis)
 Find position of maximal value in xexpression By default, the returned index is into the flattened array.
 
template<class E >
auto unique (const xexpression< E > &e)
 Find unique elements of a xexpression.
 
template<class E1 , class E2 >
auto setdiff1d (const xexpression< E1 > &ar1, const xexpression< E2 > &ar2)
 Find the set difference of two xexpressions.
 
template<class T , class A >
bool operator== (const uvector< T, A > &lhs, const uvector< T, A > &rhs)
 
template<class T , class A >
bool operator!= (const uvector< T, A > &lhs, const uvector< T, A > &rhs)
 
template<class T , class A >
bool operator< (const uvector< T, A > &lhs, const uvector< T, A > &rhs)
 
template<class T , class A >
bool operator<= (const uvector< T, A > &lhs, const uvector< T, A > &rhs)
 
template<class T , class A >
bool operator> (const uvector< T, A > &lhs, const uvector< T, A > &rhs)
 
template<class T , class A >
bool operator>= (const uvector< T, A > &lhs, const uvector< T, A > &rhs)
 
template<class T , class A >
void swap (uvector< T, A > &lhs, uvector< T, A > &rhs) noexcept
 
template<class T , std::size_t N, class A , bool Init>
bool operator== (const std::vector< T > &lhs, const svector< T, N, A, Init > &rhs)
 
template<class T , std::size_t N, class A , bool Init>
bool operator== (const svector< T, N, A, Init > &lhs, const std::vector< T > &rhs)
 
template<class T , std::size_t N, class A , bool Init>
bool operator== (const svector< T, N, A, Init > &lhs, const svector< T, N, A, Init > &rhs)
 
template<class T , std::size_t N, class A , bool Init>
bool operator!= (const svector< T, N, A, Init > &lhs, const svector< T, N, A, Init > &rhs)
 
template<class T , std::size_t N, class A , bool Init>
bool operator< (const svector< T, N, A, Init > &lhs, const svector< T, N, A, Init > &rhs)
 
template<class T , std::size_t N, class A , bool Init>
bool operator<= (const svector< T, N, A, Init > &lhs, const svector< T, N, A, Init > &rhs)
 
template<class T , std::size_t N, class A , bool Init>
bool operator> (const svector< T, N, A, Init > &lhs, const svector< T, N, A, Init > &rhs)
 
template<class T , std::size_t N, class A , bool Init>
bool operator>= (const svector< T, N, A, Init > &lhs, const svector< T, N, A, Init > &rhs)
 
template<class T , std::size_t N, class A , bool Init>
void swap (svector< T, N, A, Init > &lhs, svector< T, N, A, Init > &rhs) noexcept
 
template<class T , std::size_t N>
bool operator== (const const_array< T, N > &lhs, const const_array< T, N > &rhs)
 
template<class T , std::size_t N>
bool operator!= (const const_array< T, N > &lhs, const const_array< T, N > &rhs)
 
template<class T , std::size_t N>
bool operator< (const const_array< T, N > &lhs, const const_array< T, N > &rhs)
 
template<class T , std::size_t N>
bool operator<= (const const_array< T, N > &lhs, const const_array< T, N > &rhs)
 
template<class T , std::size_t N>
bool operator> (const const_array< T, N > &lhs, const const_array< T, N > &rhs)
 
template<class T , std::size_t N>
bool operator>= (const const_array< T, N > &lhs, const const_array< T, N > &rhs)
 
template<class T , std::ptrdiff_t TB, std::ptrdiff_t TE>
bool operator== (const sequence_view< T, TB, TE > &lhs, const sequence_view< T, TB, TE > &rhs)
 
template<class T , std::ptrdiff_t TB, std::ptrdiff_t TE>
bool operator!= (const sequence_view< T, TB, TE > &lhs, const sequence_view< T, TB, TE > &rhs)
 
template<class shape_type >
std::size_t compute_size (const shape_type &shape) noexcept
 
template<class offset_type , class S >
offset_type data_offset (const S &strides) noexcept
 
template<class offset_type , class S , class Arg , class... Args>
offset_type data_offset (const S &strides, Arg arg, Args... args) noexcept
 Return the flat index for an array index.
 
template<class offset_type , layout_type L = layout_type::dynamic, class S , class... Args>
offset_type unchecked_data_offset (const S &strides, Args... args) noexcept
 
template<class offset_type , class S , class It >
offset_type element_offset (const S &strides, It first, It last) noexcept
 
template<layout_type L = layout_type::dynamic, class shape_type , class strides_type >
std::size_t compute_strides (const shape_type &shape, layout_type l, strides_type &strides)
 Compute the strides given the shape and the layout of an array.
 
template<layout_type L = layout_type::dynamic, class shape_type , class strides_type , class backstrides_type >
std::size_t compute_strides (const shape_type &shape, layout_type l, strides_type &strides, backstrides_type &backstrides)
 
template<class shape_type , class strides_type >
void adapt_strides (const shape_type &shape, strides_type &strides) noexcept
 
template<class shape_type , class strides_type , class backstrides_type >
void adapt_strides (const shape_type &shape, strides_type &strides, backstrides_type &backstrides) noexcept
 
template<class S >
S unravel_from_strides (typename S::value_type index, const S &strides, layout_type l=layout_type::row_major)
 
template<class S >
get_strides_t< Sunravel_index (typename S::value_type index, const S &shape, layout_type l=layout_type::row_major)
 
template<class S , class T >
std::vector< get_strides_t< S > > unravel_indices (const T &indices, const S &shape, layout_type l=layout_type::row_major)
 
template<class S , class size_type >
S uninitialized_shape (size_type size)
 
template<class S1 , class S2 >
bool broadcast_shape (const S1 &input, S2 &output)
 
template<class S1 , class S2 >
bool broadcastable (const S1 &s1, S2 &s2)
 
template<class S , class... Args>
bool in_bounds (const S &shape, Args &... args)
 Check if the index is within the bounds of the array.
 
template<class S , class... Args>
void normalize_periodic (const S &shape, Args &... args)
 Normalise an index of a periodic array.
 
template<class C , class It , class size_type >
It strided_data_end (const C &c, It begin, layout_type l, size_type offset)
 
template<class E >
auto strides (const E &e, stride_type type=stride_type::normal) noexcept
 Get strides of an object.
 
template<class E >
auto strides (const E &e, std::size_t axis, stride_type type=stride_type::normal) noexcept
 Get stride of an object along an axis.
 
template<class T1 , class T2 >
bool stride_match_condition (const T1 &stride, const T2 &shape, const T1 &data_size, bool zero_strides)
 
template<class shape_type , class strides_type >
bool do_strides_match (const shape_type &shape, const strides_type &strides, layout_type l, bool zero_strides)
 
template<class S , class T >
get_value_type_t< T > ravel_from_strides (const T &index, const S &strides)
 
template<class S , class T >
get_value_type_t< T > ravel_index (const T &index, const S &shape, layout_type l)
 
template<class S , class stype >
S uninitialized_shape (stype size)
 
template<class S1 , class S2 >
bool broadcastable (const S1 &src_shape, const S2 &dst_shape)
 
template<class S , class... Args>
bool check_in_bounds (const S &shape, Args &... args)
 
template<std::size_t I, class... Args>
constexpr decltype(autoargument (Args &&... args) noexcept
 
template<class R , class F , class... S>
R apply (std::size_t index, F &&func, const std::tuple< S... > &s) noexcept(noexcept(func(std::get< 0 >(s))))
 
template<class T , class S >
void nested_copy (T &&iter, const S &s)
 
template<class T , class S >
void nested_copy (T &&iter, std::initializer_list< S > s)
 
template<class C >
bool resize_container (C &c, typename C::size_type size)
 
template<class T , std::size_t N>
bool resize_container (std::array< T, N > &a, typename std::array< T, N >::size_type size)
 
template<std::size_t... I>
bool resize_container (fixed_shape< I... > &a, std::size_t size)
 
std::size_t normalize_axis (std::size_t dim, std::ptrdiff_t axis)
 
template<class F , class... T>
void for_each (F &&f, std::tuple< T... > &t) noexcept(noexcept(detail::for_each_impl< 0, F, T... >(std::forward< F >(f), t)))
 
template<class F , class... T>
void for_each (F &&f, const std::tuple< T... > &t) noexcept(noexcept(detail::for_each_impl< 0, F, T... >(std::forward< F >(f), t)))
 
template<class E , class C >
std::enable_if_t< !xtl::is_integral< std::decay_t< C > >::value &&xtl::is_signed< typename std::decay_t< C >::value_type >::value, rebind_container_t< std::size_t, std::decay_t< C > > > normalize_axis (E &expr, C &&axes)
 
template<class C , class E >
std::enable_if_t< !xtl::is_integral< std::decay_t< C > >::value &&std::is_unsigned< typename std::decay_t< C >::value_type >::value, C && > normalize_axis (E &expr, C &&axes)
 
template<class R , class E , class C >
auto forward_normalize (E &expr, C &&axes) -> std::enable_if_t< xtl::is_signed< std::decay_t< decltype(*std::begin(axes))> >::value, R >
 
template<std::size_t I, template< typename... Args > class T, typename... Args>
decltype(autoget (T< Args... > &&v)
 
template<std::size_t I, template< typename... Args > class T, typename... Args>
decltype(autoget (T< Args... > &v)
 
template<std::size_t I, template< typename... Args > class T, typename... Args>
decltype(autoget (const T< Args... > &v)
 
template<class T , std::size_t N>
constexpr std::array< std::remove_cv_t< T >, N > to_array (T(&a)[N])
 
template<class C >
constexpr auto sequence_size (const C &c) -> decltype(c.size())
 
template<class T , std::size_t N>
constexpr std::size_t sequence_size (const T(&)[N])
 
template<bool condition, class T , class U >
auto conditional_cast (U &&u)
 Perform a type cast when a condition is true.
 
template<class T , class AT , alloc_tracking::policy PT, class U , class AU , alloc_tracking::policy PU>
bool operator== (const tracking_allocator< T, AT, PT > &, const tracking_allocator< U, AU, PU > &)
 
template<class T , class AT , alloc_tracking::policy PT, class U , class AU , alloc_tracking::policy PU>
bool operator!= (const tracking_allocator< T, AT, PT > &a, const tracking_allocator< U, AU, PU > &b)
 
template<class Dst >
auto make_overlapping_memory_checker (const Dst &a_dst)
 
template<class R , class... Args>
xvectorizer< R(*)(Args...), Rvectorize (R(*f)(Args...))
 
template<class F , class R , class... Args>
xvectorizer< F, Rvectorize (F &&f, R(*)(Args...))
 
template<class F >
auto vectorize (F &&f) -> decltype(vectorize(std::forward< F >(f), std::declval< detail::get_function_type< F > * >()))
 
template<class... S>
constexpr std::size_t integral_count ()
 
template<class... S>
constexpr std::size_t integral_count_before (std::size_t i)
 
template<class... S>
constexpr std::size_t integral_skip (std::size_t i)
 
template<class... S>
constexpr std::size_t newaxis_count ()
 
template<class... S>
constexpr std::size_t newaxis_count_before (std::size_t i)
 
template<class... S>
constexpr std::size_t newaxis_skip (std::size_t i)
 
template<class S , class It >
disable_xslice< S, std::size_t > get_slice_value (const S &s, It &) noexcept
 
template<class S , class It >
auto get_slice_value (const xslice< S > &slice, It &it) noexcept
 
Reference
template<class CT >
bool operator== (const xaxis_iterator< CT > &lhs, const xaxis_iterator< CT > &rhs)
 Checks equality of the iterators.
 
template<class CT >
bool operator!= (const xaxis_iterator< CT > &lhs, const xaxis_iterator< CT > &rhs)
 Checks inequality of the iterators.
 
template<class CT >
bool operator== (const xaxis_slice_iterator< CT > &lhs, const xaxis_slice_iterator< CT > &rhs)
 Checks equality of the iterators.
 
template<class CT >
bool operator!= (const xaxis_slice_iterator< CT > &lhs, const xaxis_slice_iterator< CT > &rhs)
 Checks inequality of the iterators.
 
Iterators
template<class E >
auto axis_begin (E &&e)
 Returns an iterator to the first element of the expression for axis 0.
 
template<class E >
auto axis_begin (E &&e, typename std::decay_t< E >::size_type axis)
 Returns an iterator to the first element of the expression for the specified axis.
 
template<class E >
auto axis_end (E &&e)
 Returns an iterator to the element following the last element of the expression for axis 0.
 
template<class E >
auto axis_end (E &&e, typename std::decay_t< E >::size_type axis)
 Returns an iterator to the element following the last element of the expression for the specified axis.
 
template<class E >
auto axis_slice_begin (E &&e)
 Returns an iterator to the first element of the expression for axis 0.
 
template<class E >
auto axis_slice_begin (E &&e, typename std::decay_t< E >::size_type axis)
 Returns an iterator to the first element of the expression for the specified axis.
 
template<class E >
auto axis_slice_end (E &&e)
 Returns an iterator to the element following the last element of the expression for axis 0.
 
template<class E >
auto axis_slice_end (E &&e, typename std::decay_t< E >::size_type axis)
 Returns an iterator to the element following the last element of the expression for the specified axis.
 
Broadcasting
template<class F , class... CT>
bool operator== (const xfunction_iterator< F, CT... > &it1, const xfunction_iterator< F, CT... > &it2)
 
template<class F , class... CT>
bool operator< (const xfunction_iterator< F, CT... > &it1, const xfunction_iterator< F, CT... > &it2)
 
template<class E , class... S>
auto view (E &&e, S &&... slices)
 Constructs and returns a view on the specified xexpression.
 
template<class E >
auto row (E &&e, std::ptrdiff_t index)
 Constructs and returns a row (sliced view) on the specified expression.
 
template<class E >
auto col (E &&e, std::ptrdiff_t index)
 Constructs and returns a column (sliced view) on the specified expression.
 
Computed assignement
template<class E , class I >
auto index_view (E &&e, I &&indices) noexcept
 creates an indexview from a container of indices.
 
template<class E , std::size_t L>
auto index_view (E &&e, const xindex(&indices)[L]) noexcept
 
template<layout_type L = ::xt::layout_type::row_major, class E , class O >
auto filter (E &&e, O &&condition) noexcept
 creates a view into e filtered by condition.
 
template<class E , class C >
auto filtration (E &&e, C &&condition) noexcept
 creates a filtration of e filtered by condition.
 
Data
template<class CTD , class CTM >
xmasked_view< CTD, CTMmasked_view (CTD &&data, CTM &&mask)
 
template<layout_type L = layout_type::dynamic, class E , class S , class X >
auto strided_view (E &&e, S &&shape, X &&strides, std::size_t offset, layout_type layout) noexcept
 Construct a strided view from an xexpression, shape, strides and offset.
 
template<class E >
auto strided_view (E &&e, const xstrided_slice_vector &slices)
 Function to create a dynamic view from an xexpression and an xstrided_slice_vector.
 
template<layout_type L = ::xt::layout_type::row_major, class E , class S >
auto reshape_view (E &&e, S &&shape)
 
template<layout_type L = ::xt::layout_type::row_major, class E , class S >
auto reshape_view (E &&e, S &&shape, layout_type)
 Return a view on a container with a new shape.
 
template<layout_type L = ::xt::layout_type::row_major, class E , class I , std::size_t N>
auto reshape_view (E &&e, const I(&shape)[N], layout_type order)
 
template<layout_type L = ::xt::layout_type::row_major, class E , class I , std::size_t N>
auto reshape_view (E &&e, const I(&shape)[N])
 

Variables

constexpr auto keep_dims = std::tuple<keep_dims_type>{}
 

Downcast functions

template<template< class > class B, class E >
using is_crtp_base_of = detail::is_crtp_base_of_impl<B, std::decay_t<E>>
 
template<class E >
using is_xexpression = is_crtp_base_of<xexpression, E>
 
template<class E , class R = void>
using enable_xexpression = typename std::enable_if<is_xexpression<E>::value, R>::type
 
template<class E , class R = void>
using disable_xexpression = typename std::enable_if<!is_xexpression<E>::value, R>::type
 
template<class... E>
using has_xexpression = xtl::disjunction<is_xexpression<E>...>
 
template<class E >
using is_xsharable_expression = is_crtp_base_of<xsharable_expression, E>
 
template<class E , class R = void>
using enable_xsharable_expression = typename std::enable_if<is_xsharable_expression<E>::value, R>::type
 
template<class E , class R = void>
using disable_xsharable_expression = typename std::enable_if<!is_xsharable_expression<E>::value, R>::type
 
template<class LHS , class RHS , class R = void>
using enable_assignable_expression = typename std::enable_if<can_assign<LHS, RHS>::value, R>::type
 
template<class LHS , class RHS , class R = void>
using enable_not_assignable_expression = typename std::enable_if<!can_assign<LHS, RHS>::value, R>::type
 
template<class E >
using xclosure_t = typename xclosure<E>::type
 
template<class E >
using const_xclosure_t = typename const_xclosure<E>::type
 
template<class... T>
using xexpression_tag_t = typename xexpression_tag<T...>::type
 
template<class E >
xshared_expression< E > make_xshared (xexpression< E > &&expr)
 Helper function to create shared expression from any xexpression.
 
template<class E >
auto share (xexpression< E > &expr)
 Helper function to create shared expression from any xexpression.
 
template<class E >
auto share (xexpression< E > &&expr)
 Helper function to create shared expression from any xexpression.
 

Extended copy semantic

template<class C , class Tag >
using ravel_return_type_t = typename detail::ravel_return_type<C, Tag>::type
 
template<class F , class IT >
bool operator== (const xfunctor_iterator< F, IT > &lhs, const xfunctor_iterator< F, IT > &rhs)
 
template<class F , class IT >
bool operator< (const xfunctor_iterator< F, IT > &lhs, const xfunctor_iterator< F, IT > &rhs)
 
template<class T >
auto from_indices (const std::vector< T > &idx)
 Converts std::vector<index_type> (returned e.g.
 
template<class T >
auto flatten_indices (const std::vector< T > &idx)
 Converts std::vector<index_type> (returned e.g.
 
template<class Tag = ravel_tensor_tag, class C , class S >
ravel_return_type_t< C, Tagravel_indices (const C &idx, const S &shape, layout_type l=layout_type::row_major)
 Converts std::vector<index_type> (returned e.g.
 

Detailed Description

standard mathematical functions for xexpressions

functions to obtain xgenerators generating random numbers with given shape

Typedef Documentation

◆ all_xscalar

template<class... E>
using xt::all_xscalar = detail::all_xscalar<E...>

Definition at line 334 of file xscalar.hpp.

◆ allocator_type_t

template<class T >
using xt::allocator_type_t = typename detail::allocator_type_impl<T>::type

Definition at line 57 of file xcontainer.hpp.

◆ apply_cv_t

template<class T , class U >
using xt::apply_cv_t = typename apply_cv<T, U>::type

Definition at line 602 of file xutils.hpp.

◆ big_promote_value_type_t

template<class E >
using xt::big_promote_value_type_t = typename big_promote_value_type<E>::type

Definition at line 195 of file xexpression_traits.hpp.

◆ bool_load_type

template<class T >
using xt::bool_load_type = std::conditional_t<std::is_same<T, bool>::value, uint8_t, T>

Definition at line 296 of file xtensor_simd.hpp.

◆ common_difference_type_t

template<class... Args>
using xt::common_difference_type_t = typename common_difference_type<Args...>::type

Definition at line 91 of file xexpression_traits.hpp.

◆ common_size_type_t

template<class... Args>
using xt::common_size_type_t = typename common_size_type<Args...>::type

Definition at line 72 of file xexpression_traits.hpp.

◆ common_tensor_type_t

template<class... C>
using xt::common_tensor_type_t = typename common_tensor_type<C...>::type

Definition at line 182 of file xexpression_traits.hpp.

◆ common_value_type_t

template<class... C>
using xt::common_value_type_t = typename common_value_type<C...>::type

Definition at line 53 of file xexpression_traits.hpp.

◆ const_xclosure_t

template<class E >
using xt::const_xclosure_t = typename const_xclosure<E>::type

Definition at line 294 of file xexpression.hpp.

◆ container_simd_return_type_t

template<class C , class T1 , class T2 >
using xt::container_simd_return_type_t = typename container_simd_return_type<C, T1, T2>::type

Definition at line 330 of file xtensor_simd.hpp.

◆ disable_assignable

template<class E , class R = void>
using xt::disable_assignable = typename std::enable_if<!is_assignable<E>::value, R>::type

Definition at line 163 of file xsemantic.hpp.

◆ disable_indexed_stepper_t

template<class T , class R = T>
using xt::disable_indexed_stepper_t = typename disable_indexed_stepper<T, R>::type

Definition at line 241 of file xiterator.hpp.

◆ disable_integral_t

template<class T , class R >
using xt::disable_integral_t = std::enable_if_t<!xtl::is_integral<T>::value, R>

Definition at line 110 of file xutils.hpp.

◆ disable_xcontainer_semantics

template<class E , class R = void>
using xt::disable_xcontainer_semantics = typename std::enable_if<!has_container_semantics<E>::value, R>::type

Definition at line 218 of file xsemantic.hpp.

◆ disable_xexpression

template<class E , class R = void>
using xt::disable_xexpression = typename std::enable_if<!is_xexpression<E>::value, R>::type

Definition at line 186 of file xexpression.hpp.

◆ disable_xsharable_expression

template<class E , class R = void>
using xt::disable_xsharable_expression = typename std::enable_if<!is_xsharable_expression<E>::value, R>::type

Definition at line 198 of file xexpression.hpp.

◆ disable_xslice

template<class E , class R = void>
using xt::disable_xslice = typename std::enable_if<!is_xslice<E>::value, R>::type

Definition at line 67 of file xslice.hpp.

◆ disable_xview_semantics

template<class E , class R = void>
using xt::disable_xview_semantics = typename std::enable_if<!has_view_semantics<E>::value, R>::type

Definition at line 295 of file xsemantic.hpp.

◆ driven_align_mode_t

template<class A1 , class A2 >
using xt::driven_align_mode_t = typename detail::driven_align_mode_impl<A1, A2>::type

Definition at line 238 of file xtensor_simd.hpp.

◆ dynamic_shape

template<class T >
using xt::dynamic_shape = svector<T, 4>

Definition at line 29 of file xshape.hpp.

◆ enable_assignable

template<class E , class R = void>
using xt::enable_assignable = typename std::enable_if<is_assignable<E>::value, R>::type

Definition at line 160 of file xsemantic.hpp.

◆ enable_assignable_expression

template<class LHS , class RHS , class R = void>
using xt::enable_assignable_expression = typename std::enable_if<can_assign<LHS, RHS>::value, R>::type

Definition at line 206 of file xexpression.hpp.

◆ enable_indexed_stepper_t

template<class T , class R = T>
using xt::enable_indexed_stepper_t = typename enable_indexed_stepper<T, R>::type

Definition at line 233 of file xiterator.hpp.

◆ enable_not_assignable_expression

template<class LHS , class RHS , class R = void>
using xt::enable_not_assignable_expression = typename std::enable_if<!can_assign<LHS, RHS>::value, R>::type

Definition at line 209 of file xexpression.hpp.

◆ enable_xcontainer_semantics

template<class E , class R = void>
using xt::enable_xcontainer_semantics = typename std::enable_if<has_container_semantics<E>::value, R>::type

Definition at line 215 of file xsemantic.hpp.

◆ enable_xexpression

template<class E , class R = void>
using xt::enable_xexpression = typename std::enable_if<is_xexpression<E>::value, R>::type

Definition at line 183 of file xexpression.hpp.

◆ enable_xsharable_expression

template<class E , class R = void>
using xt::enable_xsharable_expression = typename std::enable_if<is_xsharable_expression<E>::value, R>::type

Definition at line 195 of file xexpression.hpp.

◆ enable_xview_semantics

template<class E , class R = void>
using xt::enable_xview_semantics = typename std::enable_if<has_view_semantics<E>::value, R>::type

Definition at line 292 of file xsemantic.hpp.

◆ get_init_type_t

template<class V , class S >
using xt::get_init_type_t = typename get_init_type<V, S>::type

Definition at line 247 of file xfixed.hpp.

◆ get_slice_type

template<class E , class SL >
using xt::get_slice_type = typename detail::get_slice_type_impl<E, std::remove_reference_t<SL>>::type

Definition at line 1037 of file xslice.hpp.

◆ get_stepper

template<class V >
using xt::get_stepper = typename detail::get_stepper_impl<V>::type

Definition at line 779 of file xview.hpp.

◆ get_stepper_iterator

template<class C >
using xt::get_stepper_iterator = typename detail::get_stepper_iterator_impl<C>::type

Definition at line 71 of file xiterator.hpp.

◆ get_strides_t

template<class C >
using xt::get_strides_t = typename get_strides_type<C>::type

Definition at line 1075 of file xutils.hpp.

◆ get_value_type_t

template<class T >
using xt::get_value_type_t = typename get_value_type<T>::type

Definition at line 510 of file xutils.hpp.

◆ has_container_semantics

template<class E >
using xt::has_container_semantics = is_crtp_base_of<xcontainer_semantic, E>

Definition at line 212 of file xsemantic.hpp.

◆ has_fixed_rank_t

template<class E >
using xt::has_fixed_rank_t = typename has_fixed_rank<std::decay_t<E>>::type

Definition at line 1121 of file xutils.hpp.

◆ has_rank_t

template<class E , size_t N>
using xt::has_rank_t = typename has_rank<std::decay_t<E>, N>::type

Definition at line 1134 of file xutils.hpp.

◆ has_view_semantics

template<class E >
using xt::has_view_semantics = is_crtp_base_of<xview_semantic, E>

Definition at line 289 of file xsemantic.hpp.

◆ has_xexpression

template<class... E>
using xt::has_xexpression = xtl::disjunction<is_xexpression<E>...>

Definition at line 189 of file xexpression.hpp.

◆ has_xslice

template<class... E>
using xt::has_xslice = xtl::disjunction<is_xslice<E>...>

Definition at line 70 of file xslice.hpp.

◆ inner_reference_t

template<class ST >
using xt::inner_reference_t = typename inner_reference<ST>::type

Definition at line 1092 of file xutils.hpp.

◆ is_assignable

template<class E >
using xt::is_assignable = is_crtp_base_of<xsemantic_base, E>

Definition at line 157 of file xsemantic.hpp.

◆ is_crtp_base_of

template<template< class > class B, class E >
using xt::is_crtp_base_of = detail::is_crtp_base_of_impl<B, std::decay_t<E>>

Definition at line 177 of file xexpression.hpp.

◆ is_xexpression

template<class E >
using xt::is_xexpression = is_crtp_base_of<xexpression, E>

Definition at line 180 of file xexpression.hpp.

◆ is_xscalar

template<class E >
using xt::is_xscalar = detail::is_xscalar_impl<E>

Definition at line 318 of file xscalar.hpp.

◆ is_xsharable_expression

template<class E >
using xt::is_xsharable_expression = is_crtp_base_of<xsharable_expression, E>

Definition at line 192 of file xexpression.hpp.

◆ is_xslice

template<class S >
using xt::is_xslice = std::is_base_of<xslice<S>, S>

Definition at line 64 of file xslice.hpp.

◆ nested_initializer_list_t

template<class T , std::size_t I>
using xt::nested_initializer_list_t = typename nested_initializer_list<T, I>::type

Definition at line 328 of file xutils.hpp.

◆ norm_type_t

template<class T >
using xt::norm_type_t = typename norm_type<T>::type

Abbreviation of 'typename norm_type<T>::type'.

Definition at line 167 of file xnorm.hpp.

◆ ravel_return_type_t

template<class C , class Tag >
using xt::ravel_return_type_t = typename detail::ravel_return_type<C, Tag>::type

Definition at line 951 of file xtensor.hpp.

◆ rebind_container_t

template<class X , class C >
using xt::rebind_container_t = typename rebind_container<X, C>::type

Definition at line 82 of file xutils.hpp.

◆ remove_class_t

template<class T >
using xt::remove_class_t = typename remove_class<T>::type

Definition at line 158 of file xutils.hpp.

◆ select_expression_base_t

template<class D >
using xt::select_expression_base_t
Initial value:
std::
conditional_t<detail::is_sharable<D>::value, xsharable_expression<D>, xexpression<D>>

Definition at line 43 of file xsemantic.hpp.

◆ select_iterable_base_t

template<layout_type L1, layout_type L2, class T >
using xt::select_iterable_base_t = typename select_iterable_base<L1, L2, T>::type

Definition at line 63 of file xstrided_view.hpp.

◆ smart_ownership

◆ squared_norm_type_t

Abbreviation of 'typename squared_norm_type<T>::type'.

Definition at line 200 of file xnorm.hpp.

◆ static_shape

template<class T , std::size_t N>
using xt::static_shape = std::array<T, N>

Definition at line 32 of file xshape.hpp.

◆ temporary_container_t

template<class C >
using xt::temporary_container_t = typename temporary_container<C>::type

Definition at line 609 of file xbuffer_adaptor.hpp.

◆ temporary_type_t

template<class T >
using xt::temporary_type_t = typename temporary_type<T>::type

Definition at line 158 of file xexpression_traits.hpp.

◆ view_temporary_type_t

template<class E , class... SL>
using xt::view_temporary_type_t = typename view_temporary_type<E, SL...>::type

Definition at line 92 of file xview_utils.hpp.

◆ void_t

template<class... T>
using xt::void_t = typename make_void<T...>::type

Definition at line 95 of file xutils.hpp.

◆ xarray

template<class T , layout_type L = ::xt::layout_type::row_major, class A = std::allocator< T >, class SA = std::allocator<typename std::vector<T, A>::size_type>>
xt::xarray = xarray_container<uvector< T , A >, L, xt::svector<typename uvector< T , A >::size_type, 4, SA , true>>

Alias template on xarray_container with default parameters for data container type and shape / strides container type.

This allows to write

instead of the heavier syntax

xt::xarray_container<std::vector<double>, std::vector<std::size_t>> a = ...
Template Parameters
TThe value type of the elements.
LThe layout_type of the xarray_container (default: XTENSOR_DEFAULT_LAYOUT).
AThe allocator of the container holding the elements.
SAThe allocator of the containers holding the shape and the strides.

Definition at line 82 of file xtensor_forward.hpp.

◆ xarray_optional

template<class T , layout_type L = ::xt::layout_type::row_major, class A = std::allocator< T >, class BC = xtl::xdynamic_bitset<std::size_t>, class SA = std::allocator<typename std::vector<T, A>::size_type>>
xt::xarray_optional
Initial value:
xarray_container<
xtl::xoptional_vector<T, A, BC>,
L,
xoptional_expression_tag>

Alias template on xarray_container for handling missing values.

Template Parameters
TThe value type of the elements.
LThe layout_type of the container (default: XTENSOR_DEFAULT_LAYOUT).
AThe allocator of the container holding the elements.
BAThe allocator of the container holding the missing flags.
SAThe allocator of the containers holding the shape and the strides.

Definition at line 107 of file xtensor_forward.hpp.

◆ xclosure_t

template<class E >
using xt::xclosure_t = typename xclosure<E>::type

Definition at line 273 of file xexpression.hpp.

◆ xcsv_tensor

template<class T , class A = std::allocator<T>>
using xt::xcsv_tensor = xtensor_container<std::vector<T, A>, 2, layout_type::row_major>

Definition at line 31 of file xcsv.hpp.

◆ xdynamic_slice

template<class T >
using xt::xdynamic_slice
Initial value:
xtl::variant<
T,
xrange_adaptor<placeholders::xtuph, T, T>,
xrange_adaptor<T, placeholders::xtuph, T>,
xrange_adaptor<T, T, placeholders::xtuph>,
xrange_adaptor<T, placeholders::xtuph, placeholders::xtuph>,
xrange_adaptor<placeholders::xtuph, T, placeholders::xtuph>,
xrange_adaptor<placeholders::xtuph, placeholders::xtuph, T>,
xrange_adaptor<T, T, T>,
xrange_adaptor<placeholders::xtuph, placeholders::xtuph, placeholders::xtuph>,
xrange<T>,
xstepped_range<T>,
xkeep_slice<T>,
xdrop_slice<T>,
xall_tag,
xellipsis_tag,
xnewaxis_tag>

Definition at line 290 of file xdynamic_view.hpp.

◆ xdynamic_slice_vector

using xt::xdynamic_slice_vector = std::vector<xdynamic_slice<std::ptrdiff_t>>

Definition at line 314 of file xdynamic_view.hpp.

◆ xexpression_tag_t

template<class... T>
using xt::xexpression_tag_t = typename xexpression_tag<T...>::type

Definition at line 390 of file xexpression.hpp.

◆ xindex

using xt::xindex = dynamic_shape<std::size_t>

Definition at line 37 of file xshape.hpp.

◆ xindex_type_t

template<class C >
using xt::xindex_type_t = typename detail::index_type_impl<C>::type

Definition at line 99 of file xiterator.hpp.

◆ xoffset_adaptor

template<class CT , class M , std::size_t I>
using xt::xoffset_adaptor = xfunctor_adaptor<detail::offset_forwarder<M, I>, CT>

Definition at line 92 of file xoffset_view.hpp.

◆ xoffset_view

template<class CT , class M , std::size_t I>
using xt::xoffset_view = xfunctor_view<detail::offset_forwarder<M, I>, CT>

Definition at line 89 of file xoffset_view.hpp.

◆ xshape

template<std::size_t... N>
xt::xshape = fixed_shape<N...>

Alias template for fixed_shape allows for a shorter template shape definition in xtensor_fixed.

Definition at line 153 of file xtensor_forward.hpp.

◆ xstrided_slice

template<class T >
using xt::xstrided_slice
Initial value:
xtl::variant<
T,
xrange_adaptor<placeholders::xtuph, T, T>,
xrange_adaptor<T, placeholders::xtuph, T>,
xrange_adaptor<T, T, placeholders::xtuph>,
xrange_adaptor<T, placeholders::xtuph, placeholders::xtuph>,
xrange_adaptor<placeholders::xtuph, T, placeholders::xtuph>,
xrange_adaptor<placeholders::xtuph, placeholders::xtuph, T>,
xrange_adaptor<T, T, T>,
xrange_adaptor<placeholders::xtuph, placeholders::xtuph, placeholders::xtuph>,
xrange<T>,
xstepped_range<T>,
xall_tag,
xellipsis_tag,
xnewaxis_tag>

Definition at line 318 of file xstrided_view.hpp.

◆ xstrided_slice_vector

xt::xstrided_slice_vector = std::vector<xstrided_slice<std::ptrdiff_t>>

vector of slices used to build a xstrided_view

Definition at line 343 of file xstrided_view.hpp.

◆ xtensor

template<class T , std::size_t N, layout_type L = ::xt::layout_type::row_major, class A = std::allocator< T >>
xt::xtensor = xtensor_container<uvector< T , A >, N, L>

Alias template on xtensor_container with default parameters for data container type.

This allows to write

xt::xtensor<double, 2> a = {{1., 2.}, {3., 4.}};

instead of the heavier syntax

Template Parameters
TThe value type of the elements.
NThe dimension of the tensor.
LThe layout_type of the tensor (default: XTENSOR_DEFAULT_LAYOUT).
AThe allocator of the containers holding the elements.

Definition at line 137 of file xtensor_forward.hpp.

◆ xtensor_fixed

template<class T , class FSH , layout_type L = ::xt::layout_type::row_major, bool Sharable = true>
xt::xtensor_fixed = xfixed_container<T, FSH, L, Sharable>

Alias template on xfixed_container with default parameters for layout type.

This allows to write

instead of the syntax

Template Parameters
TThe value type of the elements.
FSHA xshape template shape.
LThe layout_type of the tensor (default: XTENSOR_DEFAULT_LAYOUT).
SharableWhether the tensor can be used in a shared expression.

Definition at line 182 of file xtensor_forward.hpp.

◆ xtensor_optional

template<class T , std::size_t N, layout_type L = ::xt::layout_type::row_major, class A = std::allocator< T >, class BC = xtl::xdynamic_bitset<std::size_t>>
xt::xtensor_optional = xtensor_container<xtl::xoptional_vector<T, A, BC>, N, L, xoptional_expression_tag>

Alias template on xtensor_container for handling missing values.

Template Parameters
TThe value type of the elements.
NThe dimension of the tensor.
LThe layout_type of the container (default: XTENSOR_DEFAULT_LAYOUT).
AThe allocator of the containers holding the elements.
BAThe allocator of the container holding the missing flags.

Definition at line 200 of file xtensor_forward.hpp.

◆ xtrivially_default_constructible

template<class T >
using xt::xtrivially_default_constructible = std::is_trivially_default_constructible<T>

Definition at line 730 of file xutils.hpp.

◆ xvalue_type

template<class E >
using xt::xvalue_type = detail::xvalue_type_impl<E>

Definition at line 37 of file xexpression_traits.hpp.

◆ xvalue_type_t

template<class E >
using xt::xvalue_type_t = typename xvalue_type<E>::type

Definition at line 40 of file xexpression_traits.hpp.

Enumeration Type Documentation

◆ histogram_algorithm

Defines different algorithms to be used in "histogram_bin_edges".

Definition at line 280 of file xhistogram.hpp.

◆ layout_type

layout_type enum for xcontainer based xexpressions

Enumerator
dynamic 

dynamic layout_type: you can resize to row major, column major, or use custom strides

any 

layout_type compatible with all others

row_major 

row major layout_type

column_major 

column major layout_type

Definition at line 23 of file xlayout.hpp.

◆ pad_mode

Defines different algorithms to be used in xt::pad:

  • constant: Pads with a constant value.
  • symmetric: Pads with the reflection of the vector mirrored along the edge of the array.
  • reflect: Pads with the reflection of the vector mirrored on the first and last values of the vector along each axis.
  • wrap: Pads with the wrap of the vector along the axis. The first values are used to pad the end and the end values are used to pad the beginning.
  • periodic : == wrap (pads with periodic repetitions of the vector).

OpenCV to xtensor:

  • BORDER_CONSTANT == constant
  • BORDER_REFLECT == symmetric
  • BORDER_REFLECT_101 == reflect
  • BORDER_WRAP == wrap

Definition at line 38 of file xpad.hpp.

◆ sorting_method

Sorting method.

Predefined methods for performing indirect sorting.

See also
argsort(const xexpression<E>&, std::ptrdiff_t, sorting_method)
Enumerator
quick 

Faster method but with no guarantee on preservation of order of equal elements https://en.cppreference.com/w/cpp/algorithm/sort.

stable 

Slower method but with guarantee on preservation of order of equal elements https://en.cppreference.com/w/cpp/algorithm/stable_sort.

Definition at line 278 of file xsort.hpp.

Function Documentation

◆ accumulate() [1/2]

template<class F , class E , class EVS = evaluation_strategy::immediate_type, xtl::check_concept< is_evaluation_strategy< EVS > > = 0>
auto xt::accumulate ( F && f,
E && e,
EVS evaluation_strategy = EVS() )
inline

Accumulate and flatten array NOTE This function is not lazy!

Parameters
ffunctor to use for accumulation
exexpression to be accumulated
evaluation_strategyevaluation strategy of the accumulation
Returns
returns xarray<T> filled with accumulated values

Definition at line 344 of file xaccumulator.hpp.

◆ accumulate() [2/2]

template<class F , class E , class EVS = evaluation_strategy::immediate_type>
auto xt::accumulate ( F && f,
E && e,
std::ptrdiff_t axis,
EVS evaluation_strategy = EVS() )
inline

Accumulate over axis NOTE This function is not lazy!

Parameters
fFunctor to use for accumulation
exexpression to accumulate
axisAxis to perform accumulation over
evaluation_strategyevaluation strategy of the accumulation
Returns
returns xarray<T> filled with accumulated values

Definition at line 363 of file xaccumulator.hpp.

◆ adapt_strides() [1/2]

template<class shape_type , class strides_type >
void xt::adapt_strides ( const shape_type & shape,
strides_type & strides )
inlinenoexcept

Definition at line 623 of file xstrides.hpp.

◆ adapt_strides() [2/2]

template<class shape_type , class strides_type , class backstrides_type >
void xt::adapt_strides ( const shape_type & shape,
strides_type & strides,
backstrides_type & backstrides )
inlinenoexcept

Definition at line 633 of file xstrides.hpp.

◆ all()

auto xt::all ( )
inlinenoexcept

Returns a slice representing a full dimension, to be used as an argument of view function.

See also
view, strided_view

Definition at line 234 of file xslice.hpp.

◆ amax() [1/3]

template<class T = void, class E , class I , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto xt::amax ( E && e,
const I(&) axes[N],
EVS es = EVS() )
inline

Definition at line 782 of file xmath.hpp.

◆ amax() [2/3]

template<class T = void, class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS > > = 0>
auto xt::amax ( E && e,
EVS es = EVS() )
inline

Definition at line 782 of file xmath.hpp.

◆ amax() [3/3]

template<class T = void, class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > >, xtl::is_integral< std::decay_t< X > > > = 0>
auto xt::amax ( E && e,
X axis,
EVS es = EVS() )
inline

Definition at line 782 of file xmath.hpp.

◆ amin() [1/3]

template<class T = void, class E , class I , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto xt::amin ( E && e,
const I(&) axes[N],
EVS es = EVS() )
inline

Definition at line 800 of file xmath.hpp.

◆ amin() [2/3]

template<class T = void, class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS > > = 0>
auto xt::amin ( E && e,
EVS es = EVS() )
inline

Definition at line 800 of file xmath.hpp.

◆ amin() [3/3]

template<class T = void, class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > >, xtl::is_integral< std::decay_t< X > > > = 0>
auto xt::amin ( E && e,
X axis,
EVS es = EVS() )
inline

Definition at line 800 of file xmath.hpp.

◆ apply()

template<class R , class F , class... S>
R xt::apply ( std::size_t index,
F && func,
const std::tuple< S... > & s )
inlinenoexcept

Definition at line 305 of file xutils.hpp.

◆ arange() [1/2]

template<class T , class S = T>
auto xt::arange ( T start,
T stop,
S step = 1 )
inlinenoexcept

Generates numbers evenly spaced within given half-open interval [start, stop).

Parameters
startstart of the interval
stopstop of the interval
stepstepsize
Template Parameters
Tvalue_type of xexpression
Returns
xgenerator that generates the values on access

Definition at line 432 of file xbuilder.hpp.

◆ arange() [2/2]

template<class T >
auto xt::arange ( T stop)
inlinenoexcept

Generate numbers evenly spaced within given half-open interval [0, stop) with a step size of 1.

Parameters
stopstop of the interval
Template Parameters
Tvalue_type of xexpression
Returns
xgenerator that generates the values on access

Definition at line 445 of file xbuilder.hpp.

◆ argmax()

template<layout_type L = ::xt::layout_type::row_major, class E >
auto xt::argmax ( const xexpression< E > & e)
inline

Definition at line 1273 of file xsort.hpp.

◆ argmin() [1/2]

template<layout_type L = ::xt::layout_type::row_major, class E >
auto xt::argmin ( const xexpression< E > & e)
inline

Definition at line 1243 of file xsort.hpp.

◆ argmin() [2/2]

template<layout_type L = ::xt::layout_type::row_major, class E >
auto xt::argmin ( const xexpression< E > & e,
std::ptrdiff_t axis )
inline

Find position of minimal value in xexpression.

By default, the returned index is into the flattened array. If axis is specified, the indices are along the specified axis.

Parameters
einput xexpression
axisselect axis (optional)
Returns
returns xarray with positions of minimal value

Definition at line 1264 of file xsort.hpp.

◆ argpartition() [1/5]

template<class E , class C , class = std::enable_if_t<!xtl::is_integral<C>::value, int>>
auto xt::argpartition ( const xexpression< E > & e,
C kth_container,
std::ptrdiff_t axis = -1 )
inline

Definition at line 708 of file xsort.hpp.

◆ argpartition() [2/5]

template<class E , class I , std::size_t N>
auto xt::argpartition ( const xexpression< E > & e,
const I(&) kth_container[N],
placeholders::xtuph tag )
inline

Definition at line 692 of file xsort.hpp.

◆ argpartition() [3/5]

template<class E , class I , std::size_t N>
auto xt::argpartition ( const xexpression< E > & e,
const I(&) kth_container[N],
std::ptrdiff_t axis = -1 )
inline

Definition at line 755 of file xsort.hpp.

◆ argpartition() [4/5]

template<class E >
auto xt::argpartition ( const xexpression< E > & e,
std::size_t kth,
placeholders::xtuph tag )
inline

Definition at line 702 of file xsort.hpp.

◆ argpartition() [5/5]

template<class E >
auto xt::argpartition ( const xexpression< E > & e,
std::size_t kth,
std::ptrdiff_t axis = -1 )
inline

Definition at line 765 of file xsort.hpp.

◆ argsort()

template<class E >
auto xt::argsort ( const xexpression< E > & e,
placeholders::xtuph ,
sorting_method method = sorting_method::quick )
inline

Definition at line 430 of file xsort.hpp.

◆ argument()

template<std::size_t I, class... Args>
constexpr decltype(auto) xt::argument ( Args &&... args)
constexprnoexcept

Definition at line 276 of file xutils.hpp.

◆ as_chunked() [1/2]

template<class E >
xchunked_view< E > xt::as_chunked ( E && e)
inline

Definition at line 289 of file xchunked_view.hpp.

◆ as_chunked() [2/2]

template<class E , class S >
xchunked_view< E > xt::as_chunked ( E && e,
S && chunk_shape )
inline

Definition at line 283 of file xchunked_view.hpp.

◆ assert_compatible_shape()

template<class E1 , class E2 >
void xt::assert_compatible_shape ( const xexpression< E1 > & e1,
const xexpression< E2 > & e2 )
inline

Definition at line 246 of file xassign.hpp.

◆ assign_data()

template<class E1 , class E2 >
void xt::assign_data ( xexpression< E1 > & e1,
const xexpression< E2 > & e2,
bool trivial )
inline

Definition at line 208 of file xassign.hpp.

◆ assign_xexpression()

template<class E1 , class E2 >
void xt::assign_xexpression ( xexpression< E1 > & e1,
const xexpression< E2 > & e2 )
inline

Definition at line 215 of file xassign.hpp.

◆ average() [1/4]

template<class T = void, class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS > > = 0>
auto xt::average ( E && e,
EVS ev = EVS() )
inline

Definition at line 2045 of file xmath.hpp.

◆ average() [2/4]

template<class T = void, class E , class W , class X , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto xt::average ( E && e,
W && weights,
const X(&) axes[N],
EVS ev = EVS() )
inline

Definition at line 2023 of file xmath.hpp.

◆ average() [3/4]

template<class T = void, class E , class W , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS > > = 0>
auto xt::average ( E && e,
W && weights,
EVS ev = EVS() )
inline

Definition at line 2031 of file xmath.hpp.

◆ average() [4/4]

template<class T = void, class E , class W , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS >, xtl::is_integral< X > > = 0>
auto xt::average ( E && e,
W && weights,
X axis,
EVS ev = EVS() )
inline

Definition at line 2017 of file xmath.hpp.

◆ axis_begin() [1/2]

template<class E >
auto xt::axis_begin ( E && e)
inline

Returns an iterator to the first element of the expression for axis 0.

Parameters
ethe expession to iterate over
Returns
an instance of xaxis_iterator

Definition at line 285 of file xaxis_iterator.hpp.

◆ axis_begin() [2/2]

template<class E >
auto xt::axis_begin ( E && e,
typename std::decay_t< E >::size_type axis )
inline

Returns an iterator to the first element of the expression for the specified axis.

Parameters
ethe expession to iterate over
axisthe axis to iterate over
Returns
an instance of xaxis_iterator

Definition at line 299 of file xaxis_iterator.hpp.

◆ axis_end() [1/2]

template<class E >
auto xt::axis_end ( E && e)
inline

Returns an iterator to the element following the last element of the expression for axis 0.

Parameters
ethe expession to iterate over
Returns
an instance of xaxis_iterator

Definition at line 313 of file xaxis_iterator.hpp.

◆ axis_end() [2/2]

template<class E >
auto xt::axis_end ( E && e,
typename std::decay_t< E >::size_type axis )
inline

Returns an iterator to the element following the last element of the expression for the specified axis.

Parameters
ethe expression to iterate over
axisthe axis to iterate over
Returns
an instance of xaxis_iterator

Definition at line 334 of file xaxis_iterator.hpp.

◆ axis_slice_begin() [1/2]

template<class E >
auto xt::axis_slice_begin ( E && e)
inline

Returns an iterator to the first element of the expression for axis 0.

Parameters
ethe expession to iterate over
Returns
an instance of xaxis_slice_iterator

Definition at line 299 of file xaxis_slice_iterator.hpp.

◆ axis_slice_begin() [2/2]

template<class E >
auto xt::axis_slice_begin ( E && e,
typename std::decay_t< E >::size_type axis )
inline

Returns an iterator to the first element of the expression for the specified axis.

Parameters
ethe expession to iterate over
axisthe axis to iterate over
Returns
an instance of xaxis_slice_iterator

Definition at line 313 of file xaxis_slice_iterator.hpp.

◆ axis_slice_end() [1/2]

template<class E >
auto xt::axis_slice_end ( E && e)
inline

Returns an iterator to the element following the last element of the expression for axis 0.

Parameters
ethe expession to iterate over
Returns
an instance of xaxis_slice_iterator

Definition at line 327 of file xaxis_slice_iterator.hpp.

◆ axis_slice_end() [2/2]

template<class E >
auto xt::axis_slice_end ( E && e,
typename std::decay_t< E >::size_type axis )
inline

Returns an iterator to the element following the last element of the expression for the specified axis.

Parameters
ethe expression to iterate over
axisthe axis to iterate over
Returns
an instance of xaxis_slice_iterator

Definition at line 347 of file xaxis_slice_iterator.hpp.

◆ bin_items() [1/2]

template<class E >
xt::xtensor< size_t, 1 > xt::bin_items ( size_t N,
E && weights )
inline

Get the number of items in each bin, given the fraction of items per bin.

The output is such that the total number of items of all bins is exactly "N".

Parameters
Nthe number of items to distribute
weightsfraction of items per bin: a 1D container whose size is the number of bins
Returns
1D container with the number of items per bin

Definition at line 566 of file xhistogram.hpp.

◆ bin_items() [2/2]

xt::xtensor< size_t, 1 > xt::bin_items ( size_t N,
size_t bins )
inline

Get the number of items in each bin, with each bin having approximately the same number of items in it,under the constraint that the total number of items of all bins is exactly "N".

Parameters
Nthe number of items to distribute
binsthe number of bins
Returns
1D container with the number of items per bin

Definition at line 608 of file xhistogram.hpp.

◆ bincount() [1/2]

template<class E1 , class E2 , xtl::check_concept< is_xexpression< std::decay_t< E2 > > > = 0>
auto xt::bincount ( E1 && data,
E2 && weights,
std::size_t minlength = 0 )
inline

Count number of occurrences of each value in array of non-negative ints.

The number of bins (of size 1) is one larger than the largest value in x. If minlength is specified, there will be at least this number of bins in the output array (though it will be longer if necessary, depending on the contents of x). Each bin gives the number of occurrences of its index value in x. If weights is specified the input array is weighted by it, i.e. if a value n is found at position i, out[n] += weight[i] instead of out[n] += 1.

Parameters
datathe 1D container with integers to count into bins
weightsa 1D container with the same number of elements as data
minlengthThe minlength
Returns
1D container with the bincount

Definition at line 513 of file xhistogram.hpp.

◆ bincount() [2/2]

template<class E1 >
auto xt::bincount ( E1 && data,
std::size_t minlength = 0 )
inline

Definition at line 547 of file xhistogram.hpp.

◆ blockwise_reducer()

template<class E , class CS , class A , class O , class FF >
auto xt::blockwise_reducer ( E && e,
CS && chunk_shape,
A && axes,
O && raw_options,
FF && functor )
inline

Definition at line 269 of file xblockwise_reducer.hpp.

◆ broadcast() [1/2]

template<class E , class I , std::size_t L>
auto xt::broadcast ( E && e,
const I(&) s[L] )
inline

Definition at line 264 of file xbroadcast.hpp.

◆ broadcast() [2/2]

template<class E , class S >
auto xt::broadcast ( E && e,
const S & s )
inline

Returns an xexpression broadcasting the given expression to a specified shape.

Template Parameters
ethe xexpression to broadcast
sthe specified shape to broadcast.

The returned expression either hold a const reference to e or a copy depending on whether e is an lvalue or an rvalue.

Definition at line 256 of file xbroadcast.hpp.

◆ broadcast_shape()

template<class S1 , class S2 >
bool xt::broadcast_shape ( const S1 & input,
S2 & output )
inline

Definition at line 734 of file xstrides.hpp.

◆ broadcastable()

template<class S1 , class S2 >
bool xt::broadcastable ( const S1 & src_shape,
const S2 & dst_shape )
inline

Definition at line 779 of file xstrides.hpp.

◆ check_access()

template<class S , class... Args>
void xt::check_access ( const S & shape,
Args... args )
inline

Definition at line 306 of file xexception.hpp.

◆ check_axis_in_dim()

template<class A , class D >
void xt::check_axis_in_dim ( A axis,
D dim,
const char * subject = "Axis" )
inline

Definition at line 288 of file xexception.hpp.

◆ check_dimension()

template<class S , class... Args>
void xt::check_dimension ( const S & shape,
Args...  )
inline

Definition at line 271 of file xexception.hpp.

◆ check_element_index()

template<class S , class It >
void xt::check_element_index ( const S & shape,
It first,
It last )
inline

Definition at line 244 of file xexception.hpp.

◆ check_in_bounds()

template<class S , class... Args>
bool xt::check_in_bounds ( const S & shape,
Args &... args )
inline

Definition at line 875 of file xstrides.hpp.

◆ check_index() [1/3]

template<class S >
void xt::check_index ( const S & )
inline

Definition at line 208 of file xexception.hpp.

◆ check_index() [2/3]

template<class S >
void xt::check_index ( const S & ,
missing_type  )
inline

Definition at line 213 of file xexception.hpp.

◆ check_index() [3/3]

template<class S , class Arg , class... Args>
void xt::check_index ( const S & shape,
Arg arg,
Args... args )
inline

Definition at line 218 of file xexception.hpp.

◆ chunked_array()

template<class T , layout_type L = ::xt::layout_type::row_major, class S >
xchunked_array< xarray< xarray< T > > > xt::chunked_array ( std::initializer_list< S > shape,
std::initializer_list< S > chunk_shape,
layout_type chunk_memory_layout = ::xt::layout_type::row_major )

Definition at line 360 of file xchunked_array.hpp.

◆ col()

template<class E >
auto xt::col ( E && e,
std::ptrdiff_t index )
inline

Constructs and returns a column (sliced view) on the specified expression.

Users should not directly construct the slices but call helper functions instead. This function is only allowed on expressions with two dimensions.

Parameters
ethe xexpression to adapt
index0-based index of the column, negative indices will return the last columns in reverse order.
Exceptions
std::invalid_argumentif the expression has more than 2 dimensions.

Definition at line 1937 of file xview.hpp.

◆ compute_0d_table()

template<class P , class T >
void xt::compute_0d_table ( std::stringstream & out,
P & ,
const T & expr )

Definition at line 25 of file xmime.hpp.

◆ compute_1d_row()

template<class P >
void xt::compute_1d_row ( std::stringstream & out,
P & printer,
const std::size_t & row_idx )

Definition at line 35 of file xmime.hpp.

◆ compute_1d_table()

template<class P , class T >
void xt::compute_1d_table ( std::stringstream & out,
P & printer,
const T & expr,
const std::size_t & edgeitems )

Definition at line 43 of file xmime.hpp.

◆ compute_2d_element()

template<class P >
void xt::compute_2d_element ( std::stringstream & out,
P & printer,
const std::string & idx_str,
const std::size_t & row_idx,
const std::size_t & column_idx )

Definition at line 71 of file xmime.hpp.

◆ compute_2d_row()

template<class P , class T >
void xt::compute_2d_row ( std::stringstream & out,
P & printer,
const T & expr,
const std::size_t & edgeitems,
const std::string & idx_str,
const std::size_t & row_idx )

Definition at line 86 of file xmime.hpp.

◆ compute_2d_table()

template<class P , class T , class I >
void xt::compute_2d_table ( std::stringstream & out,
P & printer,
const T & expr,
const std::size_t & edgeitems,
const std::vector< I > & idx )

Definition at line 121 of file xmime.hpp.

◆ compute_layout()

template<class... Args>
constexpr layout_type xt::compute_layout ( Args... args)
constexprnoexcept

Implementation of the following logical table:

   | d | a | r | c |
 --+---+---+---+---+
 d | d | d | d | d |
 a | d | a | r | c |
 r | d | r | r | d |
 c | d | c | d | c |
 d = dynamic, a = any, r = row_major, c = column_major.

Using bitmasks to avoid nested if-else statements.

Parameters
argsthe input layouts.
Returns
the output layout, computed with the previous logical table.

Definition at line 88 of file xlayout.hpp.

◆ compute_nd_row()

template<class P , class T , class I >
void xt::compute_nd_row ( std::stringstream & out,
P & printer,
const T & expr,
const std::size_t & edgeitems,
const std::vector< I > & idx )

Definition at line 183 of file xmime.hpp.

◆ compute_nd_table()

template<class P , class T >
void xt::compute_nd_table ( std::stringstream & out,
P & printer,
const T & expr,
const std::size_t & edgeitems )

Definition at line 244 of file xmime.hpp.

◆ compute_nd_table_impl()

template<class P , class T , class I >
void xt::compute_nd_table_impl ( std::stringstream & out,
P & printer,
const T & expr,
const std::size_t & edgeitems,
const std::vector< I > & idx )

Definition at line 197 of file xmime.hpp.

◆ compute_size()

template<class shape_type >
std::size_t xt::compute_size ( const shape_type & shape)
inlinenoexcept

Definition at line 347 of file xstrides.hpp.

◆ compute_strides()

template<layout_type L = layout_type::dynamic, class shape_type , class strides_type , class backstrides_type >
std::size_t xt::compute_strides ( const shape_type & shape,
layout_type l,
strides_type & strides,
backstrides_type & backstrides )
inline

Definition at line 573 of file xstrides.hpp.

◆ computed_assign()

template<class E1 , class E2 >
void xt::computed_assign ( xexpression< E1 > & e1,
const xexpression< E2 > & e2 )
inline

Definition at line 232 of file xassign.hpp.

◆ concatenate() [1/2]

template<std::size_t axis, class... CT, typename = std::enable_if_t<detail::all_fixed_shapes<CT...>::value>>
auto xt::concatenate ( std::tuple< CT... > && t)
inline

Definition at line 837 of file xbuilder.hpp.

◆ concatenate() [2/2]

template<class... CT>
auto xt::concatenate ( std::tuple< CT... > && t,
std::size_t axis = 0 )
inline

Concatenates xexpressions along axis.

Parameters
txtuple of xexpressions to concatenate
axisaxis along which elements are concatenated
Returns
xgenerator evaluating to concatenated elements
xt::xarray<double> a = {{1, 2, 3}};
xt::xarray<double> b = {{2, 3, 4}};
xt::xarray<double> c = xt::concatenate(xt::xtuple(a, b)); // => {{1, 2, 3},
// {2, 3, 4}}
xt::xarray<double> d = xt::concatenate(xt::xtuple(a, b), 1); // => {{1, 2, 3, 2, 3, 4}}
auto concatenate(std::tuple< CT... > &&t, std::size_t axis=0)
Concatenates xexpressions along axis.
Definition xbuilder.hpp:830
auto xtuple(Types &&... args)
Creates tuples from arguments for concatenate and stack.
Definition xbuilder.hpp:707

Definition at line 830 of file xbuilder.hpp.

◆ conditional_cast()

template<bool condition, class T , class U >
auto xt::conditional_cast ( U && u)
inline

Perform a type cast when a condition is true.

If condition is true, return static_cast<T>(u), otherwise return u unchanged. This is useful when an unconditional static_cast would force undesired type conversions in some situations where an error or warning would be desired. The condition determines when the explicit cast is ok.

Definition at line 771 of file xutils.hpp.

◆ convolve()

template<class E1 , class E2 , class E3 >
auto xt::convolve ( E1 && a,
E2 && v,
E3 mode )
inline

Definition at line 3308 of file xmath.hpp.

◆ copy_to_reduced()

template<class F , class E , class R , xtl::check_concept< std::is_convertible< typename E::value_type, typename R::value_type > > = 0>
void xt::copy_to_reduced ( F & f,
const E & e,
R & result )
inline

Definition at line 251 of file xreducer.hpp.

◆ count_nonnan() [1/3]

template<class E , class I , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto xt::count_nonnan ( E && e,
const I(&) axes[N],
EVS es = EVS() )
inline

Definition at line 2610 of file xmath.hpp.

◆ count_nonnan() [2/3]

template<class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS > > = 0>
auto xt::count_nonnan ( E && e,
EVS es = EVS() )
inline

Definition at line 2584 of file xmath.hpp.

◆ count_nonnan() [3/3]

template<class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > >, xtl::negation< xtl::is_integral< X > > > = 0>
auto xt::count_nonnan ( E && e,
X && axes,
EVS es = EVS() )
inline

Definition at line 2594 of file xmath.hpp.

◆ count_nonzero() [1/4]

template<class E , class I , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto xt::count_nonzero ( E && e,
const I(&) axes[N],
EVS es = EVS() )
inline

Definition at line 2570 of file xmath.hpp.

◆ count_nonzero() [2/4]

template<class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS > > = 0>
auto xt::count_nonzero ( E && e,
EVS es = EVS() )
inline

Definition at line 2533 of file xmath.hpp.

◆ count_nonzero() [3/4]

template<class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > >, xtl::negation< xtl::is_integral< X > > > = 0>
auto xt::count_nonzero ( E && e,
X && axes,
EVS es = EVS() )
inline

Definition at line 2548 of file xmath.hpp.

◆ count_nonzero() [4/4]

template<class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > >, xtl::is_integral< X > > = 0>
auto xt::count_nonzero ( E && e,
X axis,
EVS es = EVS() )
inline

Definition at line 2564 of file xmath.hpp.

◆ cov()

template<class E1 >
auto xt::cov ( const E1 & x,
const E1 & y = E1() )
inline

Returns the covariance matrix.

Parameters
xone or two dimensional array
yoptional one-dimensional array to build covariance to x

Definition at line 3197 of file xmath.hpp.

◆ cumprod()

template<class T = void, class E >
auto xt::cumprod ( E && e)
inline

Definition at line 2332 of file xmath.hpp.

◆ cumsum()

template<class T = void, class E >
auto xt::cumsum ( E && e)
inline

Definition at line 2297 of file xmath.hpp.

◆ data_offset()

template<class offset_type , class S >
offset_type xt::data_offset ( const S & strides)
inlinenoexcept

Definition at line 447 of file xstrides.hpp.

◆ default_assignable_layout()

constexpr layout_type xt::default_assignable_layout ( layout_type l)
constexprnoexcept

Definition at line 93 of file xlayout.hpp.

◆ diag()

template<class E >
auto xt::diag ( E && arr,
int k = 0 )
inline

xexpression with values of arr on the diagonal, zeroes otherwise

Parameters
arrthe 1D input array of length n
kthe offset of the considered diagonal
Returns
xexpression function with shape n x n and arr on the diagonal
xt::xarray<double> a = {1, 5, 9};
auto b = xt::diag(a); // => {{1, 0, 0},
// {0, 5, 0},
// {0, 0, 9}}
auto diag(E &&arr, int k=0)
xexpression with values of arr on the diagonal, zeroes otherwise

Definition at line 1202 of file xbuilder.hpp.

◆ diagonal()

template<class E >
auto xt::diagonal ( E && arr,
int offset = 0,
std::size_t axis_1 = 0,
std::size_t axis_2 = 1 )
inline

Returns the elements on the diagonal of arr If arr has more than two dimensions, then the axes specified by axis_1 and axis_2 are used to determine the 2-D sub-array whose diagonal is returned.

The shape of the resulting array can be determined by removing axis1 and axis2 and appending an index to the right equal to the size of the resulting diagonals.

Parameters
arrthe input array
offsetoffset of the diagonal from the main diagonal. Can be positive or negative.
axis_1Axis to be used as the first axis of the 2-D sub-arrays from which the diagonals should be taken.
axis_2Axis to be used as the second axis of the 2-D sub-arrays from which the diagonals should be taken.
Returns
xexpression with values of the diagonal
xt::xarray<double> a = {{1, 2, 3},
{4, 5, 6}
{7, 8, 9}};
auto b = xt::diagonal(a); // => {1, 5, 9}
auto diagonal(E &&arr, int offset=0, std::size_t axis_1=0, std::size_t axis_2=1)
Returns the elements on the diagonal of arr If arr has more than two dimensions, then the axes specif...

Definition at line 1150 of file xbuilder.hpp.

◆ digitize()

template<class E1 , class E2 >
auto xt::digitize ( E1 && data,
E2 && bin_edges,
bool right = false )
inline

Return the indices of the bins to which each value in input array belongs.

Parameters
dataThe data.
bin_edgesThe bin-edges. It has to be 1-dimensional and monotonic.
rightIndicating whether the intervals include the right or the left bin edge.
Returns
Output array of indices, of same shape as x.

Definition at line 36 of file xhistogram.hpp.

◆ do_strides_match()

template<class shape_type , class strides_type >
bool xt::do_strides_match ( const shape_type & shape,
const strides_type & strides,
layout_type l,
bool zero_strides )
inline

Definition at line 588 of file xstrides.hpp.

◆ drop() [1/3]

template<class R = std::ptrdiff_t, class Arg0 , class Arg1 , class... Args>
xdrop_slice< R > xt::drop ( Arg0 i0,
Arg1 i1,
Args... args )
inline

Definition at line 544 of file xslice.hpp.

◆ drop() [2/3]

template<class T >
detail::disable_integral_drop< T > xt::drop ( T && indices)
inline

Create a non-contigous slice from a container of indices to drop.

Note: this slice cannot be used in the xstrided_view!

a.reshape({3, 3});
xt::view(a, xt::drop(0, 2); // => {{3, 4, 5}}
auto arange(T start, T stop, S step=1) noexcept
Generates numbers evenly spaced within given half-open interval [start, stop).
Definition xbuilder.hpp:432
detail::disable_integral_drop< T > drop(T &&indices)
Create a non-contigous slice from a container of indices to drop.
Definition xslice.hpp:529
auto view(E &&e, S &&... slices)
Constructs and returns a view on the specified xexpression.
Definition xview.hpp:1834
Parameters
indicesThe container of indices to drop
Returns
instance of xdrop_slice

Definition at line 529 of file xslice.hpp.

◆ drop() [3/3]

template<class R = std::ptrdiff_t, class T >
detail::enable_integral_drop< T, R > xt::drop ( T i)
inline

Definition at line 535 of file xslice.hpp.

◆ dump_csv()

template<class E >
void xt::dump_csv ( std::ostream & stream,
const xexpression< E > & e )

Dump tensor to CSV.

Parameters
streamthe output stream to write the CSV encoded values
ethe tensor expression to serialize

Definition at line 210 of file xcsv.hpp.

◆ dump_file()

template<class E >
void xt::dump_file ( std::ostream & stream,
const xexpression< E > & e,
const xcsv_config &  )

Definition at line 269 of file xcsv.hpp.

◆ dump_npy() [1/2]

template<typename E >
void xt::dump_npy ( const std::string & filename,
const xexpression< E > & e )
inline

Save xexpression to NumPy npy format.

Parameters
filenameThe filename or path to dump the data
ethe xexpression

Definition at line 739 of file xnpy.hpp.

◆ dump_npy() [2/2]

template<typename E >
std::string xt::dump_npy ( const xexpression< E > & e)
inline

Save xexpression to NumPy npy format in a string.

Parameters
ethe xexpression

Definition at line 756 of file xnpy.hpp.

◆ dynamic_view()

template<class E >
auto xt::dynamic_view ( E && e,
const xdynamic_slice_vector & slices )
inline

Definition at line 783 of file xdynamic_view.hpp.

◆ element_offset()

template<class offset_type , class S , class It >
offset_type xt::element_offset ( const S & strides,
It first,
It last )
inlinenoexcept

Definition at line 488 of file xstrides.hpp.

◆ ellipsis()

auto xt::ellipsis ( )
inlinenoexcept

Returns a slice representing all remaining dimensions, and selecting all in these dimensions.

Ellipsis will expand to a series of all() slices, until the number of slices is equal to the number of dimensions of the source array.

Note: ellipsis can only be used in strided_view!

auto v = xt::strided_view(a, {2, xt::ellipsis(), 2});
// equivalent to using {2, xt::all(), xt::all(), xt::all(), 2};
auto ellipsis() noexcept
Returns a slice representing all remaining dimensions, and selecting all in these dimensions.
Definition xslice.hpp:255
auto strided_view(E &&e, S &&shape, X &&stride, std::size_t offset=0, layout_type layout=L) noexcept
Construct a strided view from an xexpression, shape, strides and offset.
See also
strided_view

Definition at line 255 of file xslice.hpp.

◆ empty() [1/4]

template<class T , layout_type L = ::xt::layout_type::row_major, std::size_t... N>
xtensor_fixed< T, fixed_shape< N... >, L > xt::empty ( const fixed_shape< N... > & )
inline

Definition at line 109 of file xbuilder.hpp.

◆ empty() [2/4]

template<class T , layout_type L = ::xt::layout_type::row_major, class I , std::size_t N>
xtensor< T, N, L > xt::empty ( const I(&) shape[N])
inline

Definition at line 102 of file xbuilder.hpp.

◆ empty() [3/4]

template<class T , layout_type L = ::xt::layout_type::row_major, class S >
xarray< T, L > xt::empty ( const S & shape)
inline

Create a xcontainer (xarray, xtensor or xtensor_fixed) with uninitialized values of with value_type T and shape.

Selects the best container match automatically from the supplied shape.

  • std::vector → xarray<T>
  • std::array or initializer_list → xtensor<T, N>
  • xshape<N...> → xtensor_fixed<T, xshape<N...>>
Parameters
shapeshape of the new xcontainer

Definition at line 89 of file xbuilder.hpp.

◆ empty() [4/4]

template<class T , layout_type L = ::xt::layout_type::row_major, class ST , std::size_t N>
xtensor< T, N, L > xt::empty ( const std::array< ST, N > & shape)
inline

Definition at line 95 of file xbuilder.hpp.

◆ empty_like()

template<class E >
auto xt::empty_like ( const xexpression< E > & e)
inline

Create a xcontainer (xarray, xtensor or xtensor_fixed) with uninitialized values of the same shape, value type and layout as the input xexpression e.

Parameters
ethe xexpression from which to extract shape, value type and layout.

Definition at line 121 of file xbuilder.hpp.

◆ eye() [1/2]

template<class T = bool>
auto xt::eye ( const std::vector< std::size_t > & shape,
int k = 0 )
inline

Generates an array with ones on the diagonal.

Parameters
shapeshape of the resulting expression
kindex of the diagonal. 0 (default) refers to the main diagonal, a positive value refers to an upper diagonal, and a negative value to a lower diagonal.
Template Parameters
Tvalue_type of xexpression
Returns
xgenerator that generates the values on access

Definition at line 403 of file xbuilder.hpp.

◆ eye() [2/2]

template<class T = bool>
auto xt::eye ( std::size_t n,
int k = 0 )
inline

Generates a (n x n) array with ones on the diagonal.

Parameters
nlength of the diagonal.
kindex of the diagonal. 0 (default) refers to the main diagonal, a positive value refers to an upper diagonal, and a negative value to a lower diagonal.
Template Parameters
Tvalue_type of xexpression
Returns
xgenerator that generates the values on access

Definition at line 418 of file xbuilder.hpp.

◆ filter()

template<layout_type L = ::xt::layout_type::row_major, class E , class O >
auto xt::filter ( E && e,
O && condition )
inlinenoexcept

creates a view into e filtered by condition.

Returns a 1D view with the elements selected where condition evaluates to true. This is equivalent to

{index_view(e, argwhere(condition));} 

The returned view is not optimal if you just want to assign a scalar to the filtered elements. In that case, you should consider using the filtration function instead.

Template Parameters
Lthe traversal order
Parameters
ethe underlying xexpression
conditionxexpression with shape of e which selects indices
xarray<double> a = {{1,5,3}, {4,5,6}};
b = filter(a, a >= 5);
std::cout << b << std::endl; // {5, 5, 6}
auto filter(E &&e, O &&condition) noexcept
creates a view into e filtered by condition.
See also
filtration

Definition at line 820 of file xindex_view.hpp.

◆ filtration()

template<class E , class C >
auto xt::filtration ( E && e,
C && condition )
inlinenoexcept

creates a filtration of e filtered by condition.

Returns a lazy filtration optimized for scalar assignment. Actually, scalar assignment and computed scalar assignments are the only available methods of the filtration, the filtration IS NOT an xexpression.

Parameters
ethe xexpression to filter
conditionthe filtering xexpression
xarray<double> a = {{1,5,3}, {4,5,6}};
filtration(a, a >= 5) += 2;
std::cout << a << std::endl; // {{1, 7, 3}, {4, 7, 8}}
auto filtration(E &&e, C &&condition) noexcept
creates a filtration of e filtered by condition.

Definition at line 845 of file xindex_view.hpp.

◆ flatnonzero()

template<layout_type L, class T >
auto xt::flatnonzero ( const T & arr)
inline

Return indices that are non-zero in the flattened version of arr.

Equivalent to nonzero(ravel<layout_type>(arr))[0];

Parameters
arrinput array
Returns
indices that are non-zero in the flattened version of arr

Definition at line 456 of file xmanipulation.hpp.

◆ flatten_indices()

template<class T >
auto xt::flatten_indices ( const std::vector< T > & idx)
inline

Converts std::vector<index_type> (returned e.g.

from xt::argwhere) to a flattened xtensor.

Parameters
idxa vector of indices
Returns
xt::xtensor<typename index_type::value_type, 1> (e.g. xt::xtensor<size_t, 1>)

Definition at line 890 of file xtensor.hpp.

◆ for_each() [1/2]

template<class F , class... T>
void xt::for_each ( F && f,
const std::tuple< T... > & t )
inlinenoexcept

Definition at line 207 of file xutils.hpp.

◆ for_each() [2/2]

template<class F , class... T>
void xt::for_each ( F && f,
std::tuple< T... > & t )
inlinenoexcept

Definition at line 182 of file xutils.hpp.

◆ forward_normalize()

template<class R , class E , class C >
auto xt::forward_normalize ( E & expr,
C && axes ) -> std::enable_if_t<xtl::is_signed<std::decay_t<decltype(*std::begin(axes))>>::value, R>
inline

Definition at line 427 of file xutils.hpp.

◆ from_indices()

template<class T >
auto xt::from_indices ( const std::vector< T > & idx)
inline

Converts std::vector<index_type> (returned e.g.

from xt::argwhere) to xtensor.

Parameters
idxvector of indices
Returns
xt::xtensor<typename index_type::value_type, 2> (e.g. xt::xtensor<size_t, 2>)

Definition at line 858 of file xtensor.hpp.

◆ from_json()

template<template< typename U, typename V, typename... Args > class M, class E >
enable_xcontainer_semantics< E > xt::from_json ( const nlohmann::basic_json< M > & j,
E & e )
inline

JSON deserialization of a xtensor expression with a container or a view semantics.

The from_json method is used by the nlohmann_json library for automatic serialization of user-defined types. The method is picked up by argument-dependent lookup.

Note: for converting a JSON object to a value, nlohmann_json requires the value type to be default constructible, which is typically not the case for expressions with a view semantics. In this case, from_json can be called directly.

Parameters
ja const JSON object
ean xexpression

Definition at line 156 of file xjson.hpp.

◆ full_like()

template<class E >
auto xt::full_like ( const xexpression< E > & e,
typename E::value_type fill_value )
inline

Create a xcontainer (xarray, xtensor or xtensor_fixed), filled with fill_value and of the same shape, value type and layout as the input xexpression e.

Parameters
ethe xexpression from which to extract shape, value type and layout.
fill_valuethe value used to set each element of the returned xcontainer.

Definition at line 136 of file xbuilder.hpp.

◆ get() [1/3]

template<std::size_t I, template< typename... Args > class T, typename... Args>
decltype(auto) xt::get ( const T< Args... > & v)

Definition at line 531 of file xutils.hpp.

◆ get() [2/3]

template<std::size_t I, template< typename... Args > class T, typename... Args>
decltype(auto) xt::get ( T< Args... > && v)

Definition at line 519 of file xutils.hpp.

◆ get() [3/3]

template<std::size_t I, template< typename... Args > class T, typename... Args>
decltype(auto) xt::get ( T< Args... > & v)

Definition at line 525 of file xutils.hpp.

◆ get_backstrides()

template<class S , class T >
constexpr T xt::get_backstrides ( const S & shape,
const T & strides )
constexprnoexcept

Definition at line 232 of file xfixed.hpp.

◆ get_print_options()

print_options::print_options_impl xt::get_print_options ( std::ostream & out)
inline

Definition at line 693 of file xio.hpp.

◆ get_size() [1/2]

template<class S >
disable_xslice< S, std::size_t > xt::get_size ( const S & )
inlinenoexcept

Definition at line 853 of file xslice.hpp.

◆ get_size() [2/2]

template<class S >
auto xt::get_size ( const xslice< S > & slice)
inlinenoexcept

Definition at line 859 of file xslice.hpp.

◆ get_slice_implementation()

template<class E , class SL >
auto xt::get_slice_implementation ( E & e,
SL && slice,
std::size_t index )
inline

Definition at line 999 of file xslice.hpp.

◆ get_slice_value() [1/2]

template<class S , class It >
disable_xslice< S, std::size_t > xt::get_slice_value ( const S & s,
It &  )
inlinenoexcept

Definition at line 51 of file xview_utils.hpp.

◆ get_slice_value() [2/2]

template<class S , class It >
auto xt::get_slice_value ( const xslice< S > & slice,
It & it )
inlinenoexcept

Definition at line 57 of file xview_utils.hpp.

◆ get_strides()

template<layout_type L, class R , std::size_t... X>
constexpr R xt::get_strides ( const fixed_shape< X... > & shape)
constexprnoexcept

Definition at line 226 of file xfixed.hpp.

◆ has_shape()

template<class E , class S , class = typename std::enable_if_t<has_iterator_interface<S>::value>>
bool xt::has_shape ( const E & e,
const S & shape )
inline

Check if an object has a certain shape.

Parameters
aan array
shapethe shape to test
Returns
bool

Definition at line 145 of file xshape.hpp.

◆ has_value()

template<class E , xtl::check_concept< is_xexpression< E > > = 0>
auto xt::has_value ( E && e) -> detail::flag_expression_t<E>
inline

Definition at line 1272 of file xoptional.hpp.

◆ histogram() [1/6]

template<class R = double, class E1 , class E2 >
auto xt::histogram ( E1 && data,
E2 && bin_edges,
bool density = false )
inline

Compute the histogram of a set of data.

Parameters
dataThe data.
bin_edgesThe bin-edges.
densityIf true the resulting integral is normalized to 1. [default: false]
Returns
An one-dimensional xarray<double>, length: bin_edges.size()-1.

Definition at line 163 of file xhistogram.hpp.

◆ histogram() [2/6]

template<class R = double, class E1 , class E2 , class E3 >
auto xt::histogram ( E1 && data,
E2 && bin_edges,
E3 && weights,
bool density = false )
inline

Compute the histogram of a set of data.

Parameters
dataThe data.
bin_edgesThe bin-edges. It has to be 1-dimensional and monotonic.
weightsWeight factors corresponding to each data-point.
densityIf true the resulting integral is normalized to 1. [default: false]
Returns
An one-dimensional xarray<double>, length: bin_edges.size()-1.

Definition at line 142 of file xhistogram.hpp.

◆ histogram() [3/6]

template<class R = double, class E1 , class E2 >
auto xt::histogram ( E1 && data,
std::size_t bins,
E2 && weights,
bool density = false )
inline

Compute the histogram of a set of data.

Parameters
dataThe data.
binsThe number of bins.
weightsWeight factors corresponding to each data-point.
densityIf true the resulting integral is normalized to 1. [default: false]
Returns
An one-dimensional xarray<double>, length: bin_edges.size()-1.

Definition at line 241 of file xhistogram.hpp.

◆ histogram() [4/6]

template<class R = double, class E1 , class E2 , class E3 >
auto xt::histogram ( E1 && data,
std::size_t bins,
E2 && weights,
E3 left,
E3 right,
bool density = false )
inline

Compute the histogram of a set of data.

Parameters
dataThe data.
binsThe number of bins.
leftThe lower-most edge.
rightThe upper-most edge.
weightsWeight factors corresponding to each data-point.
densityIf true the resulting integral is normalized to 1. [default: false]
Returns
An one-dimensional xarray<double>, length: bin_edges.size()-1.

Definition at line 265 of file xhistogram.hpp.

◆ histogram() [5/6]

template<class R = double, class E1 , class E2 >
auto xt::histogram ( E1 && data,
std::size_t bins,
E2 left,
E2 right,
bool density = false )
inline

Compute the histogram of a set of data.

Parameters
dataThe data.
binsThe number of bins.
leftThe lower-most edge.
rightThe upper-most edge.
densityIf true the resulting integral is normalized to 1. [default: false]
Returns
An one-dimensional xarray<double>, length: bin_edges.size()-1.

Definition at line 215 of file xhistogram.hpp.

◆ histogram() [6/6]

template<class R = double, class E1 >
auto xt::histogram ( E1 && data,
std::size_t bins = 10,
bool density = false )
inline

Compute the histogram of a set of data.

Parameters
dataThe data.
binsThe number of bins. [default: 10]
densityIf true the resulting integral is normalized to 1. [default: false]
Returns
An one-dimensional xarray<double>, length: bin_edges.size()-1.

Definition at line 188 of file xhistogram.hpp.

◆ histogram_bin_edges() [1/4]

template<class E1 , class E2 , class E3 >
auto xt::histogram_bin_edges ( E1 && data,
E2 && weights,
E3 left,
E3 right,
std::size_t bins = 10,
histogram_algorithm mode = histogram_algorithm::automatic )
inline

Compute the bin-edges of a histogram of a set of data using different algorithms.

Parameters
dataThe data.
weightsWeight factors corresponding to each data-point.
leftThe lower-most edge.
rightThe upper-most edge.
binsThe number of bins. [default: 10]
modeThe type of algorithm to use. [default: "auto"]
Returns
An one-dimensional xarray<double>, length: bins+1.

Definition at line 301 of file xhistogram.hpp.

◆ histogram_bin_edges() [2/4]

template<class E1 , class E2 >
auto xt::histogram_bin_edges ( E1 && data,
E2 && weights,
std::size_t bins = 10,
histogram_algorithm mode = histogram_algorithm::automatic )
inline

Compute the bin-edges of a histogram of a set of data using different algorithms.

Parameters
dataThe data.
weightsWeight factors corresponding to each data-point.
binsThe number of bins. [default: 10]
modeThe type of algorithm to use. [default: "auto"]
Returns
An one-dimensional xarray<double>, length: bins+1.

Definition at line 418 of file xhistogram.hpp.

◆ histogram_bin_edges() [3/4]

template<class E1 , class E2 >
auto xt::histogram_bin_edges ( E1 && data,
E2 left,
E2 right,
std::size_t bins = 10,
histogram_algorithm mode = histogram_algorithm::automatic )
inline

Compute the bin-edges of a histogram of a set of data using different algorithms.

Parameters
dataThe data.
leftThe lower-most edge.
rightThe upper-most edge.
binsThe number of bins. [default: 10]
modeThe type of algorithm to use. [default: "auto"]
Returns
An one-dimensional xarray<double>, length: bins+1.

Definition at line 480 of file xhistogram.hpp.

◆ histogram_bin_edges() [4/4]

template<class E1 >
auto xt::histogram_bin_edges ( E1 && data,
std::size_t bins = 10,
histogram_algorithm mode = histogram_algorithm::automatic )
inline

Compute the bin-edges of a histogram of a set of data using different algorithms.

Parameters
dataThe data.
binsThe number of bins. [default: 10]
modeThe type of algorithm to use. [default: "auto"]
Returns
An one-dimensional xarray<double>, length: bins+1.

Definition at line 450 of file xhistogram.hpp.

◆ hstack()

template<class... CT>
auto xt::hstack ( std::tuple< CT... > && t)
inline

Stack xexpressions in sequence horizontally (column wise).

This is equivalent to concatenation along the second axis, except for 1-D xexpressions where it concatenate along the first axis.

Parameters
txtuple of xexpressions to stack
Returns
xgenerator evaluating to stacked elements

Definition at line 904 of file xbuilder.hpp.

◆ in_bounds()

template<class S , class... Args>
bool xt::in_bounds ( const S & shape,
Args &... args )

Check if the index is within the bounds of the array.

Parameters
shapeShape of the array.
argsArray index.
Returns
true If the index is within the bounds of the array.
false Otherwise.

◆ index_view() [1/2]

template<class E , std::size_t L>
auto xt::index_view ( E && e,
const xindex(&) indices[L] )
inlinenoexcept

Definition at line 792 of file xindex_view.hpp.

◆ index_view() [2/2]

template<class E , class I >
auto xt::index_view ( E && e,
I && indices )
inlinenoexcept

creates an indexview from a container of indices.

Returns a 1D view with the elements at indices selected.

Parameters
ethe underlying xexpression
indicesthe indices to select
xarray<double> a = {{1,5,3}, {4,5,6}};
b = index_view(a, {{0, 0}, {1, 0}, {1, 1}});
std::cout << b << std::endl; // {1, 4, 5}
b += 100;
std::cout << a << std::endl; // {{101, 5, 3}, {104, 105, 6}}
auto index_view(E &&e, I &&indices) noexcept
creates an indexview from a container of indices.

Definition at line 785 of file xindex_view.hpp.

◆ info()

template<class T >
std::string xt::info ( const T & t)

Definition at line 94 of file xinfo.hpp.

◆ initial()

template<class T >
constexpr auto xt::initial ( T val)
constexpr

Definition at line 65 of file xreducer.hpp.

◆ integral_count()

template<class... S>
constexpr std::size_t xt::integral_count ( )
constexpr

Definition at line 124 of file xview_utils.hpp.

◆ integral_count_before()

template<class... S>
constexpr std::size_t xt::integral_count_before ( std::size_t i)
constexpr

Definition at line 130 of file xview_utils.hpp.

◆ integral_skip()

template<class... S>
constexpr std::size_t xt::integral_skip ( std::size_t i)
constexpr

Definition at line 229 of file xview_utils.hpp.

◆ is_chunked() [1/2]

template<class E >
constexpr bool xt::is_chunked ( )
constexpr

Definition at line 339 of file xchunked_array.hpp.

◆ is_chunked() [2/2]

template<class E >
constexpr bool xt::is_chunked ( const xexpression< E > & e)
constexpr

Definition at line 333 of file xchunked_array.hpp.

◆ keep() [1/3]

template<class R = std::ptrdiff_t, class Arg0 , class Arg1 , class... Args>
xkeep_slice< R > xt::keep ( Arg0 i0,
Arg1 i1,
Args... args )
inline

Definition at line 420 of file xslice.hpp.

◆ keep() [2/3]

template<class T >
detail::disable_integral_keep< T > xt::keep ( T && indices)
inline

Create a non-contigous slice from a container of indices to keep.

Note: this slice cannot be used in the xstrided_view!

a.reshape({3, 3});
xt::view(a, xt::keep(0, 2); // => {{0, 1, 2}, {6, 7, 8}}
xt::view(a, xt::keep(1, 1, 1); // => {{3, 4, 5}, {3, 4, 5}, {3, 4, 5}}
detail::disable_integral_keep< T > keep(T &&indices)
Create a non-contigous slice from a container of indices to keep.
Definition xslice.hpp:405
Parameters
indicesThe indices container
Returns
instance of xkeep_slice

Definition at line 405 of file xslice.hpp.

◆ keep() [3/3]

template<class R = std::ptrdiff_t, class T >
detail::enable_integral_keep< T, R > xt::keep ( T i)
inline

Definition at line 411 of file xslice.hpp.

◆ layout_remove_any()

constexpr layout_type xt::layout_remove_any ( const layout_type layout)
constexprnoexcept

Definition at line 98 of file xlayout.hpp.

◆ linear_begin() [1/6]

template<class C >
constexpr auto xt::linear_begin ( C & c)
constexprnoexcept

Definition at line 421 of file xiterator.hpp.

◆ linear_begin() [2/6]

template<class C >
constexpr auto xt::linear_begin ( const C & c)
constexprnoexcept

Definition at line 453 of file xiterator.hpp.

◆ linear_begin() [3/6]

template<class CT , class X >
constexpr auto xt::linear_begin ( const xbroadcast< CT, X > & c)
constexprnoexcept

Definition at line 110 of file xbroadcast.hpp.

◆ linear_begin() [4/6]

template<class CT >
constexpr auto xt::linear_begin ( const xscalar< CT > & c) -> decltype(c.dummy_begin())
constexprnoexcept

Definition at line 479 of file xscalar.hpp.

◆ linear_begin() [5/6]

template<class CT , class X >
constexpr auto xt::linear_begin ( xbroadcast< CT, X > & c)
constexprnoexcept

Definition at line 98 of file xbroadcast.hpp.

◆ linear_begin() [6/6]

template<class CT >
constexpr auto xt::linear_begin ( xscalar< CT > & c) -> decltype(c.dummy_begin())
constexprnoexcept

Definition at line 467 of file xscalar.hpp.

◆ linear_end() [1/6]

template<class C >
constexpr auto xt::linear_end ( C & c)
constexprnoexcept

Definition at line 437 of file xiterator.hpp.

◆ linear_end() [2/6]

template<class C >
constexpr auto xt::linear_end ( const C & c)
constexprnoexcept

Definition at line 469 of file xiterator.hpp.

◆ linear_end() [3/6]

template<class CT , class X >
constexpr auto xt::linear_end ( const xbroadcast< CT, X > & c)
constexprnoexcept

Definition at line 116 of file xbroadcast.hpp.

◆ linear_end() [4/6]

template<class CT >
constexpr auto xt::linear_end ( const xscalar< CT > & c) -> decltype(c.dummy_end())
constexprnoexcept

Definition at line 485 of file xscalar.hpp.

◆ linear_end() [5/6]

template<class CT , class X >
constexpr auto xt::linear_end ( xbroadcast< CT, X > & c)
constexprnoexcept

Definition at line 104 of file xbroadcast.hpp.

◆ linear_end() [6/6]

template<class CT >
constexpr auto xt::linear_end ( xscalar< CT > & c) -> decltype(c.dummy_end())
constexprnoexcept

Definition at line 473 of file xscalar.hpp.

◆ linspace()

template<class T >
auto xt::linspace ( T start,
T stop,
std::size_t num_samples = 50,
bool endpoint = true )
inlinenoexcept

Generates num_samples evenly spaced numbers over given interval.

Parameters
startstart of interval
stopstop of interval
num_samplesnumber of samples (defaults to 50)
endpointif true, include endpoint (defaults to true)
Template Parameters
Tvalue_type of xexpression
Returns
xgenerator that generates the values on access

Definition at line 460 of file xbuilder.hpp.

◆ load_csv()

template<class T , class A = std::allocator<T>>
xcsv_tensor< T, A > xt::load_csv ( std::istream & stream,
const char delimiter,
const std::size_t skip_rows,
const std::ptrdiff_t max_rows,
const std::string comments )

Load tensor from CSV.

Returns an xexpression for the parsed CSV

Parameters
streamthe input stream containing the CSV encoded values
delimiterthe character used to separate values. [default: ',']
skip_rowsthe number of lines to skip from the beginning. [default: 0]
max_rowsthe number of lines to read after skip_rows lines; the default is to read all the lines. [default: -1]
commentsthe string used to indicate the start of a comment. [default: "#"]

Definition at line 152 of file xcsv.hpp.

◆ load_file()

template<class E >
void xt::load_file ( std::istream & stream,
xexpression< E > & e,
const xcsv_config & config )

Definition at line 257 of file xcsv.hpp.

◆ load_npy() [1/2]

template<typename T , layout_type L = layout_type::dynamic>
auto xt::load_npy ( const std::string & filename)
inline

Loads a npy file (the NumPy storage format)

Parameters
filenameThe filename or path to the file
Template Parameters
Tselect the type of the npy file (note: currently there is no dynamic casting if types do not match)
Lselect layout_type::column_major if you stored data in Fortran format
Returns
xarray with contents from npy file

Definition at line 791 of file xnpy.hpp.

◆ load_npy() [2/2]

template<typename T , layout_type L = layout_type::dynamic>
auto xt::load_npy ( std::istream & stream)
inline

Loads a npy file (the NumPy storage format)

Parameters
streamAn input stream from which to load the file
Template Parameters
Tselect the type of the npy file (note: currently there is no dynamic casting if types do not match)
Lselect layout_type::column_major if you stored data in Fortran format
Returns
xarray with contents from npy file

Definition at line 774 of file xnpy.hpp.

◆ logspace()

template<class T >
auto xt::logspace ( T start,
T stop,
std::size_t num_samples,
T base = 10,
bool endpoint = true )
inlinenoexcept

Generates num_samples numbers evenly spaced on a log scale over given interval.

Parameters
startstart of interval (pow(base, start) is the first value).
stopstop of interval (pow(base, stop) is the final value, except if endpoint = false)
num_samplesnumber of samples (defaults to 50)
basethe base of the log space.
endpointif true, include endpoint (defaults to true)
Template Parameters
Tvalue_type of xexpression
Returns
xgenerator that generates the values on access

Definition at line 481 of file xbuilder.hpp.

◆ make_lambda_xfunction()

template<class F , class... E>
auto xt::make_lambda_xfunction ( F && lambda,
E &&... args )
inline

Create a xfunction from a lambda.

This function can be used to easily create performant xfunctions from lambdas:

template <class E1>
inline auto square(E1&& e1) noexcept
{
auto fnct = [](auto x) -> decltype(x * x) {
return x * x;
};
return make_lambda_xfunction(std::move(fnct), std::forward<E1>(e1));
}
auto square(E1 &&e1) noexcept
Square power function, equivalent to e1 * e1.
Definition xmath.hpp:1128
auto make_lambda_xfunction(F &&lambda, E &&... args)
Create a xfunction from a lambda.
Definition xmath.hpp:1085

Lambda function allow the reusal of a single arguments in multiple places (otherwise only correctly possible when using xshared_expressions). auto lambda functions are automatically vectorized with xsimd if possible (note that the trailing -> decltype(...) is mandatory for the feature detection to work).

Parameters
lambdathe lambda to be vectorized
argsforwarded arguments
Returns
lazy xfunction

Definition at line 1085 of file xmath.hpp.

◆ make_overlapping_memory_checker()

template<class Dst >
auto xt::make_overlapping_memory_checker ( const Dst & a_dst)

Definition at line 1009 of file xutils.hpp.

◆ make_xaccumulator_functor() [1/2]

template<class RF >
auto xt::make_xaccumulator_functor ( RF && accumulate_func)

Definition at line 69 of file xaccumulator.hpp.

◆ make_xaccumulator_functor() [2/2]

template<class RF , class IF >
auto xt::make_xaccumulator_functor ( RF && accumulate_func,
IF && init_func )

Definition at line 76 of file xaccumulator.hpp.

◆ make_xiterator_adaptor()

template<class C , class IG >
auto xt::make_xiterator_adaptor ( C && container,
IG iterator_getter )
inline

Definition at line 1275 of file xbuffer_adaptor.hpp.

◆ make_xreducer_functor() [1/3]

template<class RF >
auto xt::make_xreducer_functor ( RF && reduce_func)

Definition at line 691 of file xreducer.hpp.

◆ make_xreducer_functor() [2/3]

template<class RF , class IF >
auto xt::make_xreducer_functor ( RF && reduce_func,
IF && init_func )

Definition at line 698 of file xreducer.hpp.

◆ make_xreducer_functor() [3/3]

template<class RF , class IF , class MF >
auto xt::make_xreducer_functor ( RF && reduce_func,
IF && init_func,
MF && merge_func )

Definition at line 705 of file xreducer.hpp.

◆ make_xshared()

template<class E >
xshared_expression< E > xt::make_xshared ( xexpression< E > && expr)
inline

Helper function to create shared expression from any xexpression.

Parameters
exprrvalue expression that will be shared
Returns
xshared expression

Definition at line 730 of file xexpression.hpp.

◆ masked_view()

template<class CTD , class CTM >
xmasked_view< CTD, CTM > xt::masked_view ( CTD && data,
CTM && mask )
inline

Definition at line 597 of file xmasked_view.hpp.

◆ mean() [1/2]

template<class T = void, class E , class I , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto xt::mean ( E && e,
const I(&) axes[N],
EVS es = EVS() )
inline

Definition at line 1947 of file xmath.hpp.

◆ mean() [2/2]

template<class T = void, class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS > > = 0>
auto xt::mean ( E && e,
EVS es = EVS() )
inline

Definition at line 1941 of file xmath.hpp.

◆ median()

template<class E >
std::decay_t< E >::value_type xt::median ( E && e)
inline

Definition at line 1093 of file xsort.hpp.

◆ meshgrid()

template<class... E>
auto xt::meshgrid ( E &&... e)
inlinenoexcept

Return coordinate tensors from coordinate vectors.

Make N-D coordinate tensor expressions for vectorized evaluations of N-D scalar/vector fields over N-D grids, given one-dimensional coordinate arrays x1, x2,..., xn.

Parameters
exexpressions to concatenate
Returns
tuple of xgenerator expressions.

Definition at line 980 of file xbuilder.hpp.

◆ mime_bundle_repr() [1/15]

template<class EC , layout_type L, class SC , class Tag >
nlohmann::json xt::mime_bundle_repr ( const xarray_container< EC, L, SC, Tag > & expr)

Definition at line 313 of file xmime.hpp.

◆ mime_bundle_repr() [2/15]

template<class CT , class X >
nlohmann::json xt::mime_bundle_repr ( const xbroadcast< CT, X > & expr)

Definition at line 376 of file xmime.hpp.

◆ mime_bundle_repr() [3/15]

template<class ET , class S , layout_type L, bool SH, class Tag >
nlohmann::json xt::mime_bundle_repr ( const xfixed_container< ET, S, L, SH, Tag > & expr)

Definition at line 331 of file xmime.hpp.

◆ mime_bundle_repr() [4/15]

template<class F , class... CT>
nlohmann::json xt::mime_bundle_repr ( const xfunction< F, CT... > & expr)

Definition at line 304 of file xmime.hpp.

◆ mime_bundle_repr() [5/15]

template<class F , class CT >
nlohmann::json xt::mime_bundle_repr ( const xfunctor_view< F, CT > & expr)

Definition at line 295 of file xmime.hpp.

◆ mime_bundle_repr() [6/15]

template<class F , class R , class S >
nlohmann::json xt::mime_bundle_repr ( const xgenerator< F, R, S > & expr)

Definition at line 385 of file xmime.hpp.

◆ mime_bundle_repr() [7/15]

template<class T , class B >
nlohmann::json xt::mime_bundle_repr ( const xmasked_value< T, B > & v)

Definition at line 421 of file xmime.hpp.

◆ mime_bundle_repr() [8/15]

template<class CTD , class CTM >
nlohmann::json xt::mime_bundle_repr ( const xmasked_view< CTD, CTM > & expr)

Definition at line 412 of file xmime.hpp.

◆ mime_bundle_repr() [9/15]

template<class VE , class FE >
nlohmann::json xt::mime_bundle_repr ( const xoptional_assembly< VE, FE > & expr)

Definition at line 349 of file xmime.hpp.

◆ mime_bundle_repr() [10/15]

template<class VEC , class FEC >
nlohmann::json xt::mime_bundle_repr ( const xoptional_assembly_adaptor< VEC, FEC > & expr)

Definition at line 358 of file xmime.hpp.

◆ mime_bundle_repr() [11/15]

template<class F , class CT , class X , class O >
nlohmann::json xt::mime_bundle_repr ( const xreducer< F, CT, X, O > & expr)

Definition at line 340 of file xmime.hpp.

◆ mime_bundle_repr() [12/15]

template<class CT >
nlohmann::json xt::mime_bundle_repr ( const xscalar< CT > & expr)

Definition at line 367 of file xmime.hpp.

◆ mime_bundle_repr() [13/15]

template<class CT , class S , layout_type L, class FST >
nlohmann::json xt::mime_bundle_repr ( const xstrided_view< CT, S, L, FST > & expr)

Definition at line 403 of file xmime.hpp.

◆ mime_bundle_repr() [14/15]

template<class EC , std::size_t N, layout_type L, class Tag >
nlohmann::json xt::mime_bundle_repr ( const xtensor_container< EC, N, L, Tag > & expr)

Definition at line 322 of file xmime.hpp.

◆ mime_bundle_repr() [15/15]

template<class CT , class... S>
nlohmann::json xt::mime_bundle_repr ( const xview< CT, S... > & expr)

Definition at line 394 of file xmime.hpp.

◆ mime_bundle_repr_impl()

template<class E >
nlohmann::json xt::mime_bundle_repr_impl ( const E & expr)

Definition at line 262 of file xmime.hpp.

◆ multiindex_iterator_begin()

template<class S , class B , class E >
auto xt::multiindex_iterator_begin ( B && roi_begin,
E && roi_end )

Definition at line 100 of file xmultiindex_iterator.hpp.

◆ multiindex_iterator_end()

template<class S , class B , class E >
auto xt::multiindex_iterator_end ( B && roi_begin,
E && roi_end )

Definition at line 109 of file xmultiindex_iterator.hpp.

◆ nancumprod()

template<class T = void, class E >
auto xt::nancumprod ( E && e)
inline

Definition at line 2676 of file xmath.hpp.

◆ nancumsum()

template<class T = void, class E >
auto xt::nancumsum ( E && e)
inline

Definition at line 2641 of file xmath.hpp.

◆ nanmax() [1/3]

template<class T = void, class E , class I , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto xt::nanmax ( E && e,
const I(&) axes[N],
EVS es = EVS() )
inline

Definition at line 2480 of file xmath.hpp.

◆ nanmax() [2/3]

template<class T = void, class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS > > = 0>
auto xt::nanmax ( E && e,
EVS es = EVS() )
inline

Definition at line 2480 of file xmath.hpp.

◆ nanmax() [3/3]

template<class T = void, class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > >, xtl::is_integral< std::decay_t< X > > > = 0>
auto xt::nanmax ( E && e,
X axis,
EVS es = EVS() )
inline

Definition at line 2480 of file xmath.hpp.

◆ nanmean() [1/2]

template<class T = void, class E , class I , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto xt::nanmean ( E && e,
const I(&) axes[N],
EVS es = EVS() )
inline

Definition at line 2778 of file xmath.hpp.

◆ nanmean() [2/2]

template<class T = void, class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS > > = 0>
auto xt::nanmean ( E && e,
EVS es = EVS() )
inline

Definition at line 2766 of file xmath.hpp.

◆ nanmin() [1/3]

template<class T = void, class E , class I , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto xt::nanmin ( E && e,
const I(&) axes[N],
EVS es = EVS() )
inline

Definition at line 2465 of file xmath.hpp.

◆ nanmin() [2/3]

template<class T = void, class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS > > = 0>
auto xt::nanmin ( E && e,
EVS es = EVS() )
inline

Definition at line 2465 of file xmath.hpp.

◆ nanmin() [3/3]

template<class T = void, class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > >, xtl::is_integral< std::decay_t< X > > > = 0>
auto xt::nanmin ( E && e,
X axis,
EVS es = EVS() )
inline

Definition at line 2465 of file xmath.hpp.

◆ nanprod() [1/3]

template<class T = void, class E , class I , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto xt::nanprod ( E && e,
const I(&) axes[N],
EVS es = EVS() )
inline

Definition at line 2514 of file xmath.hpp.

◆ nanprod() [2/3]

template<class T = void, class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS > > = 0>
auto xt::nanprod ( E && e,
EVS es = EVS() )
inline

Definition at line 2514 of file xmath.hpp.

◆ nanprod() [3/3]

template<class T = void, class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > >, xtl::is_integral< std::decay_t< X > > > = 0>
auto xt::nanprod ( E && e,
X axis,
EVS es = EVS() )
inline

Definition at line 2514 of file xmath.hpp.

◆ nanstd() [1/2]

template<class T = void, class E , class A , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto xt::nanstd ( E && e,
const A(&) axes[N],
EVS es = EVS() )
inline

Definition at line 2880 of file xmath.hpp.

◆ nanstd() [2/2]

template<class T = void, class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS > > = 0>
auto xt::nanstd ( E && e,
EVS es = EVS() )
inline

Definition at line 2795 of file xmath.hpp.

◆ nansum() [1/3]

template<class T = void, class E , class I , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto xt::nansum ( E && e,
const I(&) axes[N],
EVS es = EVS() )
inline

Definition at line 2497 of file xmath.hpp.

◆ nansum() [2/3]

template<class T = void, class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS > > = 0>
auto xt::nansum ( E && e,
EVS es = EVS() )
inline

Definition at line 2497 of file xmath.hpp.

◆ nansum() [3/3]

template<class T = void, class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > >, xtl::is_integral< std::decay_t< X > > > = 0>
auto xt::nansum ( E && e,
X axis,
EVS es = EVS() )
inline

Definition at line 2497 of file xmath.hpp.

◆ nanvar() [1/2]

template<class T = void, class E , class A , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto xt::nanvar ( E && e,
const A(&) axes[N],
EVS es = EVS() )
inline

Definition at line 2890 of file xmath.hpp.

◆ nanvar() [2/2]

template<class T = void, class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS > > = 0>
auto xt::nanvar ( E && e,
EVS es = EVS() )
inline

Definition at line 2788 of file xmath.hpp.

◆ nested_copy() [1/2]

template<class T , class S >
void xt::nested_copy ( T && iter,
const S & s )
inline

Definition at line 335 of file xutils.hpp.

◆ nested_copy() [2/2]

template<class T , class S >
void xt::nested_copy ( T && iter,
std::initializer_list< S > s )
inline

Definition at line 341 of file xutils.hpp.

◆ newaxis()

auto xt::newaxis ( )
inlinenoexcept

Returns a slice representing a new axis of length one, to be used as an argument of view function.

See also
view, strided_view

Definition at line 300 of file xslice.hpp.

◆ newaxis_count()

template<class... S>
constexpr std::size_t xt::newaxis_count ( )
constexpr

Definition at line 174 of file xview_utils.hpp.

◆ newaxis_count_before()

template<class... S>
constexpr std::size_t xt::newaxis_count_before ( std::size_t i)
constexpr

Definition at line 180 of file xview_utils.hpp.

◆ newaxis_skip()

template<class... S>
constexpr std::size_t xt::newaxis_skip ( std::size_t i)
constexpr

Definition at line 277 of file xview_utils.hpp.

◆ noalias()

template<class A >
noalias_proxy< xtl::closure_type_t< A > > xt::noalias ( A && a)
inlinenoexcept

Definition at line 224 of file xnoalias.hpp.

◆ norm_l2()

template<class E , class I , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto xt::norm_l2 ( E && e,
const I(&) axes[N],
EVS es = EVS() )
inlinenoexcept

Definition at line 522 of file xnorm.hpp.

◆ norm_lp() [1/2]

template<class E , class I , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto xt::norm_lp ( E && e,
double p,
const I(&) axes[N],
EVS es = EVS() )
inline

Definition at line 614 of file xnorm.hpp.

◆ norm_lp() [2/2]

template<class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_xexpression< E > > = 0>
auto xt::norm_lp ( E && e,
double p,
EVS es = EVS() )
inline

Definition at line 608 of file xnorm.hpp.

◆ norm_lp_to_p() [1/2]

template<class E , class I , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto xt::norm_lp_to_p ( E && e,
double p,
const I(&) axes[N],
EVS es = EVS() )
inlinenoexcept

Definition at line 581 of file xnorm.hpp.

◆ norm_lp_to_p() [2/2]

template<class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_xexpression< E > > = 0>
auto xt::norm_lp_to_p ( E && e,
double p,
EVS es = EVS() )
inlinenoexcept

Definition at line 575 of file xnorm.hpp.

◆ normalize_axis() [1/3]

template<class E , class C >
std::enable_if_t< !xtl::is_integral< std::decay_t< C > >::value &&xtl::is_signed< typename std::decay_t< C >::value_type >::value, rebind_container_t< std::size_t, std::decay_t< C > > > xt::normalize_axis ( E & expr,
C && axes )
inline

Definition at line 386 of file xutils.hpp.

◆ normalize_axis() [2/3]

template<class C , class E >
std::enable_if_t< !xtl::is_integral< std::decay_t< C > >::value &&std::is_unsigned< typename std::decay_t< C >::value_type >::value, C && > xt::normalize_axis ( E & expr,
C && axes )
inline

Definition at line 412 of file xutils.hpp.

◆ normalize_axis() [3/3]

std::size_t xt::normalize_axis ( std::size_t dim,
std::ptrdiff_t axis )
inline

Definition at line 376 of file xutils.hpp.

◆ ones() [1/2]

template<class T , class I , std::size_t L>
auto xt::ones ( const I(&) shape[L])
inlinenoexcept

Definition at line 52 of file xbuilder.hpp.

◆ ones() [2/2]

template<class T , class S >
auto xt::ones ( S shape)
inlinenoexcept

Returns an xexpression containing ones of the specified shape.

Template Parameters
shapethe shape of the returned expression.

Definition at line 46 of file xbuilder.hpp.

◆ ones_like()

template<class E >
auto xt::ones_like ( const xexpression< E > & e)
inline

Create a xcontainer (xarray, xtensor or xtensor_fixed), filled with ones and of the same shape, value type and layout as the input xexpression e.

Note: contrary to ones(shape), this function returns a non-lazy, evaluated container! Use xt::ones<double>(e.shape()); for a lazy version.

Parameters
ethe xexpression from which to extract shape, value type and layout.

Definition at line 169 of file xbuilder.hpp.

◆ operator!=() [1/9]

template<class T , std::size_t N>
bool xt::operator!= ( const const_array< T, N > & lhs,
const const_array< T, N > & rhs )
inline

Definition at line 1611 of file xstorage.hpp.

◆ operator!=() [2/9]

template<class T , std::ptrdiff_t TB, std::ptrdiff_t TE>
bool xt::operator!= ( const sequence_view< T, TB, TE > & lhs,
const sequence_view< T, TB, TE > & rhs )
inline

Definition at line 1930 of file xstorage.hpp.

◆ operator!=() [3/9]

template<class T , std::size_t N, class A , bool Init>
bool xt::operator!= ( const svector< T, N, A, Init > & lhs,
const svector< T, N, A, Init > & rhs )
inline

Definition at line 1379 of file xstorage.hpp.

◆ operator!=() [4/9]

template<class T , class AT , alloc_tracking::policy PT, class U , class AU , alloc_tracking::policy PU>
bool xt::operator!= ( const tracking_allocator< T, AT, PT > & a,
const tracking_allocator< U, AU, PU > & b )
inline

Definition at line 861 of file xutils.hpp.

◆ operator!=() [5/9]

template<class T , class A >
bool xt::operator!= ( const uvector< T, A > & lhs,
const uvector< T, A > & rhs )
inline

Definition at line 586 of file xstorage.hpp.

◆ operator!=() [6/9]

template<class CT >
bool xt::operator!= ( const xaxis_iterator< CT > & lhs,
const xaxis_iterator< CT > & rhs )
inline

Checks inequality of the iterators.

Returns
true if the iterators are different, true otherwise

Definition at line 267 of file xaxis_iterator.hpp.

◆ operator!=() [7/9]

template<class CT >
bool xt::operator!= ( const xaxis_slice_iterator< CT > & lhs,
const xaxis_slice_iterator< CT > & rhs )
inline

Checks inequality of the iterators.

Returns
true if the iterators are different, true otherwise

Definition at line 281 of file xaxis_slice_iterator.hpp.

◆ operator!=() [8/9]

template<class D >
bool xt::operator!= ( const xbuffer_adaptor_base< D > & lhs,
const xbuffer_adaptor_base< D > & rhs )
inline

Definition at line 1001 of file xbuffer_adaptor.hpp.

◆ operator!=() [9/9]

◆ operator<() [1/10]

template<class T , std::size_t N>
bool xt::operator< ( const const_array< T, N > & lhs,
const const_array< T, N > & rhs )
inline

Definition at line 1617 of file xstorage.hpp.

◆ operator<() [2/10]

template<class T , std::size_t N, class A , bool Init>
bool xt::operator< ( const svector< T, N, A, Init > & lhs,
const svector< T, N, A, Init > & rhs )
inline

Definition at line 1385 of file xstorage.hpp.

◆ operator<() [3/10]

template<class T , class A >
bool xt::operator< ( const uvector< T, A > & lhs,
const uvector< T, A > & rhs )
inline

Definition at line 592 of file xstorage.hpp.

◆ operator<() [4/10]

template<class It , class BIt >
bool xt::operator< ( const xbounded_iterator< It, BIt > & lhs,
const xbounded_iterator< It, BIt > & rhs )
inline

Definition at line 1297 of file xiterator.hpp.

◆ operator<() [5/10]

template<class D >
bool xt::operator< ( const xbuffer_adaptor_base< D > & lhs,
const xbuffer_adaptor_base< D > & rhs )
inline

Definition at line 1007 of file xbuffer_adaptor.hpp.

◆ operator<() [6/10]

template<bool is_const, class CT >
bool xt::operator< ( const xdummy_iterator< is_const, CT > & lhs,
const xdummy_iterator< is_const, CT > & rhs )
inlinenoexcept

Definition at line 1091 of file xscalar.hpp.

◆ operator<() [7/10]

template<class F , class... CT>
bool xt::operator< ( const xfunction_iterator< F, CT... > & it1,
const xfunction_iterator< F, CT... > & it2 )
inline

Definition at line 1058 of file xfunction.hpp.

◆ operator<() [8/10]

template<class F , class IT >
bool xt::operator< ( const xfunctor_iterator< F, IT > & lhs,
const xfunctor_iterator< F, IT > & rhs )

Definition at line 1579 of file xfunctor_view.hpp.

◆ operator<() [9/10]

template<class St , class S , layout_type L>
bool xt::operator< ( const xiterator< St, S, L > & lhs,
const xiterator< St, S, L > & rhs )

Definition at line 1217 of file xiterator.hpp.

◆ operator<() [10/10]

◆ operator<<()

template<class E >
std::ostream & xt::operator<< ( std::ostream & out,
const xexpression< E > & e )
inline

Definition at line 821 of file xio.hpp.

◆ operator<=() [1/5]

template<class T , std::size_t N>
bool xt::operator<= ( const const_array< T, N > & lhs,
const const_array< T, N > & rhs )
inline

Definition at line 1623 of file xstorage.hpp.

◆ operator<=() [2/5]

template<class T , std::size_t N, class A , bool Init>
bool xt::operator<= ( const svector< T, N, A, Init > & lhs,
const svector< T, N, A, Init > & rhs )
inline

Definition at line 1391 of file xstorage.hpp.

◆ operator<=() [3/5]

template<class T , class A >
bool xt::operator<= ( const uvector< T, A > & lhs,
const uvector< T, A > & rhs )
inline

Definition at line 598 of file xstorage.hpp.

◆ operator<=() [4/5]

template<class D >
bool xt::operator<= ( const xbuffer_adaptor_base< D > & lhs,
const xbuffer_adaptor_base< D > & rhs )
inline

Definition at line 1019 of file xbuffer_adaptor.hpp.

◆ operator<=() [5/5]

◆ operator==() [1/16]

template<class T , std::size_t N>
bool xt::operator== ( const const_array< T, N > & lhs,
const const_array< T, N > & rhs )
inline

Definition at line 1605 of file xstorage.hpp.

◆ operator==() [2/16]

template<class T , std::ptrdiff_t TB, std::ptrdiff_t TE>
bool xt::operator== ( const sequence_view< T, TB, TE > & lhs,
const sequence_view< T, TB, TE > & rhs )
inline

Definition at line 1924 of file xstorage.hpp.

◆ operator==() [3/16]

template<class T , std::size_t N, class A , bool Init>
bool xt::operator== ( const std::vector< T > & lhs,
const svector< T, N, A, Init > & rhs )
inline

Definition at line 1361 of file xstorage.hpp.

◆ operator==() [4/16]

template<class T , std::size_t N, class A , bool Init>
bool xt::operator== ( const svector< T, N, A, Init > & lhs,
const std::vector< T > & rhs )
inline

Definition at line 1367 of file xstorage.hpp.

◆ operator==() [5/16]

template<class T , std::size_t N, class A , bool Init>
bool xt::operator== ( const svector< T, N, A, Init > & lhs,
const svector< T, N, A, Init > & rhs )
inline

Definition at line 1373 of file xstorage.hpp.

◆ operator==() [6/16]

template<class T , class AT , alloc_tracking::policy PT, class U , class AU , alloc_tracking::policy PU>
bool xt::operator== ( const tracking_allocator< T, AT, PT > & ,
const tracking_allocator< U, AU, PU > &  )
inline

Definition at line 855 of file xutils.hpp.

◆ operator==() [7/16]

template<class T , class A >
bool xt::operator== ( const uvector< T, A > & lhs,
const uvector< T, A > & rhs )
inline

Definition at line 580 of file xstorage.hpp.

◆ operator==() [8/16]

template<class CT >
bool xt::operator== ( const xaxis_iterator< CT > & lhs,
const xaxis_iterator< CT > & rhs )
inline

Checks equality of the iterators.

Returns
true if the iterators are equivalent, false otherwise

Definition at line 257 of file xaxis_iterator.hpp.

◆ operator==() [9/16]

template<class CT >
bool xt::operator== ( const xaxis_slice_iterator< CT > & lhs,
const xaxis_slice_iterator< CT > & rhs )
inline

Checks equality of the iterators.

Returns
true if the iterators are equivalent, false otherwise

Definition at line 271 of file xaxis_slice_iterator.hpp.

◆ operator==() [10/16]

template<class It , class BIt >
bool xt::operator== ( const xbounded_iterator< It, BIt > & lhs,
const xbounded_iterator< It, BIt > & rhs )
inline

Definition at line 1291 of file xiterator.hpp.

◆ operator==() [11/16]

template<class D >
bool xt::operator== ( const xbuffer_adaptor_base< D > & lhs,
const xbuffer_adaptor_base< D > & rhs )
inline

Definition at line 994 of file xbuffer_adaptor.hpp.

◆ operator==() [12/16]

template<bool is_const, class CT >
bool xt::operator== ( const xdummy_iterator< is_const, CT > & lhs,
const xdummy_iterator< is_const, CT > & rhs )
inlinenoexcept

Definition at line 1085 of file xscalar.hpp.

◆ operator==() [13/16]

template<class F , class... CT>
bool xt::operator== ( const xfunction_iterator< F, CT... > & it1,
const xfunction_iterator< F, CT... > & it2 )
inline

Definition at line 1052 of file xfunction.hpp.

◆ operator==() [14/16]

template<class F , class IT >
bool xt::operator== ( const xfunctor_iterator< F, IT > & lhs,
const xfunctor_iterator< F, IT > & rhs )

Definition at line 1573 of file xfunctor_view.hpp.

◆ operator==() [15/16]

template<class St , class S , layout_type L>
bool xt::operator== ( const xiterator< St, S, L > & lhs,
const xiterator< St, S, L > & rhs )
inline

Definition at line 1211 of file xiterator.hpp.

◆ operator==() [16/16]

◆ operator>() [1/5]

template<class T , std::size_t N>
bool xt::operator> ( const const_array< T, N > & lhs,
const const_array< T, N > & rhs )
inline

Definition at line 1629 of file xstorage.hpp.

◆ operator>() [2/5]

template<class T , std::size_t N, class A , bool Init>
bool xt::operator> ( const svector< T, N, A, Init > & lhs,
const svector< T, N, A, Init > & rhs )
inline

Definition at line 1397 of file xstorage.hpp.

◆ operator>() [3/5]

template<class T , class A >
bool xt::operator> ( const uvector< T, A > & lhs,
const uvector< T, A > & rhs )
inline

Definition at line 604 of file xstorage.hpp.

◆ operator>() [4/5]

template<class D >
bool xt::operator> ( const xbuffer_adaptor_base< D > & lhs,
const xbuffer_adaptor_base< D > & rhs )
inline

Definition at line 1031 of file xbuffer_adaptor.hpp.

◆ operator>() [5/5]

◆ operator>=() [1/5]

template<class T , std::size_t N>
bool xt::operator>= ( const const_array< T, N > & lhs,
const const_array< T, N > & rhs )
inline

Definition at line 1635 of file xstorage.hpp.

◆ operator>=() [2/5]

template<class T , std::size_t N, class A , bool Init>
bool xt::operator>= ( const svector< T, N, A, Init > & lhs,
const svector< T, N, A, Init > & rhs )
inline

Definition at line 1403 of file xstorage.hpp.

◆ operator>=() [3/5]

template<class T , class A >
bool xt::operator>= ( const uvector< T, A > & lhs,
const uvector< T, A > & rhs )
inline

Definition at line 610 of file xstorage.hpp.

◆ operator>=() [4/5]

template<class D >
bool xt::operator>= ( const xbuffer_adaptor_base< D > & lhs,
const xbuffer_adaptor_base< D > & rhs )
inline

Definition at line 1043 of file xbuffer_adaptor.hpp.

◆ operator>=() [5/5]

◆ operator|()

template<template< class... > class A, class... AX, class X , xtl::check_concept< is_evaluation_strategy< AX >..., is_evaluation_strategy< X > > = 0>
auto xt::operator| ( const A< AX... > & args,
const A< X > & rhs )

Definition at line 37 of file xreducer.hpp.

◆ optional_assembly_storage() [1/2]

template<class VE , class FE >
xoptional_assembly_storage< VE, FE > xt::optional_assembly_storage ( const VE & value,
const FE & flag )
inline

Definition at line 559 of file xoptional_assembly_storage.hpp.

◆ optional_assembly_storage() [2/2]

template<class VE , class FE >
xoptional_assembly_storage< VE, FE > xt::optional_assembly_storage ( VE & value,
FE & flag )
inline

Definition at line 565 of file xoptional_assembly_storage.hpp.

◆ pad() [1/3]

template<class E , class S = typename std::decay_t<E>::size_type, class V = typename std::decay_t<E>::value_type>
auto xt::pad ( E && e,
const std::vector< S > & pad_width,
pad_mode mode = pad_mode::constant,
V constant_value = 0 )
inline

Pad an array.

Parameters
eThe array.
pad_widthNumber of values padded to the edges of each axis: {before, after}.
modeThe type of algorithm to use. [default: xt::pad_mode::constant].
constant_valueThe value to set the padded values for each axis (used in xt::pad_mode::constant).
Returns
The padded array.

Definition at line 217 of file xpad.hpp.

◆ pad() [2/3]

template<class E , class S = typename std::decay_t<E>::size_type, class V = typename std::decay_t<E>::value_type>
auto xt::pad ( E && e,
const std::vector< std::vector< S > > & pad_width,
pad_mode mode = pad_mode::constant,
V constant_value = 0 )
inline

Pad an array.

Parameters
eThe array.
pad_widthNumber of values padded to the edges of each axis: {{before_1, after_1}, ..., {before_N, after_N}}.
modeThe type of algorithm to use. [default: xt::pad_mode::constant].
constant_valueThe value to set the padded values for each axis (used in xt::pad_mode::constant).
Returns
The padded array.

Definition at line 75 of file xpad.hpp.

◆ pad() [3/3]

template<class E , class S = typename std::decay_t<E>::size_type, class V = typename std::decay_t<E>::value_type>
auto xt::pad ( E && e,
S pad_width,
pad_mode mode = pad_mode::constant,
V constant_value = 0 )
inline

Pad an array.

Parameters
eThe array.
pad_widthNumber of values padded to the edges of each axis.
modeThe type of algorithm to use. [default: xt::pad_mode::constant].
constant_valueThe value to set the padded values for each axis (used in xt::pad_mode::constant).
Returns
The padded array.

Definition at line 235 of file xpad.hpp.

◆ partition() [1/5]

template<class E , class C , class = std::enable_if_t<!xtl::is_integral<C>::value, int>>
auto xt::partition ( const xexpression< E > & e,
C kth_container,
std::ptrdiff_t axis = -1 )
inline

Definition at line 600 of file xsort.hpp.

◆ partition() [2/5]

template<class E , class I , std::size_t N, class R = detail::flatten_sort_result_type_t<E>>
R xt::partition ( const xexpression< E > & e,
const I(&) kth_container[N],
placeholders::xtuph tag )
inline

Definition at line 584 of file xsort.hpp.

◆ partition() [3/5]

template<class E , class T , std::size_t N>
auto xt::partition ( const xexpression< E > & e,
const T(&) kth_container[N],
std::ptrdiff_t axis = -1 )
inline

Definition at line 617 of file xsort.hpp.

◆ partition() [4/5]

template<class E , class R = detail::flatten_sort_result_type_t<E>>
R xt::partition ( const xexpression< E > & e,
std::size_t kth,
placeholders::xtuph tag )
inline

Definition at line 594 of file xsort.hpp.

◆ partition() [5/5]

template<class E >
auto xt::partition ( const xexpression< E > & e,
std::size_t kth,
std::ptrdiff_t axis = -1 )
inline

Definition at line 627 of file xsort.hpp.

◆ pretty_print() [1/2]

template<class E , class F >
std::ostream & xt::pretty_print ( const xexpression< E > & e,
F && func,
std::ostream & out = std::cout )

Definition at line 743 of file xio.hpp.

◆ pretty_print() [2/2]

template<class E >
std::ostream & xt::pretty_print ( const xexpression< E > & e,
std::ostream & out = std::cout )

Definition at line 778 of file xio.hpp.

◆ prod() [1/3]

template<class T = void, class E , class I , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto xt::prod ( E && e,
const I(&) axes[N],
EVS es = EVS() )
inline

Definition at line 1861 of file xmath.hpp.

◆ prod() [2/3]

template<class T = void, class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS > > = 0>
auto xt::prod ( E && e,
EVS es = EVS() )
inline

Definition at line 1861 of file xmath.hpp.

◆ prod() [3/3]

template<class T = void, class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > >, xtl::is_integral< std::decay_t< X > > > = 0>
auto xt::prod ( E && e,
X axis,
EVS es = EVS() )
inline

Definition at line 1861 of file xmath.hpp.

◆ quantile() [1/4]

template<class T = double, class E , std::size_t N>
auto xt::quantile ( E && e,
const T(&) probas[N],
quantile_method method = quantile_method::linear )
inline

Definition at line 1083 of file xsort.hpp.

◆ quantile() [2/4]

template<class T = double, class E , std::size_t N>
auto xt::quantile ( E && e,
const T(&) probas[N],
std::ptrdiff_t axis,
quantile_method method = quantile_method::linear )
inline

Definition at line 1059 of file xsort.hpp.

◆ quantile() [3/4]

template<class T = double, class E , std::size_t N>
auto xt::quantile ( E && e,
const T(&) probas[N],
std::ptrdiff_t axis,
T alpha,
T beta )
inline

Definition at line 945 of file xsort.hpp.

◆ quantile() [4/4]

template<class T = double, class E , std::size_t N>
auto xt::quantile ( E && e,
const T(&) probas[N],
T alpha,
T beta )
inline

Definition at line 967 of file xsort.hpp.

◆ range() [1/2]

template<class A , class B >
auto xt::range ( A start_val,
B stop_val )
inline

Select a range from start_val to stop_val (excluded).

You can use the shorthand _ syntax to select from the start or until the end.

using namespace xt::placeholders; // to enable _ syntax
range(3, _) // select from index 3 to the end
range(_, 5) // select from index 0 to 5 (excluded)
range(_, _) // equivalent to `all()`
auto range(A start_val, B stop_val)
Select a range from start_val to stop_val (excluded).
Definition xslice.hpp:818
See also
view, strided_view

Definition at line 818 of file xslice.hpp.

◆ range() [2/2]

template<class A , class B , class C >
auto xt::range ( A start_val,
B stop_val,
C step )
inline

Select a range from start_val to stop_val (excluded) with step You can use the shorthand _ syntax to select from the start or until the end.

using namespace xt::placeholders; // to enable _ syntax
range(3, _, 5) // select from index 3 to the end with stepsize 5
See also
view, strided_view

Definition at line 839 of file xslice.hpp.

◆ ravel_from_strides()

template<class S , class T >
get_value_type_t< T > xt::ravel_from_strides ( const T & index,
const S & strides )
inline

Definition at line 684 of file xstrides.hpp.

◆ ravel_index()

template<class S , class T >
get_value_type_t< T > xt::ravel_index ( const T & index,
const S & shape,
layout_type l )
inline

Definition at line 717 of file xstrides.hpp.

◆ ravel_indices()

template<class Tag = ravel_tensor_tag, class C , class S >
ravel_return_type_t< C, Tag > xt::ravel_indices ( const C & idx,
const S & shape,
layout_type l = layout_type::row_major )

Converts std::vector<index_type> (returned e.g.

from xt::argwhere) to xtensor whereby the indices are ravelled. For 1-d input there is no conversion.

Parameters
idxvector of indices
shapethe shape of the original array
lthe layout type (row-major or column-major)
Returns
xt::xtensor<typename index_type::value_type, 1> (e.g. xt::xtensor<size_t, 1>)

Definition at line 965 of file xtensor.hpp.

◆ reduce() [1/3]

template<class F , class E , class I , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< detail::is_xreducer_functors< F > > = 0>
auto xt::reduce ( F && f,
E && e,
const I(&) axes[N],
EVS options = EVS() )
inline

Definition at line 1065 of file xreducer.hpp.

◆ reduce() [2/3]

template<class F , class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS >, detail::is_xreducer_functors< F > > = 0>
auto xt::reduce ( F && f,
E && e,
EVS && options = EVS() )
inline

Definition at line 1034 of file xreducer.hpp.

◆ reduce() [3/3]

template<class F , class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > >, detail::is_xreducer_functors< F > > = 0>
auto xt::reduce ( F && f,
E && e,
X && axes,
EVS && options = EVS() )
inline

Returns an xexpression applying the specified reducing function to an expression over the given axes.

Parameters
fthe reducing function to apply.
ethe xexpression to reduce.
axesthe list of axes.
optionsevaluation strategy to use (lazy (default), or immediate)

The returned expression either hold a const reference to e or a copy depending on whether e is an lvalue or an rvalue.

Definition at line 1002 of file xreducer.hpp.

◆ reduce_immediate()

template<class F , class E , class X , class O >
auto xt::reduce_immediate ( F && f,
E && e,
X && axes,
O && raw_options )
inline

Definition at line 299 of file xreducer.hpp.

◆ reshape_view() [1/4]

template<layout_type L = ::xt::layout_type::row_major, class E , class I , std::size_t N>
auto xt::reshape_view ( E && e,
const I(&) shape[N] )
inline

Definition at line 914 of file xstrided_view.hpp.

◆ reshape_view() [2/4]

template<layout_type L = ::xt::layout_type::row_major, class E , class I , std::size_t N>
auto xt::reshape_view ( E && e,
const I(&) shape[N],
layout_type order )
inline

Definition at line 907 of file xstrided_view.hpp.

◆ reshape_view() [3/4]

template<layout_type L = ::xt::layout_type::row_major, class E , class S >
auto xt::reshape_view ( E && e,
S && shape )
inline

Definition at line 858 of file xstrided_view.hpp.

◆ reshape_view() [4/4]

template<layout_type L = ::xt::layout_type::row_major, class E , class S >
auto xt::reshape_view ( E && e,
S && shape,
layout_type  )
inline

Return a view on a container with a new shape.

Deprecated

Note: if you resize the underlying container, this view becomes invalidated.

Parameters
exexpression to reshape
shapenew shape
ordertraversal order (optional)
Returns
view on xexpression with new shape

Definition at line 901 of file xstrided_view.hpp.

◆ resize_container() [1/3]

template<class C >
bool xt::resize_container ( C & c,
typename C::size_type size )
inline

Definition at line 353 of file xutils.hpp.

◆ resize_container() [2/3]

template<std::size_t... I>
bool xt::resize_container ( xt::fixed_shape< I... > & a,
std::size_t size )
inline

Definition at line 366 of file xutils.hpp.

◆ resize_container() [3/3]

template<class T , std::size_t N>
bool xt::resize_container ( std::array< T, N > & a,
typename std::array< T, N >::size_type size )
inline

Definition at line 360 of file xutils.hpp.

◆ row()

template<class E >
auto xt::row ( E && e,
std::ptrdiff_t index )
inline

Constructs and returns a row (sliced view) on the specified expression.

Users should not directly construct the slices but call helper functions instead. This function is only allowed on expressions with two dimensions.

Parameters
ethe xexpression to adapt
index0-based index of the row, negative indices will return the last rows in reverse order.
Exceptions
std::invalid_argumentif the expression has more than 2 dimensions.

Definition at line 1922 of file xview.hpp.

◆ scalar_computed_assign()

template<class E1 , class E2 , class F >
void xt::scalar_computed_assign ( xexpression< E1 > & e1,
const E2 & e2,
F && f )
inline

Definition at line 239 of file xassign.hpp.

◆ searchsorted()

template<class E1 , class E2 >
auto xt::searchsorted ( E1 && a,
E2 && v,
bool right = true )
inline

Find indices where elements should be inserted to maintain order.

Parameters
aInput array: sorted (array_like).
vValues to insert into a (array_like).
rightIf false, the index of the first suitable location found is given.
Returns
Array of insertion points with the same shape as v.

Definition at line 186 of file xset_operation.hpp.

◆ sequence_size() [1/2]

template<class C >
constexpr auto xt::sequence_size ( const C & c) -> decltype(c.size())
constexpr

Definition at line 629 of file xutils.hpp.

◆ sequence_size() [2/2]

template<class T , std::size_t N>
constexpr std::size_t xt::sequence_size ( const T(&)[N])
constexpr

Definition at line 636 of file xutils.hpp.

◆ shape() [1/2]

template<class R = std::size_t, class T , std::size_t N>
xt::static_shape< R, N > xt::shape ( const T(&) aList[N])

Generate an xt::static_shape of the given size.

Definition at line 221 of file xshape.hpp.

◆ shape() [2/2]

template<class R , class T >
constexpr R xt::shape ( T t)
constexpr

Definition at line 211 of file xshape.hpp.

◆ share() [1/2]

template<class E >
auto xt::share ( xexpression< E > && expr)
inline

Helper function to create shared expression from any xexpression.

Parameters
exprrvalue expression that will be shared
Returns
xshared expression
See also
make_xshared

Definition at line 760 of file xexpression.hpp.

◆ share() [2/2]

template<class E >
auto xt::share ( xexpression< E > & expr)
inline

Helper function to create shared expression from any xexpression.

Parameters
exprrvalue expression that will be shared
Returns
xshared expression
See also
make_xshared

Definition at line 747 of file xexpression.hpp.

◆ sign()

template<class T , class B >
auto xt::sign ( const xtl::xoptional< T, B > & e)
inline

Definition at line 1255 of file xoptional.hpp.

◆ sort()

template<class E >
auto xt::sort ( const xexpression< E > & e,
placeholders::xtuph  )
inline

Definition at line 223 of file xsort.hpp.

◆ stack()

template<class... CT>
auto xt::stack ( std::tuple< CT... > && t,
std::size_t axis = 0 )
inline

Stack xexpressions along axis.

Stacking always creates a new dimension along which elements are stacked.

Parameters
txtuple of xexpressions to concatenate
axisaxis along which elements are stacked
Returns
xgenerator evaluating to stacked elements
xt::xarray<double> a = {1, 2, 3};
xt::xarray<double> b = {5, 6, 7};
xt::xarray<double> s = xt::stack(xt::xtuple(a, b)); // => {{1, 2, 3},
// {5, 6, 7}}
xt::xarray<double> t = xt::stack(xt::xtuple(a, b), 1); // => {{1, 5},
// {2, 6},
// {3, 7}}
auto stack(std::tuple< CT... > &&t, std::size_t axis=0)
Stack xexpressions along axis.
Definition xbuilder.hpp:883

Definition at line 883 of file xbuilder.hpp.

◆ stddev() [1/2]

template<class T = void, class E , class A , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto xt::stddev ( E && e,
const A(&) axes[N],
EVS es = EVS() )
inline

Definition at line 2187 of file xmath.hpp.

◆ stddev() [2/2]

template<class T = void, class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS > > = 0>
auto xt::stddev ( E && e,
EVS es = EVS() )
inline

Definition at line 2084 of file xmath.hpp.

◆ step_size() [1/4]

template<class S >
disable_xslice< S, std::size_t > xt::step_size ( const S & ,
std::size_t  )
inlinenoexcept

Definition at line 869 of file xslice.hpp.

◆ step_size() [2/4]

template<class S >
disable_xslice< S, std::size_t > xt::step_size ( const S & ,
std::size_t ,
std::size_t  )
inlinenoexcept

Definition at line 875 of file xslice.hpp.

◆ step_size() [3/4]

template<class S >
auto xt::step_size ( const xslice< S > & slice,
std::size_t idx )
inlinenoexcept

Definition at line 881 of file xslice.hpp.

◆ step_size() [4/4]

template<class S >
auto xt::step_size ( const xslice< S > & slice,
std::size_t idx,
std::size_t n )
inlinenoexcept

Definition at line 887 of file xslice.hpp.

◆ stride_match_condition()

template<class T1 , class T2 >
bool xt::stride_match_condition ( const T1 & stride,
const T2 & shape,
const T1 & data_size,
bool zero_strides )
inline

Definition at line 580 of file xstrides.hpp.

◆ strided_data_end()

template<class C , class It , class size_type >
It xt::strided_data_end ( const C & c,
It begin,
layout_type l,
size_type offset )

Definition at line 170 of file xstrides.hpp.

◆ strided_view() [1/2]

template<class E >
auto xt::strided_view ( E && e,
const xstrided_slice_vector & slices )
inline

Function to create a dynamic view from an xexpression and an xstrided_slice_vector.

Parameters
exexpression
slicesthe slice vector
Returns
initialized strided_view according to slices
xt::xarray<double> a = {{1, 2, 3}, {4, 5, 6}};
sv.push_back(xt::range(0, 3, 2));
auto v = xt::strided_view(a, sv);
// ==> {{1, 3}}
std::vector< xstrided_slice< std::ptrdiff_t > > xstrided_slice_vector
vector of slices used to build a xstrided_view

You can also achieve the same with the following short-hand syntax:

xt::xarray<double> a = {{1, 2, 3}, {4, 5, 6}};
auto v = xt::strided_view(a, {xt::range(0, 1), xt::range(0, 3, 2)});
// ==> {{1, 3}}

Definition at line 790 of file xstrided_view.hpp.

◆ strided_view() [2/2]

template<layout_type L = layout_type::dynamic, class E , class S , class X >
auto xt::strided_view ( E && e,
S && shape,
X && strides,
std::size_t offset,
layout_type layout )
inlinenoexcept

Construct a strided view from an xexpression, shape, strides and offset.

Parameters
exexpression
shapethe shape of the view
stridesthe new strides of the view
offsetthe offset of the first element in the underlying container
layoutthe new layout of the expression
Template Parameters
Lthe static layout type of the view (default: dynamic)
Etype of xexpression
Sstrides type
Xstrides type
Returns
the view

Definition at line 728 of file xstrided_view.hpp.

◆ sum() [1/3]

template<class T = void, class E , class I , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto xt::sum ( E && e,
const I(&) axes[N],
EVS es = EVS() )
inline

Definition at line 1841 of file xmath.hpp.

◆ sum() [2/3]

template<class T = void, class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS > > = 0>
auto xt::sum ( E && e,
EVS es = EVS() )
inline

Definition at line 1841 of file xmath.hpp.

◆ sum() [3/3]

template<class T = void, class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > >, xtl::is_integral< std::decay_t< X > > > = 0>
auto xt::sum ( E && e,
X axis,
EVS es = EVS() )
inline

Definition at line 1841 of file xmath.hpp.

◆ swap() [1/6]

template<class T , std::size_t N, class A , bool Init>
void xt::swap ( svector< T, N, A, Init > & lhs,
svector< T, N, A, Init > & rhs )
inlinenoexcept

Definition at line 1409 of file xstorage.hpp.

◆ swap() [2/6]

template<class T , class A >
void xt::swap ( uvector< T, A > & lhs,
uvector< T, A > & rhs )
inlinenoexcept

Definition at line 616 of file xstorage.hpp.

◆ swap() [3/6]

template<class CP , class O , class A >
void xt::swap ( xbuffer_adaptor< CP, O, A > & lhs,
xbuffer_adaptor< CP, O, A > & rhs )
inlinenoexcept

Definition at line 1067 of file xbuffer_adaptor.hpp.

◆ swap() [4/6]

template<class I , class CI >
void xt::swap ( xiterator_adaptor< I, CI > & lhs,
xiterator_adaptor< I, CI > & rhs )
inlinenoexcept

Definition at line 1135 of file xbuffer_adaptor.hpp.

◆ swap() [5/6]

template<class C , class IG >
void xt::swap ( xiterator_owner_adaptor< C, IG > & lhs,
xiterator_owner_adaptor< C, IG > & rhs )
inlinenoexcept

Definition at line 1238 of file xbuffer_adaptor.hpp.

◆ swap() [6/6]

template<class VE , class FE >
void xt::swap ( xoptional_assembly_storage< VE, FE > & lhs,
xoptional_assembly_storage< VE, FE > & rhs )
noexcept

Definition at line 476 of file xoptional_assembly_storage.hpp.

◆ throw_broadcast_error()

template<class S1 , class S2 >
void xt::throw_broadcast_error ( const S1 & lhs,
const S2 & rhs )

Definition at line 129 of file xexception.hpp.

◆ throw_concatenate_error()

template<class S1 , class S2 >
void xt::throw_concatenate_error ( const S1 & lhs,
const S2 & rhs )

Definition at line 149 of file xexception.hpp.

◆ tile() [1/3]

template<class E , class C , xtl::check_concept< xtl::negation< xtl::is_integral< C > > > = 0>
auto xt::tile ( E && e,
const C & reps )
inline

Definition at line 302 of file xpad.hpp.

◆ tile() [2/3]

template<class E , class S = typename std::decay_t<E>::size_type, xtl::check_concept< xtl::is_integral< S > > = 0>
auto xt::tile ( E && e,
S reps )
inline

Tile an array.

Parameters
eThe array.
repsThe number of repetitions of A along the first axis.
Returns
The tiled array.

Definition at line 315 of file xpad.hpp.

◆ tile() [3/3]

template<class E , class S = typename std::decay_t<E>::size_type>
auto xt::tile ( E && e,
std::initializer_list< S > reps )
inline

Tile an array.

Parameters
eThe array.
repsThe number of repetitions of A along each axis.
Returns
The tiled array.

Definition at line 296 of file xpad.hpp.

◆ to_array()

template<class T , std::size_t N>
constexpr std::array< std::remove_cv_t< T >, N > xt::to_array ( T(&) a[N])
constexpr

Definition at line 618 of file xutils.hpp.

◆ to_json()

template<template< typename U, typename V, typename... Args > class M, class E >
enable_xexpression< E > xt::to_json ( nlohmann::basic_json< M > & j,
const E & e )
inline

JSON serialization of an xtensor expression.

The to_json method is used by the nlohmann_json package for automatic serialization of user-defined types. The method is picked up by argument-dependent lookup.

Parameters
ja JSON object
ea const xexpression

Definition at line 133 of file xjson.hpp.

◆ tril()

template<class E >
auto xt::tril ( E && arr,
int k = 0 )
inline

Extract lower triangular matrix from xexpression.

The parameter k selects the offset of the diagonal.

Parameters
arrthe input array
kthe diagonal above which to zero elements. 0 (default) selects the main diagonal, k < 0 is below the main diagonal, k > 0 above.
Returns
xexpression containing lower triangle from arr, 0 otherwise

Definition at line 1223 of file xbuilder.hpp.

◆ triu()

template<class E >
auto xt::triu ( E && arr,
int k = 0 )
inline

Extract upper triangular matrix from xexpression.

The parameter k selects the offset of the diagonal.

Parameters
arrthe input array
kthe diagonal below which to zero elements. 0 (default) selects the main diagonal, k < 0 is below the main diagonal, k > 0 above.
Returns
xexpression containing lower triangle from arr, 0 otherwise

Definition at line 1249 of file xbuilder.hpp.

◆ type_name()

template<class T >
static_string xt::type_name ( )

Definition at line 68 of file xinfo.hpp.

◆ type_to_string()

template<class T >
std::string xt::type_to_string ( )

Definition at line 87 of file xinfo.hpp.

◆ unchecked_data_offset()

template<class offset_type , layout_type L = layout_type::dynamic, class S , class... Args>
offset_type xt::unchecked_data_offset ( const S & strides,
Args... args )
inlinenoexcept

Definition at line 480 of file xstrides.hpp.

◆ uninitialized_shape()

template<class S , class stype >
S xt::uninitialized_shape ( stype size)
inline

Definition at line 726 of file xstrides.hpp.

◆ unravel_from_strides()

template<class S >
S xt::unravel_from_strides ( typename S::value_type index,
const S & strides,
layout_type l = layout_type::row_major )
inline

Definition at line 674 of file xstrides.hpp.

◆ unravel_index()

template<class S >
get_strides_t< S > xt::unravel_index ( typename S::value_type index,
const S & shape,
layout_type l = layout_type::row_major )
inline

Definition at line 690 of file xstrides.hpp.

◆ unravel_indices()

template<class S , class T >
std::vector< get_strides_t< S > > xt::unravel_indices ( const T & indices,
const S & shape,
layout_type l = layout_type::row_major )
inline

Definition at line 700 of file xstrides.hpp.

◆ value() [1/3]

template<class S , class I >
disable_xslice< S, std::size_t > xt::value ( const S & s,
I  )
inlinenoexcept

Definition at line 897 of file xslice.hpp.

◆ value() [2/3]

template<class S , class I >
auto xt::value ( const xslice< S > & slice,
I i )
inlinenoexcept

Definition at line 903 of file xslice.hpp.

◆ value() [3/3]

template<class E , xtl::check_concept< is_xexpression< E > > = 0>
auto xt::value ( E && e) -> detail::value_expression_t<E>
inline

Definition at line 1266 of file xoptional.hpp.

◆ variance() [1/5]

template<class T = void, class E , class A , std::size_t N, class D , class EVS = std::tuple<evaluation_strategy::lazy_type>>
auto xt::variance ( E && e,
const A(&) axes[N],
const D & ddof,
EVS es = EVS() )
inline

Definition at line 2213 of file xmath.hpp.

◆ variance() [2/5]

template<class T = void, class E , class A , std::size_t N, class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS > > = 0>
auto xt::variance ( E && e,
const A(&) axes[N],
EVS es = EVS() )
inline

Definition at line 2203 of file xmath.hpp.

◆ variance() [3/5]

template<class T = void, class E , class D , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS >, xtl::is_integral< D > > = 0>
auto xt::variance ( E && e,
const D & ddof,
EVS es = EVS() )
inline

Definition at line 2071 of file xmath.hpp.

◆ variance() [4/5]

template<class T = void, class E , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< is_reducer_options< EVS > > = 0>
auto xt::variance ( E && e,
EVS es = EVS() )
inline

Definition at line 2078 of file xmath.hpp.

◆ variance() [5/5]

template<class T = void, class E , class X , class EVS = std::tuple<evaluation_strategy::lazy_type>, xtl::check_concept< xtl::negation< is_reducer_options< X > >, xtl::negation< xtl::is_integral< std::decay_t< X > > >, is_reducer_options< EVS > > = 0>
auto xt::variance ( E && e,
X && axes,
EVS es = EVS() )
inline

Definition at line 2149 of file xmath.hpp.

◆ vectorize() [1/3]

template<class F >
auto xt::vectorize ( F && f) -> decltype(vectorize(std::forward<F>(f), std::declval<detail::get_function_type<F>*>()))
inline

Definition at line 97 of file xvectorize.hpp.

◆ vectorize() [2/3]

template<class F , class R , class... Args>
xvectorizer< F, R > xt::vectorize ( F && f,
R(*)(Args...)  )
inline

Definition at line 91 of file xvectorize.hpp.

◆ vectorize() [3/3]

template<class R , class... Args>
xvectorizer< R(*)(Args...), R > xt::vectorize ( R(*)(Args...) f)
inline

Definition at line 85 of file xvectorize.hpp.

◆ view()

template<class E , class... S>
auto xt::view ( E && e,
S &&... slices )
inline

Constructs and returns a view on the specified xexpression.

Users should not directly construct the slices but call helper functions instead.

Parameters
ethe xexpression to adapt
slicesthe slices list describing the view. view accepts negative indices, in that case indexing is done in reverse order.
See also
range, all, newaxis

Definition at line 1834 of file xview.hpp.

◆ vstack()

template<class... CT>
auto xt::vstack ( std::tuple< CT... > && t)
inline

Stack xexpressions in sequence vertically (row wise).

This is equivalent to concatenation along the first axis after 1-D arrays of shape (N) have been reshape to (1, N).

Parameters
txtuple of xexpressions to stack
Returns
xgenerator evaluating to stacked elements

Definition at line 940 of file xbuilder.hpp.

◆ xcref()

template<class T >
xscalar< const T & > xt::xcref ( T & t)
inline

Definition at line 962 of file xscalar.hpp.

◆ xnone()

auto xt::xnone ( )
inline

Definition at line 770 of file xslice.hpp.

◆ xref()

template<class T >
xscalar< T & > xt::xref ( T & t)
inline

Definition at line 956 of file xscalar.hpp.

◆ xtuple()

template<class... Types>
auto xt::xtuple ( Types &&... args)
inline

Creates tuples from arguments for concatenate and stack.

Very similar to std::make_tuple.

Definition at line 707 of file xbuilder.hpp.

◆ zeros() [1/2]

template<class T , class I , std::size_t L>
auto xt::zeros ( const I(&) shape[L])
inlinenoexcept

Definition at line 72 of file xbuilder.hpp.

◆ zeros() [2/2]

template<class T , class S >
auto xt::zeros ( S shape)
inlinenoexcept

Returns an xexpression containing zeros of the specified shape.

Template Parameters
shapethe shape of the returned expression.

Definition at line 66 of file xbuilder.hpp.

◆ zeros_like()

template<class E >
auto xt::zeros_like ( const xexpression< E > & e)
inline

Create a xcontainer (xarray, xtensor or xtensor_fixed), filled with zeros and of the same shape, value type and layout as the input xexpression e.

Note: contrary to zeros(shape), this function returns a non-lazy, allocated container! Use `xt::zeros<double>(e.shape()); for a lazy version.

Parameters
ethe xexpression from which to extract shape, value type and layout.

Definition at line 154 of file xbuilder.hpp.

Variable Documentation

◆ keep_dims

constexpr auto xt::keep_dims = std::tuple<keep_dims_type>{}
constexpr

Definition at line 46 of file xreducer.hpp.