-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathdefsmart.h
32 lines (27 loc) · 1.22 KB
/
defsmart.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef DEFSMART_H
#define DEFSMART_H
#include <math.h>
#define ID_NONE -1
typedef signed int number_id;
#define NFUNC_SQR(arg) ((arg)*(arg))
#define NFUNC_SQRT(arg) sqrtf(arg)
#define NFUNC_EXP(arg) expf(arg)
#define NFUNC_EXP87 6.07603E37
#define NFUNC_LN(arg) logf(arg)
#define NFUNC_SIN(arg) sinf(arg)
#define NFUNC_COS(arg) cosf(arg)
#define NFUNC_TAN(arg) tanf(arg)
#define NFUNC_ATAN(arg) atanf(arg)
#define NFUNC_TANH(arg) tanhf(arg)
#define NFUNC_EPSILON std::numeric_limits<NType>::epsilon()
#define NFUNC_LIMITS_MAX std::numeric_limits<NType>::max()
template <typename NType> NType nfunc_sqr(NType arg) {return arg * arg;}
template <typename NType> NType nfunc_sqrt(NType arg) {return sqrtf(arg);}
template <typename NType> NType nfunc_exp(NType arg) {return expf(arg);}
template <typename NType> NType nfunc_ln(NType arg) {return logf(arg);}
template <typename NType> NType nfunc_sin(NType arg) {return sinf(arg);}
template <typename NType> NType nfunc_cos(NType arg) {return cosf(arg);}
template <typename NType> NType nfunc_tan(NType arg) {return tanf(arg);}
template <typename NType> NType nfunc_atan(NType arg) {return atanf(arg);}
template <typename NType> NType nfunc_tanh(NType arg) {return tanhf(arg);}
#endif // DEFSMART_H