9 #ifndef __stir_copy_fill__H__ 10 #define __stir_copy_fill__H__ 37 template <
typename iterT>
38 static iterT
copy_to(
const T& stir_object, iterT iter)
40 return std::copy(stir_object.begin_all(), stir_object.end_all(), iter);
42 template <
typename iterT>
43 static void fill_from(T& stir_object, iterT iter, iterT iter_end)
45 std::copy(iter, iter_end, stir_object.begin_all());
52 template <
int num_dimensions,
class elemT>
57 template <
typename iterT>
58 static iterT
copy_to(
const Array_type& stir_array, iterT iter)
64 auto ret = std::copy(beg, beg + stir_array.
size_all(), iter);
75 template <
typename iterT>
76 static void fill_from(Array_type& stir_array, iterT iter, iterT iter_end)
87 std::copy(iter, iter_end, stir_array.
begin_all());
98 template <
typename iterT>
102 if (
auto pdm_ptr = dynamic_cast<ProjDataInMemory const*>(&stir_object))
111 return stir_object.
copy_to(iter);
115 template <
typename iterT>
118 if (
auto pdm_ptr = dynamic_cast<ProjDataInMemory*>(&stir_object))
131 template <
typename T,
typename iterT>
142 template <
typename T,
typename iterT>
iterT fill_from(iterT array_iter)
set all bins from an array iterator
Definition: ProjData.h:281
full_iterator end_all()
end value for iterating through all elements in the array, see full_iterator
Definition: Array.inl:162
bool is_contiguous() const
return if the array is contiguous in memory
Definition: Array.inl:39
iterT copy_to(const T &stir_object, iterT iter)
Copy all bins to a range specified by a iterator.
Definition: copy_fill.h:133
Helper class for stir::copy_to and stir::fill_from.
Definition: copy_fill.h:35
elemT * get_full_data_ptr()
member function for access to the data via a elemT*
Definition: Array.inl:269
Declaration of class stir::ProjDataInMemory.
size_t size_all() const
return the total number of elements in this array
Definition: Array.inl:239
iterT copy_to(iterT array_iter) const
Copy all bins to a range specified by a (forward) iterator.
Definition: ProjData.h:314
defines the Array class for multi-dimensional (numeric) arrays
void fill_from(T &stir_object, iterT iter, iterT iter_end)
set all elements of stir_object from an iterator
Definition: copy_fill.h:144
full_iterator begin_all()
start value for iterating through all elements in the array, see full_iterator
Definition: Array.inl:190
void release_const_full_data_ptr() const
signal end of access to const elemT*
Definition: Array.inl:322
void release_full_data_ptr()
signal end of access to elemT*
Definition: Array.inl:306
This class defines multi-dimensional (numeric) arrays.
Definition: Array.h:73
const elemT * get_const_full_data_ptr() const
member function for access to the data via a const elemT*
Definition: Array.inl:288
The (abstract) base class for the projection data.
Definition: ProjData.h:103