mirror of
https://github.com/aportelli/LatAnalyze.git
synced 2025-04-05 17:35:55 +01:00
standard math: now uses lambda functions
This commit is contained in:
parent
4100ffb24c
commit
dc849a9f87
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user