1
0
mirror of https://github.com/aportelli/LatAnalyze.git synced 2024-09-20 05:25:37 +01:00

standard math: now uses lambda functions

This commit is contained in:
Antonin Portelli 2014-03-03 12:42:27 +00:00
parent 4100ffb24c
commit dc849a9f87

View File

@ -28,18 +28,12 @@ using namespace Latan;
******************************************************************************/
#define DEF_STD_FUNC_1ARG(name) \
static double name##VecFunc(const double *arg)\
{\
return (name)(arg[0]);\
}\
DoubleFunction STDMATH_NAMESPACE::name(1, &name##VecFunc);
auto name##VecFunc = [](const double arg[1]){return (name)(arg[0]);};\
DoubleFunction STDMATH_NAMESPACE::name(1, name##VecFunc);
#define DEF_STD_FUNC_2ARG(name) \
static double name##VecFunc(const double *arg)\
{\
return (name)(arg[0], arg[1]);\
}\
DoubleFunction STDMATH_NAMESPACE::name(2, &name##VecFunc);
auto name##VecFunc = [](const double arg[2]){return (name)(arg[0], arg[1]);};\
DoubleFunction STDMATH_NAMESPACE::name(2, name##VecFunc);
// Trigonometric functions
DEF_STD_FUNC_1ARG(cos)