File indexing completed on 2026-11-07 10:15:09
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef CA_TYPES_H
0013 #define CA_TYPES_H
0014
0015 #include "gr_types.h"
0016 #include "fmpz_types.h"
0017 #include "fmpz_mpoly.h" /* FIXME: Move fmpz_mpoly_vec_struct to fmpz_types? */
0018 #include "qqbar.h" /* FIXME: Would be nice to remove */
0019 #include "nf_elem.h" /* FIXME: Would be nice to remove */
0020
0021 #ifdef __cplusplus
0022 extern "C" {
0023 #endif
0024
0025
0026
0027 #ifndef calcium_stream_struct
0028 # define calcium_stream_struct gr_stream_struct
0029 # define calcium_stream_t gr_stream_t
0030 #endif
0031
0032
0033
0034 typedef enum
0035 {
0036
0037 CA_QQBar,
0038
0039 CA_Neg,
0040 CA_Add,
0041 CA_Sub,
0042 CA_Mul,
0043 CA_Div,
0044
0045 CA_Sqrt,
0046 CA_Cbrt,
0047 CA_Root,
0048
0049 CA_Floor,
0050 CA_Ceil,
0051 CA_Abs,
0052 CA_Sign,
0053 CA_Re,
0054 CA_Im,
0055 CA_Arg,
0056 CA_Conjugate,
0057
0058 CA_Pi,
0059
0060 CA_Sin,
0061 CA_Cos,
0062 CA_Exp,
0063 CA_Log,
0064 CA_Pow,
0065 CA_Tan,
0066 CA_Cot,
0067 CA_Cosh,
0068 CA_Sinh,
0069 CA_Tanh,
0070 CA_Coth,
0071 CA_Atan,
0072 CA_Acos,
0073 CA_Asin,
0074 CA_Acot,
0075 CA_Atanh,
0076 CA_Acosh,
0077 CA_Asinh,
0078 CA_Acoth,
0079
0080 CA_Euler,
0081
0082 CA_Gamma,
0083 CA_LogGamma,
0084 CA_Psi,
0085 CA_Erf,
0086 CA_Erfc,
0087 CA_Erfi,
0088 CA_RiemannZeta,
0089 CA_HurwitzZeta,
0090 CA_FUNC_CODE_LENGTH
0091 } calcium_func_code;
0092
0093
0094
0095 typedef union
0096 {
0097 fmpq q;
0098 nf_elem_struct nf;
0099 fmpz_mpoly_q_struct * mpoly_q;
0100 }
0101 ca_elem_struct;
0102
0103 typedef struct
0104 {
0105 ulong field;
0106 ca_elem_struct elem;
0107 }
0108 ca_struct;
0109
0110 typedef ca_struct ca_t[1];
0111 typedef ca_struct * ca_ptr;
0112 typedef const ca_struct * ca_srcptr;
0113
0114
0115
0116 typedef struct
0117 {
0118 qqbar_struct x;
0119 nf_struct * nf;
0120 }
0121 ca_ext_qqbar;
0122
0123 typedef struct
0124 {
0125 ca_struct * args;
0126 slong nargs;
0127 acb_struct enclosure;
0128 slong prec;
0129 qqbar_struct * qqbar;
0130 }
0131 ca_ext_func_data;
0132
0133 typedef struct
0134 {
0135 calcium_func_code head;
0136 ulong hash;
0137 slong depth;
0138 union {
0139 ca_ext_qqbar qqbar;
0140 ca_ext_func_data func_data;
0141 } data;
0142 } ca_ext_struct;
0143
0144 typedef ca_ext_struct ca_ext_t[1];
0145 typedef ca_ext_struct * ca_ext_ptr;
0146 typedef const ca_ext_struct * ca_ext_srcptr;
0147
0148 typedef struct
0149 {
0150 ca_ext_struct ** items;
0151 slong length;
0152 slong alloc;
0153
0154 slong hash_size;
0155 slong * hash_table;
0156 }
0157 ca_ext_cache_struct;
0158
0159 typedef ca_ext_cache_struct ca_ext_cache_t[1];
0160
0161
0162
0163 typedef struct
0164 {
0165 slong length;
0166 ca_ext_struct ** ext;
0167 fmpz_mpoly_vec_struct ideal;
0168 ulong hash;
0169 }
0170 ca_field_struct;
0171
0172 typedef ca_field_struct ca_field_t[1];
0173 typedef ca_field_struct * ca_field_ptr;
0174 typedef const ca_field_struct * ca_field_srcptr;
0175
0176 typedef struct
0177 {
0178 ca_field_struct ** items;
0179 slong length;
0180 slong alloc;
0181
0182 slong hash_size;
0183 slong * hash_table;
0184 }
0185 ca_field_cache_struct;
0186
0187 typedef ca_field_cache_struct ca_field_cache_t[1];
0188
0189
0190
0191 typedef struct
0192 {
0193 ca_ext_cache_struct ext_cache;
0194 ca_field_cache_struct field_cache;
0195 ca_field_struct * field_qq;
0196 ca_field_struct * field_qq_i;
0197 fmpz_mpoly_ctx_struct ** mctx;
0198 slong mctx_len;
0199 slong * options;
0200 }
0201 ca_ctx_struct;
0202
0203 typedef ca_ctx_struct ca_ctx_t[1];
0204
0205
0206
0207 typedef struct
0208 {
0209 ca_ptr base;
0210 ca_ptr exp;
0211 slong length;
0212 slong alloc;
0213 }
0214 ca_factor_struct;
0215
0216 typedef ca_factor_struct ca_factor_t[1];
0217
0218
0219
0220 typedef struct
0221 {
0222 ca_ptr entries;
0223 slong alloc;
0224 slong length;
0225 }
0226 ca_vec_struct;
0227
0228 typedef ca_vec_struct ca_vec_t[1];
0229
0230
0231
0232 typedef struct
0233 {
0234 ca_ptr entries;
0235 slong r;
0236 slong c;
0237 slong stride;
0238 }
0239 ca_mat_struct;
0240
0241 typedef ca_mat_struct ca_mat_t[1];
0242
0243
0244
0245 typedef struct
0246 {
0247 ca_struct * coeffs;
0248 slong alloc;
0249 slong length;
0250 }
0251 ca_poly_struct;
0252
0253 typedef ca_poly_struct ca_poly_t[1];
0254
0255 #ifdef __cplusplus
0256 }
0257 #endif
0258
0259 #endif