#include #include "gtest/gtest.h" #include #include "cnorxz.h" #include #include namespace MAT = MultiArrayTools; double xround(double arg) { if(std::isnan(arg)) { return 0.; } return roundf(arg * 100000.) / 100000.; } using namespace MAT; typedef ClassicRange CR; typedef ClassicRF CRF; typedef DynamicRange DR; typedef DynamicRangeFactory DRF; template void swapFactory(std::shared_ptr& fptr) { auto nptr = std::make_shared(); fptr = nptr; } template void swapFactory(std::shared_ptr& fptr, std::initializer_list ilist) { vector tmp = ilist; auto nptr = std::make_shared( tmp ); fptr = nptr; } template void swapFactory(std::shared_ptr& fptr, vector& ilist) { vector tmp = ilist; auto nptr = std::make_shared( tmp ); fptr = nptr; } template void swapMFactory(std::shared_ptr& fptr, const Rs&... rs) { auto nptr = std::make_shared( rs... ); fptr = nptr; } template auto mkt(Ts&&... ts) -> decltype(std::make_tuple(ts...)) { return std::make_tuple(ts...); } template auto mkts(Ts&&... ts) -> decltype(std::make_tuple(ts...)) { return std::make_tuple(static_cast( ts )...); } //typedef Expressions1 EC1; template struct Pow { static constexpr bool FISSTATIC = true; typedef T value_type; static inline T apply(T b, T e) { return pow(b, e); } template static auto mk(const Ops&... ops) -> Operation,Ops...> { return Operation,Ops...>(ops...); } static inline T apply(const std::tuple& arg) { return pow(std::get<0>(arg), std::get<1>(arg)); } }; template struct Monopole { static constexpr bool FISSTATIC = true; static inline T apply(T f0, T x, T n) { return f0 / ( 1 + x / n ); } template static auto mk(const Ops&... ops) -> Operation,Ops...> { return Operation,Ops...>(ops...); } };