anonymous range: FType + utils: anonToDynView: MultiArray -> MultiArrayBase

This commit is contained in:
Christian Zimmermann 2019-05-15 20:37:00 +02:00
parent 8e91aae948
commit 8e271ca0e4
3 changed files with 6 additions and 5 deletions

View file

@ -194,7 +194,7 @@ namespace MultiArrayTools
} }
template <typename T, class EC, class Range1, class... RangeTypes> template <typename T, class EC, class Range1, class... RangeTypes>
auto anonToDynView(const MultiArray<T,Range1,RangeTypes...,AnonymousRange>& ma) auto anonToDynView(const MultiArrayBase<T,Range1,RangeTypes...,AnonymousRange>& ma)
-> ConstSlice<T,Range1,RangeTypes...,DynamicRange<EC>> -> ConstSlice<T,Range1,RangeTypes...,DynamicRange<EC>>
{ {
constexpr size_t LAST = sizeof...(RangeTypes)+1; constexpr size_t LAST = sizeof...(RangeTypes)+1;
@ -220,7 +220,7 @@ namespace MultiArrayTools
} }
template <typename T, class EC> template <typename T, class EC>
auto anonToDynView(const MultiArray<T,AnonymousRange>& ma) auto anonToDynView(const MultiArrayBase<T,AnonymousRange>& ma)
-> ConstSlice<T,DynamicRange<EC>> -> ConstSlice<T,DynamicRange<EC>>
{ {
DynamicRangeFactory<EC> drf(rptr<0>(ma)->orig()); DynamicRangeFactory<EC> drf(rptr<0>(ma)->orig());

View file

@ -89,7 +89,7 @@ namespace MultiArrayTools
-> std::shared_ptr<MultiArrayBase<typename MArray::value_type,DynamicRange<EC>>>; -> std::shared_ptr<MultiArrayBase<typename MArray::value_type,DynamicRange<EC>>>;
template <typename T, class EC, class Range1, class... RangeTypes> template <typename T, class EC, class Range1, class... RangeTypes>
auto anonToDynView(const MultiArray<T,Range1,RangeTypes...,AnonymousRange>& ma) auto anonToDynView(const MultiArrayBase<T,Range1,RangeTypes...,AnonymousRange>& ma)
-> ConstSlice<T,Range1,RangeTypes...,DynamicRange<EC>>; -> ConstSlice<T,Range1,RangeTypes...,DynamicRange<EC>>;
template <typename T, class EC, class Range1, class... RangeTypes> template <typename T, class EC, class Range1, class... RangeTypes>
@ -97,7 +97,7 @@ namespace MultiArrayTools
-> MultiArray<T,Range1,RangeTypes...,AnonymousRange>; -> MultiArray<T,Range1,RangeTypes...,AnonymousRange>;
template <typename T, class EC> template <typename T, class EC>
auto anonToDynView(const MultiArray<T,AnonymousRange>& ma) auto anonToDynView(const MultiArrayBase<T,AnonymousRange>& ma)
-> ConstSlice<T,DynamicRange<EC>>; -> ConstSlice<T,DynamicRange<EC>>;
template <typename T, class EC> template <typename T, class EC>

View file

@ -66,7 +66,8 @@ namespace MultiArrayTools
typedef typename RangeInterface<AnonymousIndex>::IndexType IndexType; typedef typename RangeInterface<AnonymousIndex>::IndexType IndexType;
typedef GenSingleRange<size_t,SpaceType::ANON,-1> RangeType; typedef GenSingleRange<size_t,SpaceType::ANON,-1> RangeType;
typedef size_t MetaType; typedef size_t MetaType;
typedef AnonymousRangeFactory FType;
virtual size_t size() const final; virtual size_t size() const final;
virtual size_t dim() const final; virtual size_t dim() const final;