Ian Jauslin
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jauslin <ian@jauslin.org>2022-06-14 09:26:07 +0200
committerIan Jauslin <ian@jauslin.org>2022-06-14 09:46:36 +0200
commit3f0510629e422e979b57d3f93791937912a4183a (patch)
treebf2589b2689044261b0cd4d9e6b3082194fdd9e9 /src/numkondo.c
parent469bdc80712dbf9c12562059dc4594620b59a076 (diff)
Update to v1.5.HEADmaster
The update to version 1.5 is rather substantial, and introduces some minor backward-incompatibilities: * The header "#!symbols" has been replaced by "#!virtual_fields" * Multiplying polynomials using the '*' symbol is no longer supported (or, rather, the symbolic capabilities of meankondo were enhanced, and the syntax has been changed). * 'meantools exp' has been removed (its functionality is now handled by other means) * 'meantoolds derive' has been replaced by 'meantools differentiate' * The symbolic capabilities were enhanced: polynomials can now be multiplied, added, exponentiated, and their logarithms can be taken directly in the configuration file. * The flow equation can now be processed after being computed using the various "#!postprocess_*" entries. * Deprecated kondo_preprocess. * Compute the mean using an LU decomposition if possible. * More detailed checks for syntax errors in configuration file. * Check that different '#!group' entries are indeed uncorrelated. * New flags in meankondo: '-p' and '-A'. * New tool: meantools expand. * Improve conversion to LaTeX using meantools-convert * Assign terms randomly to different threads. * Created vim files to implement syntax highlighting for configuration files. * Multiple bug fixes
Diffstat (limited to 'src/numkondo.c')
-rw-r--r--src/numkondo.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/numkondo.c b/src/numkondo.c
index 0568861..91e6be2 100644
--- a/src/numkondo.c
+++ b/src/numkondo.c
@@ -1,5 +1,5 @@
/*
-Copyright 2015 Ian Jauslin
+Copyright 2015-2022 Ian Jauslin
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -86,12 +86,6 @@ int read_args_numkondo(int argc,const char* argv[], Str_Array* str_args, Numkond
// whether a file was specified on the command-line
int exists_file=0;
- // if there are no arguments
- if(argc==1){
- print_usage_numkondo();
- exit(-1);
- }
-
// defaults
// display entire flow
(*opts).display_mode=DISPLAY_NUMERICAL;
@@ -193,6 +187,8 @@ int numflow(Str_Array str_args, Numkondo_Options opts){
Grouped_Polynomial flow_equation;
// whether or not to use mpfr floats
int mpfr_flag=0;
+ // postprocess flow equation
+ Grouped_Polynomial postprocess_flow_equation;
// set mpfr defaults
if(opts.mpfr_prec!=0){
@@ -205,7 +201,7 @@ int numflow(Str_Array str_args, Numkondo_Options opts){
}
- // parse id table
+ // parse labels
arg_index=find_str_arg("labels", str_args);
if(arg_index<0){
fprintf(stderr,"error: no labels entry in the configuration file\n");
@@ -225,6 +221,16 @@ int numflow(Str_Array str_args, Numkondo_Options opts){
char_array_to_Grouped_Polynomial(str_args.strs[arg_index], &flow_equation);
}
+ // parse postprocess operation
+ arg_index=find_str_arg("postprocess_operation", str_args);
+ if(arg_index>=0){
+ char_array_to_Grouped_Polynomial(str_args.strs[arg_index], &postprocess_flow_equation);
+ }
+ else{
+ init_Grouped_Polynomial(&postprocess_flow_equation,1);
+ }
+
+
// initial conditions
// check they were not specified on the command line
if(opts.eval_rccstring.length==-1){
@@ -252,17 +258,18 @@ int numflow(Str_Array str_args, Numkondo_Options opts){
}
if(mpfr_flag==0){
- numerical_flow(flow_equation, init_cd, labels, opts.niter, opts.display_mode);
+ numerical_flow(flow_equation, init_cd, postprocess_flow_equation, labels, opts.niter, opts.display_mode);
free_RCC(init_cd);
}
else{
- numerical_flow_mpfr(flow_equation, init_cd_mpfr, labels, opts.niter, opts.display_mode);
+ numerical_flow_mpfr(flow_equation, init_cd_mpfr, postprocess_flow_equation, labels, opts.niter, opts.display_mode);
free_RCC_mpfr(init_cd_mpfr);
}
// free memory
free_Labels(labels);
+ free_Grouped_Polynomial(postprocess_flow_equation);
free_Grouped_Polynomial(flow_equation);
return(0);
}