From b4912dba71fd9c93ff0c7f4de66cb3d1f518401d Mon Sep 17 00:00:00 2001 From: Christian Zimmermann Date: Fri, 8 Jan 2021 21:40:20 +0100 Subject: [PATCH] helper_tools: further mkMapR functions --- src/include/helper_tools.cc.h | 14 ++++++++++++++ src/include/helper_tools.h | 12 ++++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/include/helper_tools.cc.h b/src/include/helper_tools.cc.h index c9e5e63..e08b5fa 100644 --- a/src/include/helper_tools.cc.h +++ b/src/include/helper_tools.cc.h @@ -138,6 +138,20 @@ namespace MultiArrayTools return mkGenMapRwith(outr, f, ranges... ); } + template + auto mkMapR(const std::shared_ptr& func, const std::shared_ptr&... is) + -> decltype( mkMapR( mkMapOp( func, is... ), is->range()... ) ) + { + return mkMapR( mkMapOp( func, is... ), is->range()... ); + } + + template + auto mkMapRwith(const std::shared_ptr>& outr, const std::shared_ptr& func, const std::shared_ptr&... is) + -> decltype( mkMapRwith(outr, mkMapOp( func, is... ), is->range()... ) ) + { + return mkMapRwith(outr, mkMapOp( func, is... ), is->range()... ); + } + template auto mkMapI(const std::tuple& f, std::shared_ptr... indices) -> decltype( mkGenMapI(f, indices... ) ) diff --git a/src/include/helper_tools.h b/src/include/helper_tools.h index 9f79674..c7f26de 100644 --- a/src/include/helper_tools.h +++ b/src/include/helper_tools.h @@ -47,6 +47,18 @@ namespace MultiArrayTools template auto mkMapR(const std::tuple& f, std::shared_ptr... ranges) -> decltype( mkGenMapR(f, ranges... ) ); + + template + auto mkMapRwith(const std::shared_ptr>& outr, const std::tuple& f, std::shared_ptr... ranges) + -> decltype( mkGenMapRwith(outr, f, ranges... ) ); + + template + auto mkMapR(const std::shared_ptr& func, const std::shared_ptr&... is) + -> decltype( mkMapR( mkMapOp( func, is... ), is->range()... ) ); + + template + auto mkMapRwith(const std::shared_ptr>& outr, const std::shared_ptr& func, const std::shared_ptr&... is) + -> decltype( mkMapRwith(outr, mkMapOp( func, is... ), is->range()... ) ); template auto mkMapRwith(const std::shared_ptr>& outr, const std::tuple& f,