Add '-C' flag to meantools-derive
Fix memory leak in meantools-derive
This commit is contained in:
parent
f13eacbc8e
commit
e7aa6859f0
8
Changelog
Normal file
8
Changelog
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
1.3.1:
|
||||||
|
|
||||||
|
* '-C' flag in meantools-derive:
|
||||||
|
allows to pipe the output of meantools-derive directly into numkondo.
|
||||||
|
|
||||||
|
* Fixed memory leak in meantools-derive.
|
||||||
|
|
||||||
|
|
2
Makefile
2
Makefile
@ -18,7 +18,7 @@
|
|||||||
# if static=1 then link libkondo statically but other libraries dynamically
|
# if static=1 then link libkondo statically but other libraries dynamically
|
||||||
STATIC=1
|
STATIC=1
|
||||||
|
|
||||||
VERSION=1.3
|
VERSION=1.3.1
|
||||||
|
|
||||||
# products of the compilation
|
# products of the compilation
|
||||||
PROJECT_BINS= meankondo numkondo meantools kondo_preprocess meantools-convert
|
PROJECT_BINS= meankondo numkondo meantools kondo_preprocess meantools-convert
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
.Dd $Mdocdate: April 14 2015 $
|
.Dd $Mdocdate: April 14 2015 $
|
||||||
.Dt kondo_preprocess 1.3
|
.Dt kondo_preprocess 1.3.1
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
.Nm kondo_preprocess
|
.Nm kondo_preprocess
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
.Dd $Mdocdate: April 13 2015 $
|
.Dd $Mdocdate: April 13 2015 $
|
||||||
.Dt meankondo 1.3
|
.Dt meankondo 1.3.1
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
.Nm meankondo
|
.Nm meankondo
|
||||||
@ -44,7 +44,7 @@ as well as the following pre-processors, which generate configuration files for
|
|||||||
.It Fl t Ar threads
|
.It Fl t Ar threads
|
||||||
The number of threads to use for the computation.
|
The number of threads to use for the computation.
|
||||||
.It Fl C
|
.It Fl C
|
||||||
Format the ouptput so it can be piped to
|
Format the output so it can be piped to
|
||||||
.Sy numkondo ,
|
.Sy numkondo ,
|
||||||
that is, instead of printing the flow equation, print a full configuration file containing the flow equation as well as all the other entries of the configuration file that do not pertain to the computation of the flow equation.
|
that is, instead of printing the flow equation, print a full configuration file containing the flow equation as well as all the other entries of the configuration file that do not pertain to the computation of the flow equation.
|
||||||
.It Fl v
|
.It Fl v
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
.Dd $Mdocdate: June 12 2015 $
|
.Dd $Mdocdate: June 12 2015 $
|
||||||
.Dt meantools-convert 1.3
|
.Dt meantools-convert 1.3.1
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
.Nm meantools-convert
|
.Nm meantools-convert
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
.Dd $Mdocdate: April 14 2015 $
|
.Dd $Mdocdate: April 14 2015 $
|
||||||
.Dt meantools 1.3
|
.Dt meantools 1.3.1
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
.Nm meantools
|
.Nm meantools
|
||||||
@ -13,6 +13,7 @@
|
|||||||
.Sy derive
|
.Sy derive
|
||||||
.Op Fl d Ar nderivs
|
.Op Fl d Ar nderivs
|
||||||
.Op Fl V Ar variables
|
.Op Fl V Ar variables
|
||||||
|
.Op Fl C
|
||||||
.Op Ar config_file
|
.Op Ar config_file
|
||||||
.Pp
|
.Pp
|
||||||
.Nm
|
.Nm
|
||||||
@ -95,6 +96,10 @@ The variables that depend on the extra virtual parameter (defaults to all) (WARN
|
|||||||
would interpret the argument as being a flag, for example, write '-V "0,-1"' instead of '-V "-1,0"').
|
would interpret the argument as being a flag, for example, write '-V "0,-1"' instead of '-V "-1,0"').
|
||||||
.Pp
|
.Pp
|
||||||
Can either be a ',' separated list if indices or 'all' to derive with respect to all available variables.
|
Can either be a ',' separated list if indices or 'all' to derive with respect to all available variables.
|
||||||
|
.It Fl C
|
||||||
|
Format the output so it can be piped to
|
||||||
|
.Sy numkondo ,
|
||||||
|
that is, instead of printing the flow equation, print a full configuration file containing the flow equation as well as all the other entries of the configuration file that do not pertain to the computation of the flow equation.
|
||||||
.El
|
.El
|
||||||
.Pp
|
.Pp
|
||||||
.Sy Configuration file:
|
.Sy Configuration file:
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
.Dd $Mdocdate: April 14 2015 $
|
.Dd $Mdocdate: April 14 2015 $
|
||||||
.Dt numkondo 1.3
|
.Dt numkondo 1.3.1
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
.Nm numkondo
|
.Nm numkondo
|
||||||
|
@ -17,7 +17,7 @@ limitations under the License.
|
|||||||
#ifndef DEFINITIONS_GCC
|
#ifndef DEFINITIONS_GCC
|
||||||
#define DEFINITIONS_GCC
|
#define DEFINITIONS_GCC
|
||||||
|
|
||||||
#define VERSION "1.3"
|
#define VERSION "1.3.1"
|
||||||
|
|
||||||
// number of entries in a configuration file
|
// number of entries in a configuration file
|
||||||
#define ARG_COUNT 10
|
#define ARG_COUNT 10
|
||||||
|
@ -46,6 +46,8 @@ int tool_deriv_read_args(int argc, const char* argv[], Str_Array* str_args, Mean
|
|||||||
(*opts).deriv_derivs=1;
|
(*opts).deriv_derivs=1;
|
||||||
// derive with respect to all variables
|
// derive with respect to all variables
|
||||||
(*opts).deriv_vars.length=-1;
|
(*opts).deriv_vars.length=-1;
|
||||||
|
// do not chain
|
||||||
|
(*opts).chain=0;
|
||||||
|
|
||||||
|
|
||||||
// loop over arguments
|
// loop over arguments
|
||||||
@ -61,6 +63,10 @@ int tool_deriv_read_args(int argc, const char* argv[], Str_Array* str_args, Mean
|
|||||||
case 'V':
|
case 'V':
|
||||||
flag=CP_FLAG_VARS;
|
flag=CP_FLAG_VARS;
|
||||||
break;
|
break;
|
||||||
|
// chain
|
||||||
|
case 'C':
|
||||||
|
(*opts).chain=1;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -104,6 +110,8 @@ int tool_deriv(Str_Array str_args, Meantools_Options opts){
|
|||||||
// flow equation for the derivatives
|
// flow equation for the derivatives
|
||||||
Grouped_Polynomial flow_equation_deriv;
|
Grouped_Polynomial flow_equation_deriv;
|
||||||
int i;
|
int i;
|
||||||
|
// header of the entry
|
||||||
|
Char_Array arg_header;
|
||||||
|
|
||||||
|
|
||||||
// parse flow equation
|
// parse flow equation
|
||||||
@ -142,6 +150,29 @@ int tool_deriv(Str_Array str_args, Meantools_Options opts){
|
|||||||
// compute derivatives
|
// compute derivatives
|
||||||
flow_equation_derivative(opts.deriv_derivs, opts.deriv_vars, flow_equation, &flow_equation_deriv);
|
flow_equation_derivative(opts.deriv_derivs, opts.deriv_vars, flow_equation, &flow_equation_deriv);
|
||||||
|
|
||||||
|
// print
|
||||||
|
// if chain then print config file
|
||||||
|
if(opts.chain==1){
|
||||||
|
for(i=0;i<str_args.length;i++){
|
||||||
|
// check whether to print the str_arg
|
||||||
|
get_str_arg_title(str_args.strs[i], &arg_header);
|
||||||
|
if (\
|
||||||
|
str_cmp(arg_header.str, "flow_equation")==0 &&\
|
||||||
|
str_cmp(arg_header.str, "symbols")==0 &&\
|
||||||
|
str_cmp(arg_header.str, "groups")==0 &&\
|
||||||
|
str_cmp(arg_header.str, "fields")==0 &&\
|
||||||
|
str_cmp(arg_header.str, "identities")==0 &&\
|
||||||
|
str_cmp(arg_header.str, "propagator")==0 &&\
|
||||||
|
str_cmp(arg_header.str, "input_polynomial")==0 &&\
|
||||||
|
str_cmp(arg_header.str, "id_table")==0 ){
|
||||||
|
|
||||||
|
printf("%s\n&\n",str_args.strs[i].str);
|
||||||
|
}
|
||||||
|
free_Char_Array(arg_header);
|
||||||
|
}
|
||||||
|
// print flow equation
|
||||||
|
printf("#!flow_equation\n");
|
||||||
|
}
|
||||||
grouped_polynomial_print(flow_equation_deriv,'%','%');
|
grouped_polynomial_print(flow_equation_deriv,'%','%');
|
||||||
|
|
||||||
// free memory
|
// free memory
|
||||||
@ -164,12 +195,17 @@ int flow_equation_derivative(int n, Int_Array variables, Grouped_Polynomial flow
|
|||||||
// output polynomial
|
// output polynomial
|
||||||
grouped_polynomial_cpy(flow_equation, flow_equation_derivs);
|
grouped_polynomial_cpy(flow_equation, flow_equation_derivs);
|
||||||
|
|
||||||
for(j=0,dflow=flow_equation;j<n;j++){
|
// init dflow to flow_equation
|
||||||
|
grouped_polynomial_cpy(flow_equation, &dflow);
|
||||||
|
|
||||||
|
for(j=0;j<n;j++){
|
||||||
// tmp flow contains the result of the previous derivative
|
// tmp flow contains the result of the previous derivative
|
||||||
grouped_polynomial_cpy(dflow, &tmpflow);
|
grouped_polynomial_cpy(dflow, &tmpflow);
|
||||||
// derive
|
// free dflow
|
||||||
|
free_Grouped_Polynomial(dflow);
|
||||||
|
// next derivative
|
||||||
flow_equation_derivx(tmpflow, indices, &dflow);
|
flow_equation_derivx(tmpflow, indices, &dflow);
|
||||||
// free
|
// free tmpflow
|
||||||
free_Grouped_Polynomial(tmpflow);
|
free_Grouped_Polynomial(tmpflow);
|
||||||
|
|
||||||
// add the derived indices as variables for the next derivative
|
// add the derived indices as variables for the next derivative
|
||||||
|
@ -212,6 +212,7 @@ typedef struct Meantools_Options{
|
|||||||
int deriv_derivs;
|
int deriv_derivs;
|
||||||
Int_Array deriv_vars;
|
Int_Array deriv_vars;
|
||||||
Char_Array eval_rccstring;
|
Char_Array eval_rccstring;
|
||||||
|
int chain;
|
||||||
} Meantools_Options;
|
} Meantools_Options;
|
||||||
|
|
||||||
typedef struct Kondopp_Options{
|
typedef struct Kondopp_Options{
|
||||||
|
Loading…
Reference in New Issue
Block a user