From cf1850923fdd404ef1b831d425961d40f3dd5e90 Mon Sep 17 00:00:00 2001 From: Christian Zimmermann Date: Sun, 4 Apr 2021 15:10:15 +0200 Subject: [PATCH] name mapping suggestions + static cc for implementation --- src/include/statics/static_for.h | 68 ++++++++++++++++++++++++++++++++ src/name_map.txt | 7 ++++ 2 files changed, 75 insertions(+) create mode 100644 src/include/statics/static_for.h create mode 100644 src/name_map.txt diff --git a/src/include/statics/static_for.h b/src/include/statics/static_for.h new file mode 100644 index 0000000..fb12618 --- /dev/null +++ b/src/include/statics/static_for.h @@ -0,0 +1,68 @@ + +#ifndef __static_for_h__ +#define __static_for_h__ + +#include + +namespace MultiArrayTools +{ + + template + struct sfor + { + template + static void execs(const F& f) + { + if(BEG < END){ + f(std::integral_constant{}); + sfor::execs(f); + } + } + + template + static void execsr(const F& f) + { + if(BEG < END){ + f(std::integral_constant{}); + sfor::execsr(f); + } + } + + template + static void exec(const F& f) + { + f(std::integral_constant{}); + sfor::exec(f); + } + + template + static void execr(const F& f) + { + f(std::integral_constant{}); + sfor::execr(f); + } + }; + + template + struct sfor + { + template + static void execs(const F& f) {} + + template + static void execsr(const F& f) {} + + template + static void exec(const F& f) {} + + template + static void execr(const F& f) {} + }; +} + +#define MA_SSFOR(i,beg,end,expr) MultiArrayTools::sfor::execs([&](auto i){ expr }) +#define MA_SSRFOR(i,end,beg,expr) MultiArrayTools::sfor::execsr([&](auto i){ expr }) +#define MA_SFOR(i,beg,end,expr) MultiArrayTools::sfor::exec([&](auto i){ expr }) +#define MA_SRFOR(i,end,beg,expr) MultiArrayTools::sfor::execr([&](auto i){ expr }) + +#endif diff --git a/src/name_map.txt b/src/name_map.txt new file mode 100644 index 0000000..f38a7a5 --- /dev/null +++ b/src/name_map.txt @@ -0,0 +1,7 @@ +:: Rename MultiArray library in CNORXZ (Containers with Native Operation Routines by XZ (chizeta)) +MultiArrayTools -> CNORXZ +MultiArray -> Array +multi_array_*.{cc,h} -> cxz_*.{cc,h} +*ma* -> *cxz* +libmultiarray -> libcnorxz +...!!!