24#ifndef MORPHEUS_COPY_HPP
25#define MORPHEUS_COPY_HPP
27#include <impl/Morpheus_Utils.hpp>
28#include <impl/Morpheus_Copy_Impl.hpp>
29#include <impl/Dynamic/Morpheus_Copy_Impl.hpp>
51template <
typename SourceType,
typename DestinationType>
52void copy(
const SourceType& src, DestinationType& dst) {
53 Morpheus::Impl::copy(src, dst);
70template <
typename SourceType,
typename DestinationType>
71void copy(
const SourceType& src, DestinationType& dst,
72 const typename SourceType::index_type src_begin,
73 const typename SourceType::index_type src_end,
74 const typename DestinationType::index_type dst_begin,
75 const typename DestinationType::index_type dst_end) {
76 static_assert(is_dense_vector_format_container_v<SourceType> &&
77 is_dense_vector_format_container_v<DestinationType>,
78 "Both src and dst must be vectors.");
79 MORPHEUS_ASSERT((src_end - src_begin) == (dst_end - dst_begin),
80 "Source slice range ("
81 << src_begin <<
", " << src_end
82 <<
") should be equal to the destination slice range ("
83 << dst_begin <<
", " << dst_end <<
").");
85 Morpheus::Impl::copy(src, dst, src_begin, src_end, dst_begin, dst_end);
100template <
typename SourceType,
typename DestinationType>
101void copy(
const SourceType& src, DestinationType& dst,
102 const typename SourceType::index_type begin,
103 const typename SourceType::index_type end) {
124template <
typename ExecSpace,
typename KeyType,
typename SourceType,
125 typename DestinationType>
127 DestinationType& dst) {
128 static_assert(is_dense_vector_format_container_v<SourceType> &&
129 is_dense_vector_format_container_v<DestinationType>,
130 "Both src and dst must be vectors.");
131 Impl::copy_by_key<ExecSpace>(keys, src, dst);
void copy_by_key(const KeyType keys, const SourceType &src, DestinationType &dst)
Performs an indirect copy between two containers using a set of key values.
Definition: Morpheus_Copy.hpp:126
void copy(const SourceType &src, DestinationType &dst)
Performs a deep copy operation between two containers.
Definition: Morpheus_Copy.hpp:52
Generic Morpheus interfaces.
Definition: dummy.cpp:24