diff options
author | Ian Jauslin <ian@jauslin.org> | 2022-06-14 09:26:07 +0200 |
---|---|---|
committer | Ian Jauslin <ian@jauslin.org> | 2022-06-14 09:46:36 +0200 |
commit | 3f0510629e422e979b57d3f93791937912a4183a (patch) | |
tree | bf2589b2689044261b0cd4d9e6b3082194fdd9e9 /src/meantools_exp.c | |
parent | 469bdc80712dbf9c12562059dc4594620b59a076 (diff) |
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/meantools_exp.c')
-rw-r--r-- | src/meantools_exp.c | 130 |
1 files changed, 0 insertions, 130 deletions
diff --git a/src/meantools_exp.c b/src/meantools_exp.c deleted file mode 100644 index 1aca928..0000000 --- a/src/meantools_exp.c +++ /dev/null @@ -1,130 +0,0 @@ -/* -Copyright 2015 Ian Jauslin - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -#include "meantools_exp.h" - -#include <stdio.h> -#include <stdlib.h> -#include "parse_file.h" -#include "cli_parser.h" -#include "polynomial.h" -#include "fields.h" -#include "grouped_polynomial.h" -#include "idtable.h" - -// read command line arguments -int tool_exp_read_args(int argc, const char* argv[], Str_Array* str_args){ - // file to read the polynomial from in flow mode - const char* file=""; - // whether a file was specified on the command-line - int exists_file=0; - - if(argc>=3){ - file=argv[2]; - exists_file=1; - } - read_config_file(str_args, file, 1-exists_file); - - return(0); -} - - -// compute the exponential of the input polynomial -int tool_exp(Str_Array str_args){ - // index of the entry in the input file - int arg_index; - // list of fields - Fields_Table fields; - // input polynomial - Polynomial poly; - // exp as a polynomial - Polynomial exp_poly; - // list of rccs - Id_Table idtable; - // exp - Grouped_Polynomial exp; - int i,j; - - // parse fields - arg_index=find_str_arg("fields", str_args); - if(arg_index<0){ - fprintf(stderr,"error: no fields entry in the configuration file\n"); - exit(-1); - } - else{ - parse_input_fields(str_args.strs[arg_index],&fields); - } - - // parse id table - arg_index=find_str_arg("id_table", str_args); - if(arg_index<0){ - fprintf(stderr,"error: no id table entry in the configuration file\n"); - exit(-1); - } - else{ - parse_input_id_table(str_args.strs[arg_index],&idtable, fields); - } - - // parse input polynomial - arg_index=find_str_arg("input_polynomial", str_args); - if(arg_index>=0){ - parse_input_polynomial(str_args.strs[arg_index],&poly, fields); - } - else{ - fprintf(stderr,"error: no input polynomial entry in the configuration file\n"); - exit(-1); - } - - // parse symbols - arg_index=find_str_arg("symbols", str_args); - if(arg_index>=0){ - parse_input_symbols(str_args.strs[arg_index],&fields); - } - else{ - init_Symbols(&(fields.symbols),1); - } - - // parse identities - arg_index=find_str_arg("identities", str_args); - if(arg_index>=0){ - parse_input_identities(str_args.strs[arg_index],&fields); - } - else{ - init_Identities(&(fields.ids),1); - } - - // exp(V) - polynomial_exponential(poly,&exp_poly, fields); - // grouped representation - group_polynomial(exp_poly, &exp, idtable, fields); - free_Polynomial(exp_poly); - free_Polynomial(poly); - - // no denominators - for(i=0;i<exp.length;i++){ - for(j=0;j<exp.coefs[i].length;j++){ - exp.coefs[i].denoms[j].power=0; - } - } - - grouped_polynomial_print(exp,'%','%'); - - // free memory - free_Fields_Table(fields); - free_Id_Table(idtable); - free_Grouped_Polynomial(exp); - return(0); -} |