From 8db40f0610e76db61e916959243ffdde24c56c0c Mon Sep 17 00:00:00 2001 From: Christian Zimmermann Date: Wed, 6 Feb 2019 14:11:17 +0100 Subject: [PATCH] add missing FType in special ranges --- src/include/helper_tools.cc.h | 8 ++++---- src/include/helper_tools.h | 8 ++++---- src/include/map_range.cc.h | 10 +++++----- src/include/ranges/range_types/classic_range.h | 3 ++- src/include/ranges/range_types/null_range.h | 1 + src/include/ranges/range_types/space_range.h | 1 + src/include/ranges/range_types/spin_range.h | 3 ++- 7 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/include/helper_tools.cc.h b/src/include/helper_tools.cc.h index 0f20a00..fc09571 100644 --- a/src/include/helper_tools.cc.h +++ b/src/include/helper_tools.cc.h @@ -65,22 +65,22 @@ namespace MultiArrayTools template auto mkGenMapI(const std::shared_ptr& f, std::shared_ptr... indices) - -> decltype( getIndex( mkGenMapR( f, indices->range()... ) ) ) + -> decltype( getIndex( mkGenMapR( f, indices->range()... ) ) ) { - auto mi = getIndex( mkGenMapR( f, indices->range()... ) ); + auto mi = getIndex( mkGenMapR( f, indices->range()... ) ); (*mi)(indices...); return mi; } template - auto mkMapR(const Func& f, std::shared_ptr... ranges) + auto mkMapR(const std::shared_ptr& f, std::shared_ptr... ranges) -> decltype( mkGenMapR(f, ranges... ) ) { return mkGenMapR(f, ranges... ); } template - auto mkMapI(const Func& f, std::shared_ptr... indices) + auto mkMapI(const std::shared_ptr& f, std::shared_ptr... indices) -> decltype( mkGenMapI(f, indices... ) ) { return mkGenMapI(f, indices... ); diff --git a/src/include/helper_tools.h b/src/include/helper_tools.h index 111d4fe..1eaa9a6 100644 --- a/src/include/helper_tools.h +++ b/src/include/helper_tools.h @@ -28,20 +28,20 @@ namespace MultiArrayTools -> std::shared_ptr >; template - auto mkGenMapR(const Func& f, std::shared_ptr... ranges) + auto mkGenMapR(const std::shared_ptr& f, std::shared_ptr... ranges) -> std::shared_ptr, STYPE,RangeTypes...> >; template - auto mkGenMapI(const Func& f, std::shared_ptr... indices) + auto mkGenMapI(const std::shared_ptr& f, std::shared_ptr... indices) -> decltype( getIndex( mkGenMapR( f, indices->range()... ) ) ); template - auto mkMapR(const Func& f, std::shared_ptr... ranges) + auto mkMapR(const std::shared_ptr& f, std::shared_ptr... ranges) -> decltype( mkGenMapR(f, ranges... ) ); template - auto mkMapI(const Func& f, std::shared_ptr... indices) + auto mkMapI(const std::shared_ptr& f, std::shared_ptr... indices) -> decltype( mkGenMapI(f, indices... ) ); template diff --git a/src/include/map_range.cc.h b/src/include/map_range.cc.h index 151982a..79492b3 100644 --- a/src/include/map_range.cc.h +++ b/src/include/map_range.cc.h @@ -1,6 +1,6 @@ #include "map_range.h" -#include +//#include namespace MultiArrayTools { @@ -398,8 +398,8 @@ namespace MultiArrayTools template static void mk(std::shared_ptr& outRange, MultiArray& mapMult, const MapF& mapf) { - static_assert( std::is_same::value, - "out range value type for NONE must be size_t" ); + //static_assert( std::is_same::value, + // "out range value type for NONE must be size_t" ); size_t max = 0; for(auto ii = mapf.begin(); ii.max() != ii.pos(); ++ii) { max = mapf[ii] > max ? mapf[ii]+1 : max; @@ -529,7 +529,7 @@ namespace MultiArrayTools template typename GenMapRange::IndexType GenMapRange::begin() const { - MapIndex + GenMapIndex i( std::dynamic_pointer_cast > ( std::shared_ptr( RB::mThis ) ) ); i = 0; @@ -539,7 +539,7 @@ namespace MultiArrayTools template typename GenMapRange::IndexType GenMapRange::end() const { - MapIndex + GenMapIndex i( std::dynamic_pointer_cast > ( std::shared_ptr( RB::mThis )) ); i = size(); diff --git a/src/include/ranges/range_types/classic_range.h b/src/include/ranges/range_types/classic_range.h index a232bec..3a65fea 100644 --- a/src/include/ranges/range_types/classic_range.h +++ b/src/include/ranges/range_types/classic_range.h @@ -34,7 +34,8 @@ namespace MultiArrayTools typedef typename RangeInterface >::IndexType IndexType; typedef SingleRange RangeType; typedef size_t MetaType; - + typedef SingleRangeFactory FType; + virtual size_t size() const final; virtual size_t dim() const final; diff --git a/src/include/ranges/range_types/null_range.h b/src/include/ranges/range_types/null_range.h index 16e7c2c..968c0c0 100644 --- a/src/include/ranges/range_types/null_range.h +++ b/src/include/ranges/range_types/null_range.h @@ -41,6 +41,7 @@ namespace MultiArrayTools typedef typename RangeInterface >::IndexType IndexType; typedef SingleRange RangeType; typedef size_t MetaType; + typedef SingleRangeFactory FType; virtual size_t size() const final; virtual size_t dim() const final; diff --git a/src/include/ranges/range_types/space_range.h b/src/include/ranges/range_types/space_range.h index 3187403..238afb5 100644 --- a/src/include/ranges/range_types/space_range.h +++ b/src/include/ranges/range_types/space_range.h @@ -33,6 +33,7 @@ namespace MultiArrayTools typedef typename RangeInterface >::IndexType IndexType; typedef SingleRange RangeType; typedef int MetaType; + typedef SingleRangeFactory FType; virtual size_t size() const final; virtual size_t dim() const final; diff --git a/src/include/ranges/range_types/spin_range.h b/src/include/ranges/range_types/spin_range.h index 5fdfa5b..32c8dff 100644 --- a/src/include/ranges/range_types/spin_range.h +++ b/src/include/ranges/range_types/spin_range.h @@ -34,7 +34,8 @@ namespace MultiArrayTools typedef typename RangeInterface >::IndexType IndexType; typedef SingleRange RangeType; typedef size_t MetaType; - + typedef SingleRangeFactory FType; + virtual size_t size() const final; virtual size_t dim() const final;