diff options
Diffstat (limited to 'genconst.c')
-rwxr-xr-x | genconst.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/genconst.c b/genconst.c new file mode 100755 index 0000000..30a1d7d --- /dev/null +++ b/genconst.c @@ -0,0 +1,34 @@ +#define GEN_CONST +#include "mec-2.h" +#include <stdio.h> + +int main() +{ + FILE *f; + /* Initialize constants */ + ALPHA_ST = _ALPHA_ST; + ALPHA_YT = _ALPHA_YT; + SIGMA_LU = _SIGMA_LU; + SIGMA_LY = _SIGMA_LY; + DEFAULT_BETA1 = _DEFAULT_BETA1; + MIN_BETA = _MIN_BETA; + EC_MIN_VALUE = _EC_MIN_VALUE; + CUTOFF = _CUTOFF; + + f = fopen("mec-2-const.h", "w"); + if (!f) { + fprintf(stderr, "Unable to open const output\n"); + exit(1); + } + fprintf(f, "/* Generated by genconst */\n"); + fprintf(f, "#define ALPHA_ST %e\n", ALPHA_ST); + fprintf(f, "#define ALPHA_YT %e\n", ALPHA_YT); + fprintf(f, "#define SIGMA_LU %e\n", SIGMA_LU); + fprintf(f, "#define SIGMA_LY %e\n", SIGMA_LY); + fprintf(f, "#define DEFAULT_BETA1 %e\n", DEFAULT_BETA1); + fprintf(f, "#define MIN_BETA %e\n", MIN_BETA); + fprintf(f, "#define EC_MIN_VALUE %e\n", EC_MIN_VALUE); + fprintf(f, "#define CUTOFF %e\n", CUTOFF); + exit(0); + +} |