Ian Jauslin
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
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);
}