ParMooN
 All Classes Functions Variables Friends Pages
complextools.h
1 #ifndef MPIMIS_TOOLS
2 #define MPIMIS_TOOLS
3 
4 #include "basictools.h"
5 
6 #include <math.h>
7 #include <stdlib.h>
8 
9 inline bool isZero(double p_dValue);
10 inline double modulus(double p_dA, double p_dB);
11 
12 inline bool isZero(double p_dValue) { // Tells if a number is zero considering a threshold
13  return (abs(p_dValue) < ZERO_THRESHOLD ? true : false);
14 }
15 inline double modulus(double p_dA, double p_dB) { // Gives the modulus of a complex number: p_dA + p_dB * i
16  return sqrt(sqr(p_dA) + sqr(p_dB));
17 }
18 
19 #endif // MPIMIS_TOOLS