From 3d9cd65389ee69b4b227ae3e4f208f23a2976974 Mon Sep 17 00:00:00 2001 From: Christian Zimmermann Date: Thu, 10 Sep 2020 13:27:24 +0200 Subject: [PATCH] hl_reg_ind.h --- src/include/high_level_operation.h | 39 ++++++++++++++++++++++-------- src/include/hl_reg_ind.h | 12 +++++++++ 2 files changed, 41 insertions(+), 10 deletions(-) create mode 100644 src/include/hl_reg_ind.h diff --git a/src/include/high_level_operation.h b/src/include/high_level_operation.h index f6e4f2f..7a54451 100644 --- a/src/include/high_level_operation.h +++ b/src/include/high_level_operation.h @@ -37,9 +37,19 @@ namespace MultiArrayTools }; virtual bool root() const = 0; - - virtual RetT create(const std::shared_ptr& ind1, - const std::shared_ptr& ind2) = 0; + +#define reg_ind1(I1) virtual RetT create \ + (const std::shared_ptr& ind1) = 0 +#define reg_ind2(I1,I2) virtual RetT create \ + (const std::shared_ptr& ind1,const std::shared_ptr& ind2) = 0 +#define reg_ind3(I1,I2,I3) virtual RetT create \ + (const std::shared_ptr& ind1,const std::shared_ptr& ind2,const std::shared_ptr& ind3) = 0 + +#include "hl_reg_ind.h" + +#undef reg_ind1 +#undef reg_ind2 +#undef reg_ind3 virtual const ROP* get() const = 0; @@ -61,9 +71,17 @@ namespace MultiArrayTools virtual bool root() const override final; - virtual typename B::template RetT - create(const std::shared_ptr& ind1, - const std::shared_ptr& ind2) override final { return xcreate(ind1,ind2); } +#define reg_ind1(I1) virtual typename B::template RetT create \ + (const std::shared_ptr& ind1) \ + override final { return xcreate(ind1); } +#define reg_ind2(I1,I2) virtual typename B::template RetT create \ + (const std::shared_ptr& ind1, const std::shared_ptr& ind2) \ + override final { return xcreate(ind1,ind2); } +#define reg_ind3(I1,I2,I3) virtual typename B::template RetT create \ + (const std::shared_ptr& ind1, const std::shared_ptr& ind2, const std::shared_ptr& ind3) \ + override final { return xcreate(ind1,ind2,ind3); } + +#include "hl_reg_ind.h" virtual const ROP* get() const override final; @@ -98,10 +116,11 @@ namespace MultiArrayTools virtual const ROP* get() const override final; - virtual typename B::template RetT - create(const std::shared_ptr& ind1, - const std::shared_ptr& ind2) override final { return xcreate(ind1,ind2); } - +#include "hl_reg_ind.h" + +#undef reg_ind1 +#undef reg_ind2 +#undef reg_ind3 }; diff --git a/src/include/hl_reg_ind.h b/src/include/hl_reg_ind.h new file mode 100644 index 0000000..68c723c --- /dev/null +++ b/src/include/hl_reg_ind.h @@ -0,0 +1,12 @@ + +#ifdef reg_ind1 +#ifdef reg_ind2 +#ifdef reg_ind3 + +reg_ind1(ClassicRange::IndexType); +reg_ind2(ClassicRange::IndexType,ClassicRange::IndexType); +reg_ind3(ClassicRange::IndexType,ClassicRange::IndexType,ClassicRange::IndexType); + +#endif +#endif +#endif