/* 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. 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. */ /* typedefs used by meankondo */ #ifndef TYPES_H #define TYPES_H #include // rational number typedef struct Q{ #ifndef RATIONAL_AS_FLOAT long int numerator; long int denominator; #else long double numerator; long double denominator; #endif } Q; // numbers typedef struct Number{ Q* scalars; int* base; int length; int memory; } Number; // matrix typedef struct Number_Matrix{ Number** matrix; int* indices; int length; } Number_Matrix; // list of integers typedef struct Int_Array{ int* values; int length; int memory; } Int_Array; // string typedef struct Char_Array{ char* str; int length; int memory; } Char_Array; // string array typedef struct Str_Array{ Char_Array* strs; int length; int memory; } Str_Array; // tree typedef struct Tree Tree; struct Tree{ Char_Array root_label; Tree* children; int length; int memory; }; // polynomial typedef struct Polynomial{ Int_Array* monomials; Int_Array* factors; Number* nums; int length; int memory; } Polynomial; // matrix of polynomial typedef struct Polynomial_Matrix{ Polynomial** matrix; int* indices; int length; } Polynomial_Matrix; // denominators in coefficients (index of the denominator and the power to which it is raised) typedef struct coef_denom{ int index; int power; } coef_denom; // coefficient typedef struct Coefficient{ Int_Array* factors; Number* nums; coef_denom* denoms; int length; int memory; } Coefficient; // grouped polynomial typedef struct Grouped_Polynomial{ Coefficient* coefs; int* indices; int length; int memory; } Grouped_Polynomial; // rcc typedef struct RCC{ long double* values; int* indices; int length; } RCC; // rcc using mpfr floats typedef struct RCC_mpfr{ mpfr_t* values; int* indices; int length; } RCC_mpfr; // identities between fields typedef struct Identities{ // left hand sides Int_Array* lhs; // right hand sides Polynomial* rhs; int length; int memory; } Identities; // virtual_fields typedef struct Virtual_fields{ int* indices; Polynomial* expr; int length; int memory; } Virtual_fields; // variables used in symbolic expressions typedef struct Variables{ Char_Array* var_names; Tree* symbol_trees; int length; int memory; } Variables; // groups of independent fields typedef struct Groups{ Int_Array* indices; int length; int memory; } Groups; // collection of fields typedef struct Fields_Table{ // constant parameters Int_Array parameter; // anticommuting external fields Int_Array external; // anticommuting internal fields Int_Array internal; // identities between fields Identities ids; // symbolic expressions (commuting) Virtual_fields virtual_fields; // list of anti-commuting variables Int_Array fermions; // list of non-commuting variables Int_Array noncommuting; } Fields_Table; // index labels typedef struct Labels{ Char_Array* labels; int* indices; int length; int memory; } Labels; // id table typedef struct Id_Table{ int* indices; Polynomial* polynomials; int length; int memory; } Id_Table; // command line options typedef struct Meankondo_Options{ int threads; int chain; int print_progress; int group_poly; } Meankondo_Options; typedef struct Numkondo_Options{ int display_mode; int niter; Char_Array eval_rccstring; mpfr_prec_t mpfr_prec; mpfr_exp_t mpfr_emax; } Numkondo_Options; typedef struct Meantools_Options{ int command; int deriv_derivs; Int_Array deriv_vars; Char_Array eval_rccstring; int chain; Char_Array namespace; mpfr_prec_t mpfr_prec; mpfr_exp_t mpfr_emax; } Meantools_Options; typedef struct Kondopp_Options{ int dimension; } Kondopp_Options; #endif