enable high level math functions

This commit is contained in:
Christian Zimmermann 2020-09-03 12:15:51 +02:00
parent e174ced2eb
commit ee58f2ab39
3 changed files with 21 additions and 3 deletions

View file

@ -288,6 +288,17 @@ namespace MultiArrayTools
return HighLevelOpHolder<ROP>(std::make_shared<HighLevelOpRoot<ROP>>( op ) );
}
#define SP " "
#define regFunc1(fff) template <class ROP> \
HighLevelOpHolder<ROP> hl_##fff (const HighLevelOpHolder<ROP>& in) \
{ return HighLevelOpHolder<ROP>( std::make_shared<HighLevelOp<ROP,x_##fff <double>,1>> \
( std::array<std::shared_ptr<HighLevelOpBase<ROP>>,1>( {in.op()} ) ) ); } \
#include "extensions/math.h"
#undef regFunc1
#undef SP
/*
template <class ROP>
HighLevelOpHolder<ROP> exp(const HighLevelOpHolder<ROP>& in)
{
@ -295,5 +306,5 @@ namespace MultiArrayTools
( std::make_shared<HighLevelOp<ROP,x_exp<double>,1>>
( std::array<std::shared_ptr<HighLevelOpBase<ROP>>,1>( {in.op()} ) ) );
}
*/
}

View file

@ -139,9 +139,16 @@ namespace MultiArrayTools
template <class ROP>
HighLevelOpHolder<ROP> mkHLO(const ROP& op);
#define SP " "
#define regFunc1(fff) template <class ROP> \
HighLevelOpHolder<ROP> hl_##fff (const HighLevelOpHolder<ROP>& in);
#include "extensions/math.h"
#undef regFunc1
#undef SP
/*
template <class ROP>
HighLevelOpHolder<ROP> exp(const HighLevelOpHolder<ROP>& in);
*/
}

View file

@ -302,7 +302,7 @@ namespace
auto hop1 = mkHLO(ma2(i1,di2));
auto hop3 = mkHLO(ma1(i1,di1));
auto hop2 = exp(hop1);
auto hop2 = hl_exp(hop1);
auto hop4 = hop3 * hop2;
auto hopr = mkHLO(resx4(i1,di4));
hopr.assign( hop4, mi, ic_1, ic_2 );