diff options
author | Ian Jauslin <ian.jauslin@roma1.infn.it> | 2015-06-14 00:52:45 +0000 |
---|---|---|
committer | Ian Jauslin <ian.jauslin@roma1.infn.it> | 2015-06-14 00:52:45 +0000 |
commit | aa0f3ae2988d372b190b9bde2e75a6d17e744e93 (patch) | |
tree | 14482245c2fca27fcdad3078e97d0871352d52a7 /src/types.h |
Initial commitv1.2
Diffstat (limited to 'src/types.h')
-rw-r--r-- | src/types.h | 219 |
1 files changed, 219 insertions, 0 deletions
diff --git a/src/types.h b/src/types.h new file mode 100644 index 0000000..0452ebc --- /dev/null +++ b/src/types.h @@ -0,0 +1,219 @@ +/* +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. +*/ + +/* + typedefs used by meankondo +*/ + +#ifndef TYPES_H +#define TYPES_H + + +// 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; + +// 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; + +// identities between fields +typedef struct Identities{ + // left hand sides + Int_Array* lhs; + // right hand sides + Polynomial* rhs; + int length; + int memory; +} Identities; + +// symbolic expressions +typedef struct Symbols{ + int* indices; + Polynomial* expr; + int length; + int memory; +} Symbols; + +// 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) + Symbols symbols; + // list of anti-commuting variables (fields or symbols) + Int_Array fermions; +} 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; + +/* +// polynomial scalar and vectors +typedef struct Polynomial_Scalar{ + Coefficient coef; + int* indices; + int length; +} Polynomial_Scalar; +typedef struct Polynomial_Vector{ + Coefficient* coefv; + int* indices; + int length; +} Polynomial_Vector; +typedef struct Polynomial_Matrix{ + Coefficient** coefm; + int* indices; + int length; +} Polynomial_Matrix; +*/ + + +// command line options +typedef struct Meankondo_Options{ + int threads; + int chain; +} Meankondo_Options; + +typedef struct Numkondo_Options{ + int display_mode; + int niter; + long double tol; + Char_Array eval_rccstring; +} Numkondo_Options; + +typedef struct Meantools_Options{ + int command; + int deriv_derivs; + Int_Array deriv_vars; + Char_Array eval_rccstring; +} Meantools_Options; + +typedef struct Kondopp_Options{ + int dimension; +} Kondopp_Options; + +#endif |