Mercurial > hg > qm-dsp
comparison dsp/maths/MathAliases.h @ 0:d7116e3183f8
* Queen Mary C++ DSP library
author | cannam |
---|---|
date | Wed, 05 Apr 2006 17:35:59 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:d7116e3183f8 |
---|---|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ | |
2 | |
3 /* | |
4 QM DSP Library | |
5 | |
6 Centre for Digital Music, Queen Mary, University of London. | |
7 This file copyright 2005-2006 Christian Landone. | |
8 All rights reserved. | |
9 */ | |
10 | |
11 #ifndef MATHALIASES_H | |
12 #define MATHALIASES_H | |
13 | |
14 #include <cmath> | |
15 #include <complex> | |
16 | |
17 using namespace std; | |
18 typedef complex<double> ComplexData; | |
19 | |
20 | |
21 #ifndef PI | |
22 #define PI (3.14159265358979232846) | |
23 #endif | |
24 | |
25 #define TWO_PI (*2.PI) | |
26 | |
27 #define EPS 2.2204e-016 | |
28 | |
29 /* aliases to math.h functions */ | |
30 #define EXP exp | |
31 #define COS cos | |
32 #define SIN sin | |
33 #define ABS fabs | |
34 #define POW powf | |
35 #define SQRT sqrtf | |
36 #define LOG10 log10f | |
37 #define LOG logf | |
38 #define FLOOR floorf | |
39 #define TRUNC truncf | |
40 | |
41 /* aliases to complex.h functions */ | |
42 /** sample = EXPC(complex) */ | |
43 #define EXPC cexpf | |
44 /** complex = CEXPC(complex) */ | |
45 #define CEXPC cexp | |
46 /** sample = ARGC(complex) */ | |
47 #define ARGC cargf | |
48 /** sample = ABSC(complex) norm */ | |
49 #define ABSC cabsf | |
50 /** sample = REAL(complex) */ | |
51 #define REAL crealf | |
52 /** sample = IMAG(complex) */ | |
53 #define IMAG cimagf | |
54 | |
55 #endif |