mkfilter.h
00001
00002
00003
00004
00005
00006
00007 #include <string.h>
00008
00009 #define VERSION "4.6"
00010 #undef PI
00011 #define PI 3.14159265358979323846
00012 #define TWOPI (2.0 * PI)
00013 #define EPS 1e-10
00014 #define MAXORDER 12
00015 #define MAXPZ 2048
00016
00017 #define MAXSTRING 256
00018
00019 typedef void (*proc)();
00020 typedef unsigned int uint;
00021
00022 extern "C"
00023 {
00024 double atof(const char *);
00025 int atoi(const char *);
00026 void exit(int);
00027 };
00028
00029 extern const char *progname;
00030 extern void readdata(char*, double&, int&, double*, int&, double*);
00031
00032 inline double sqr(double x)
00033 {
00034 return x*x;
00035 }
00036
00037 inline bool seq(char *s1, char *s2)
00038 {
00039 return strcmp(s1, s2) == 0;
00040 }
00041
00042 inline bool onebit(uint m)
00043 {
00044 return (m != 0) && ((m & m - 1) == 0);
00045 }
00046
00047 inline double asinh(double x)
00048 {
00049
00050 return log(x + sqrt(1.0 + sqr(x)));
00051 }
00052
00053 inline double fix(double x)
00054 {
00055
00056 return (x >= 0.0) ? floor(0.5 + x) : -floor(0.5 - x);
00057 }