@@ -57,6 +57,8 @@ namespace xt
5757 using not_a_layout = xtl::negation<std::is_same<layout_type,T>>;
5858 }
5959
60+ #ifndef IN_DOXYGEN
61+
6062 /* *************************
6163 * xarray_adaptor builder *
6264 **************************/
@@ -202,7 +204,7 @@ namespace xt
202204 /* **************************
203205 * xtensor_adaptor builder *
204206 ***************************/
205-
207+
206208 /* *
207209 * Constructs a 1-D xtensor_adaptor of the given stl-like container,
208210 * with the specified layout_type.
@@ -403,6 +405,132 @@ namespace xt
403405 return adapt (std::forward<C>(ptr), xtl::forward_sequence<shape_type, decltype (shape)>(shape));
404406 }
405407
408+ #else // IN_DOXYGEN
409+
410+ /* *
411+ * Constructs:
412+ * - an xarray_adaptor if SC is not an array type
413+ * - an xtensor_adaptor if SC is an array type
414+ *
415+ * from the given stl-like container or pointer, with the specified shape and layout.
416+ * If the adaptor is built from a pointer, it does not take its ownership.
417+ * @param container the container or pointer to adapt
418+ * @param shape the shape of the adaptor
419+ * @param l the layout_type of the adaptor
420+ */
421+ template <layout_type L = XTENSOR_DEFAULT_LAYOUT, class C , class SC >
422+ inline auto adapt (C&& container, const SC& shape, layout_type l = L);
423+
424+ /* *
425+ * Constructs:
426+ * - an xarray_adaptor if SC is not an array type
427+ * - an xtensor_adaptor if SC is an array type
428+ *
429+ * from the given stl-like container with the specified shape and strides.
430+ * @param container the container to adapt
431+ * @param shape the shape of the adaptor
432+ * @param strides the strides of the adaptor
433+ */
434+ template <class C , class SC , class SS >
435+ inline auto adapt (C&& container, SC&& shape, SS&& strides);
436+
437+ /* *
438+ * Constructs:
439+ * - an xarray_adaptor if SC is not an array type
440+ * - an xtensor_adaptor if SC is an array type
441+ *
442+ * of the given dynamically allocated C array, with the specified shape and layout.
443+ * @param pointer the pointer to the beginning of the dynamic array
444+ * @param size the size of the dynamic array
445+ * @param ownership indicates whether the adaptor takes ownership of the array.
446+ * Possible values are ``no_ownership()`` or ``acquire_ownership()``
447+ * @param shape the shape of the adaptor
448+ * @param l the layout_type of the adaptor
449+ * @param alloc the allocator used for allocating / deallocating the dynamic array
450+ */
451+ template <layout_type L = XTENSOR_DEFAULT_LAYOUT, class P , class O , class SC , class A = detail::default_allocator_for_ptr_t <P>>
452+ inline auto
453+ adapt (P&& pointer, typename A::size_type size, O ownership, const SC& shape, layout_type l = L, const A& alloc = A());
454+
455+ /* *
456+ * Constructs:
457+ * - an xarray_adaptor if SC is not an array type
458+ * - an xtensor_adaptor if SC is an array type
459+ *
460+ * of the given dynamically allocated C array, with the specified shape and strides.
461+ * @param pointer the pointer to the beginning of the dynamic array
462+ * @param size the size of the dynamic array
463+ * @param ownership indicates whether the adaptor takes ownership of the array.
464+ * Possible values are ``no_ownership()`` or ``acquire_ownership()``
465+ * @param shape the shape of the adaptor
466+ * @param strides the strides of the adaptor
467+ * @param alloc the allocator used for allocating / deallocating the dynamic array
468+ */
469+ template <class P , class O , class SC , class SS , class A = detail::default_allocator_for_ptr_t <P>>
470+ inline auto
471+ adapt (P&& pointer, typename A::size_type size, O ownership, SC&& shape, SS&& strides, const A& alloc = A());
472+
473+ /* *
474+ * Contructs:
475+ * - an xarray_adaptor if SC is not an array type
476+ * - an xtensor_adaptor if SC is an array type
477+ *
478+ * of the given C array allocated on the stack, with the specified shape and layout.
479+ * @param c_array the C array allocated on the stack
480+ * @param shape the shape of the adaptor
481+ * @param l the layout_type of the adaptor
482+ */
483+ template <layout_type L = XTENSOR_DEFAULT_LAYOUT, class T , std::size_t N, class SC >
484+ inline auto adapt (T (&c_array)[N], const SC& shape, layout_type l = L);
485+
486+ /* *
487+ * Contructs:
488+ * - an xarray_adaptor if SC is not an array type
489+ * - an xtensor_adaptor if SC is an array type
490+ *
491+ * of the given C array allocated on the stack, with the
492+ * specified shape and strides.
493+ * @param c_array the C array allocated on the stack
494+ * @param shape the shape of the adaptor
495+ * @param strides the strides of the adaptor
496+ */
497+ template <class T , std::size_t N, class SC , class SS >
498+ inline auto adapt (T (&c_array)[N], SC&& shape, SS&& strides);
499+
500+ /* *
501+ * Constructs an non-owning xtensor_fixed_adaptor from a pointer with the
502+ * specified shape and layout.
503+ * @param pointer the pointer to adapt
504+ * @param shape the shape of the xtensor_fixed_adaptor
505+ */
506+ template <layout_type L = XTENSOR_DEFAULT_LAYOUT, class C , std::size_t ... X>
507+ inline auto adapt (C&& pointer, const fixed_shape<X...>& /* shape*/ );
508+
509+ /* *
510+ * Constructs a 1-D xtensor_adaptor of the given stl-like container,
511+ * with the specified layout_type.
512+ * @param container the container to adapt
513+ * @param l the layout_type of the xtensor_adaptor
514+ */
515+ template <layout_type L = XTENSOR_DEFAULT_LAYOUT, class C >
516+ inline xtensor_adaptor<C, 1 , L> adapt (C&& container, layout_type l = L);
517+
518+ /* *
519+ * Constructs a 1-D xtensor_adaptor of the given dynamically allocated C array,
520+ * with the specified layout.
521+ * @param pointer the pointer to the beginning of the dynamic array
522+ * @param size the size of the dynamic array
523+ * @param ownership indicates whether the adaptor takes ownership of the array.
524+ * Possible values are ``no_ownership()`` or ``acquire_ownership()``
525+ * @param l the layout_type of the xtensor_adaptor
526+ * @param alloc the allocator used for allocating / deallocating the dynamic array
527+ */
528+ template <layout_type L = XTENSOR_DEFAULT_LAYOUT, class P , class O , class A = detail::default_allocator_for_ptr_t <P>>
529+ inline xtensor_adaptor<xbuffer_adaptor<xtl::closure_type_t <P>, O, A>, 1 , L>
530+ adapt (P&& pointer, typename A::size_type size, O ownership, layout_type l = L, const A& alloc = A());
531+
532+ #endif // IN_DOXYGEN
533+
406534 /* ****************************
407535 * smart_ptr adapter builder *
408536 *****************************/
0 commit comments