1
0
mirror of https://github.com/aportelli/LatAnalyze.git synced 2024-11-10 08:55:37 +00: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) \ #define DEF_STD_FUNC_1ARG(name) \
static double name##VecFunc(const double *arg)\ auto name##VecFunc = [](const double arg[1]){return (name)(arg[0]);};\
{\ DoubleFunction STDMATH_NAMESPACE::name(1, name##VecFunc);
return (name)(arg[0]);\
}\
DoubleFunction STDMATH_NAMESPACE::name(1, &name##VecFunc);
#define DEF_STD_FUNC_2ARG(name) \ #define DEF_STD_FUNC_2ARG(name) \
static double name##VecFunc(const double *arg)\ auto name##VecFunc = [](const double arg[2]){return (name)(arg[0], arg[1]);};\
{\ DoubleFunction STDMATH_NAMESPACE::name(2, name##VecFunc);
return (name)(arg[0], arg[1]);\
}\
DoubleFunction STDMATH_NAMESPACE::name(2, &name##VecFunc);
// Trigonometric functions // Trigonometric functions
DEF_STD_FUNC_1ARG(cos) DEF_STD_FUNC_1ARG(cos)