24 #ifndef PSS_ASTROTYPES_MULTIARRAY_REDUCEDRANKSLICE_H
25 #define PSS_ASTROTYPES_MULTIARRAY_REDUCEDRANKSLICE_H
29 namespace astrotypes {
30 namespace multiarray {
38 template<
typename SliceType,
typename ExcludedDim, std::size_t RankT=SliceType::rank - 1>
41 typedef SliceType BaseT;
48 friend typename iterator::BaseT;
49 friend typename iterator::ImplT;
50 friend typename const_iterator::BaseT;
51 friend typename const_iterator::ImplT;
54 static constexpr std::size_t
rank = SliceType::rank - 1;
64 const_iterator
begin()
const;
65 const_iterator
cbegin()
const;
71 const_iterator
end()
const;
72 const_iterator
cend()
const;
74 template<
typename Dim>
75 typename std::enable_if<!std::is_same<Dim, ExcludedDim>::value
79 template<
typename Dim>
80 typename std::enable_if<!std::is_same<Dim, ExcludedDim>::value
87 template<
typename Dim>
89 typename std::enable_if<std::is_same<Dim, ExcludedDim>::value, std::size_t>::type
93 template<
typename SliceType,
typename ExcludedDim>
96 typedef SliceType BaseT;
101 typedef typename std::iterator_traits<typename SliceType::iterator>::reference
reference_type;
102 typedef typename std::iterator_traits<typename SliceType::Parent::const_iterator>::reference
const_reference_type;
107 friend typename iterator::BaseT;
108 friend typename iterator::ImplT;
109 friend typename const_iterator::BaseT;
110 friend typename const_iterator::ImplT;
120 const_iterator
begin()
const;
121 const_iterator
cbegin()
const;
127 const_iterator
end()
const;
128 const_iterator
cend()
const;
133 template<
typename Dim>
134 typename std::enable_if<!has_type<ExcludeTuple, Dim>::value
135 , reference_type>::type
138 template<
typename Dim>
139 typename std::enable_if<!has_type<ExcludeTuple, Dim>::value
140 , const_reference_type>::type
146 template<
typename Dim>
148 typename std::enable_if<std::is_same<Dim, ExcludedDim>::value, std::size_t>::type
157 #endif // PSS_ASTROTYPES_MULTIARRAY_REDUCEDRANKSLICE_H
ReducedRankSlice(SliceType &&s)
produces a tuple type with params form all provided Tuples
A tagged dimensionIndex variable.
SliceIteratorHelper< ReducedRankSlice, typename SliceType::iterator >::type iterator
iterator begin()
iterator pointing to the first element in the slice
static constexpr std::size_t rank
std::enable_if<!std::is_same< Dim, ExcludedDim >::value, ReducedRankSlice< typename SliceMixinRemover< typename SliceType::template OperatorSliceType< Dim >::type >::type, ExcludedDim > >::type operator[](DimensionIndex< Dim >)
ReducedRankSlice(SliceType &&s)
std::iterator_traits< typename SliceType::iterator >::reference reference_type
const_iterator cbegin() const
join_tuples< typename BaseT::ExcludeTuple, std::tuple< ExcludedDim > >::type ExcludeTuple
static std::enable_if< std::is_same< Dim, ExcludedDim >::value, std::size_t >::type dimension()
the width of the slice in this dimesnion has been reduced to 1
astrotypes::tuple_diff< typename SliceType::DimensionTuple, ExcludeTuple >::type DimensionTuple
SliceIteratorHelper< ReducedRankSlice, typename SliceType::iterator >::type iterator
SliceIteratorHelper< ReducedRankSlice, typename SliceType::const_iterator >::type const_iterator
ReducedRankSlice(SliceType const &s)
tuple_diff< typename SliceType::DimensionTuple, ExcludeTuple >::type DimensionTuple
iterator end()
iterator pointing to just after the last element
ReducedRankSlice(SliceType const &s)
SliceIteratorHelper< ReducedRankSlice, typename SliceType::const_iterator >::type const_iterator
std::iterator_traits< typename SliceType::Parent::const_iterator >::reference const_reference_type
const_iterator cend() const