16 #ifndef OPENKALMAN_COPY_FROM_HPP 17 #define OPENKALMAN_COPY_FROM_HPP 29 template<
typename LHS,
typename RHS,
typename...J>
32 access(lhs, j...) =
access(std::forward<RHS>(rhs), j...);
36 template<
typename LHS,
typename RHS, std::size_t I, std::size_t...Is,
typename...J>
39 for (std::size_t i = 0; i < get_index_extent<I>(rhs); i++)
54 template<indexible Dest, indexible Source> requires copyable_from<Dest, Source>
56 template<
typename Source,
typename Dest, std::enable_if_t<copyable_from<Dest, Source>,
int> = 0>
58 constexpr decltype(
auto)
61 if constexpr (interface::copy_from_defined_for<Dest&, Source&&>)
65 else if constexpr (interface::copy_from_defined_for<Dest&, decltype(
get_mdspan(std::declval<Source&&>()))>)
71 detail::copy_tensor_elements(
get_mdspan(dest),
get_mdspan(std::forward<Source>(source)), std::make_index_sequence<index_count_v<Dest>>{});
73 return std::forward<Dest>(dest);
constexpr auto get_mdspan(T &t)
Get the coordinates::pattern_collection associated with indexible object T.
Definition: get_mdspan.hpp:35
decltype(auto) constexpr copy_from(Dest &&dest, Source &&source)
Copy elements from one object to another.
Definition: copy_from.hpp:59
Definition of get_index_extent function.
The root namespace for OpenKalman.
Definition: basics.hpp:34
An interface to various routines from the linear algebra library associated with indexible object T...
Definition: library_interface.hpp:42
decltype(auto) constexpr access(Arg &&arg, const Indices &indices)
Access a component of an indexible object at a given set of indices.
Definition: access.hpp:74
Definition for access function.
Definition for index_count.
Definition: trait_backports.hpp:64
Concepts for testing whether object_traits or library_interface definitions exist for a particular ob...