#ifndef AUX_H
#define AUX_H
-#define EDIST(a, b) ({ __typeof__ (a) _a = (a); \
- __typeof__ (b) _b = (b); \
- pow(pow((_b)->x() - (_a)->x(), 2) + \
- pow((_b)->y() - (_a)->y(), 2), 0.5); })
+#define EDIST(a, b) ({ \
+ __typeof__ (a) _a = (a); \
+ __typeof__ (b) _b = (b); \
+ sqrt( \
+ pow((_b)->x() - (_a)->x(), 2) \
+ + pow((_b)->y() - (_a)->y(), 2) \
+ ); \
+})
// see http://www.cplusplus.com/reference/algorithm/max/
-#define MAX(a, b) ({ __typeof__ (a) _a = (a); \
- __typeof__ (b) _b = (b); \
- (_a < _b) ? _b : _a; })
+#define MAX(a, b) ({ \
+ __typeof__ (a) _a = (a); \
+ __typeof__ (b) _b = (b); \
+ (_a < _b) ? _b : _a; \
+})
// see http://www.cplusplus.com/reference/algorithm/min/
-#define MIN(a, b) ({ __typeof__ (a) _a = (a); \
- __typeof__ (b) _b = (b); \
- !(_b < _a) ? _a : _b; })
+#define MIN(a, b) ({ \
+ __typeof__ (a) _a = (a); \
+ __typeof__ (b) _b = (b); \
+ !(_b < _a) ? _a : _b; \
+})
#endif