add missing FType in special ranges
This commit is contained in:
parent
811054f14f
commit
8db40f0610
7 changed files with 19 additions and 15 deletions
|
@ -65,22 +65,22 @@ namespace MultiArrayTools
|
|||
|
||||
template <SpaceType STYPE, class Func, class... IndexTypes>
|
||||
auto mkGenMapI(const std::shared_ptr<Func>& f, std::shared_ptr<IndexTypes>... indices)
|
||||
-> decltype( getIndex( mkGenMapR( f, indices->range()... ) ) )
|
||||
-> decltype( getIndex( mkGenMapR<STYPE>( f, indices->range()... ) ) )
|
||||
{
|
||||
auto mi = getIndex( mkGenMapR( f, indices->range()... ) );
|
||||
auto mi = getIndex( mkGenMapR<STYPE>( f, indices->range()... ) );
|
||||
(*mi)(indices...);
|
||||
return mi;
|
||||
}
|
||||
|
||||
template <class Func, class... RangeTypes>
|
||||
auto mkMapR(const Func& f, std::shared_ptr<RangeTypes>... ranges)
|
||||
auto mkMapR(const std::shared_ptr<Func>& f, std::shared_ptr<RangeTypes>... ranges)
|
||||
-> decltype( mkGenMapR<SpaceType::ANY>(f, ranges... ) )
|
||||
{
|
||||
return mkGenMapR<SpaceType::ANY>(f, ranges... );
|
||||
}
|
||||
|
||||
template <class Func, class... IndexTypes>
|
||||
auto mkMapI(const Func& f, std::shared_ptr<IndexTypes>... indices)
|
||||
auto mkMapI(const std::shared_ptr<Func>& f, std::shared_ptr<IndexTypes>... indices)
|
||||
-> decltype( mkGenMapI<SpaceType::ANY>(f, indices... ) )
|
||||
{
|
||||
return mkGenMapI<SpaceType::ANY>(f, indices... );
|
||||
|
|
|
@ -28,20 +28,20 @@ namespace MultiArrayTools
|
|||
-> std::shared_ptr<MultiRange<RangeTypes...> >;
|
||||
|
||||
template <SpaceType STYPE, class Func, class... RangeTypes>
|
||||
auto mkGenMapR(const Func& f, std::shared_ptr<RangeTypes>... ranges)
|
||||
auto mkGenMapR(const std::shared_ptr<Func>& f, std::shared_ptr<RangeTypes>... ranges)
|
||||
-> std::shared_ptr<GenMapRange<FunctionalMultiArray<typename Func::value_type,Func,RangeTypes...>,
|
||||
STYPE,RangeTypes...> >;
|
||||
|
||||
template <SpaceType STYPE, class Func, class... IndexTypes>
|
||||
auto mkGenMapI(const Func& f, std::shared_ptr<IndexTypes>... indices)
|
||||
auto mkGenMapI(const std::shared_ptr<Func>& f, std::shared_ptr<IndexTypes>... indices)
|
||||
-> decltype( getIndex( mkGenMapR<STYPE>( f, indices->range()... ) ) );
|
||||
|
||||
template <class Func, class... RangeTypes>
|
||||
auto mkMapR(const Func& f, std::shared_ptr<RangeTypes>... ranges)
|
||||
auto mkMapR(const std::shared_ptr<Func>& f, std::shared_ptr<RangeTypes>... ranges)
|
||||
-> decltype( mkGenMapR<SpaceType::ANY>(f, ranges... ) );
|
||||
|
||||
template <class Func, class... IndexTypes>
|
||||
auto mkMapI(const Func& f, std::shared_ptr<IndexTypes>... indices)
|
||||
auto mkMapI(const std::shared_ptr<Func>& f, std::shared_ptr<IndexTypes>... indices)
|
||||
-> decltype( mkGenMapI<SpaceType::ANY>(f, indices... ) );
|
||||
|
||||
template <class... IndexTypes>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
#include "map_range.h"
|
||||
#include <type_traits>
|
||||
//#include <type_traits>
|
||||
|
||||
namespace MultiArrayTools
|
||||
{
|
||||
|
@ -398,8 +398,8 @@ namespace MultiArrayTools
|
|||
template <class MapF, class ORType>
|
||||
static void mk(std::shared_ptr<ORType>& outRange, MultiArray<size_t,ORType>& mapMult, const MapF& mapf)
|
||||
{
|
||||
static_assert( std::is_same<size_t,typename MapF::value_type>::value,
|
||||
"out range value type for NONE must be size_t" );
|
||||
//static_assert( std::is_same<size_t,typename MapF::value_type>::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 <class MapF, SpaceType XSTYPE, class... Ranges>
|
||||
typename GenMapRange<MapF,XSTYPE,Ranges...>::IndexType GenMapRange<MapF,XSTYPE,Ranges...>::begin() const
|
||||
{
|
||||
MapIndex<MapF,typename Ranges::IndexType...>
|
||||
GenMapIndex<MapF,XSTYPE,typename Ranges::IndexType...>
|
||||
i( std::dynamic_pointer_cast<GenMapRange<MapF,XSTYPE,Ranges...> >
|
||||
( std::shared_ptr<RangeBase>( RB::mThis ) ) );
|
||||
i = 0;
|
||||
|
@ -539,7 +539,7 @@ namespace MultiArrayTools
|
|||
template <class MapF, SpaceType XSTYPE, class... Ranges>
|
||||
typename GenMapRange<MapF,XSTYPE,Ranges...>::IndexType GenMapRange<MapF,XSTYPE,Ranges...>::end() const
|
||||
{
|
||||
MapIndex<MapF,typename Ranges::IndexType...>
|
||||
GenMapIndex<MapF,XSTYPE,typename Ranges::IndexType...>
|
||||
i( std::dynamic_pointer_cast<GenMapRange<MapF,XSTYPE,Ranges...> >
|
||||
( std::shared_ptr<RangeBase>( RB::mThis )) );
|
||||
i = size();
|
||||
|
|
|
@ -34,7 +34,8 @@ namespace MultiArrayTools
|
|||
typedef typename RangeInterface<SingleIndex<size_t,SpaceType::NONE> >::IndexType IndexType;
|
||||
typedef SingleRange<size_t,SpaceType::NONE> RangeType;
|
||||
typedef size_t MetaType;
|
||||
|
||||
typedef SingleRangeFactory<size_t,SpaceType::NONE> FType;
|
||||
|
||||
virtual size_t size() const final;
|
||||
virtual size_t dim() const final;
|
||||
|
||||
|
|
|
@ -41,6 +41,7 @@ namespace MultiArrayTools
|
|||
typedef typename RangeInterface<SingleIndex<size_t,SpaceType::NUL> >::IndexType IndexType;
|
||||
typedef SingleRange<size_t,SpaceType::NUL> RangeType;
|
||||
typedef size_t MetaType;
|
||||
typedef SingleRangeFactory<size_t,SpaceType::NUL> FType;
|
||||
|
||||
virtual size_t size() const final;
|
||||
virtual size_t dim() const final;
|
||||
|
|
|
@ -33,6 +33,7 @@ namespace MultiArrayTools
|
|||
typedef typename RangeInterface<SingleIndex<int,SpaceType::PSPACE> >::IndexType IndexType;
|
||||
typedef SingleRange<int,SpaceType::PSPACE> RangeType;
|
||||
typedef int MetaType;
|
||||
typedef SingleRangeFactory<int,SpaceType::PSPACE> FType;
|
||||
|
||||
virtual size_t size() const final;
|
||||
virtual size_t dim() const final;
|
||||
|
|
|
@ -34,7 +34,8 @@ namespace MultiArrayTools
|
|||
typedef typename RangeInterface<SingleIndex<size_t,SpaceType::SPIN> >::IndexType IndexType;
|
||||
typedef SingleRange<size_t,SpaceType::SPIN> RangeType;
|
||||
typedef size_t MetaType;
|
||||
|
||||
typedef SingleRangeFactory<size_t,SpaceType::SPIN> FType;
|
||||
|
||||
virtual size_t size() const final;
|
||||
virtual size_t dim() const final;
|
||||
|
||||
|
|
Loading…
Reference in a new issue