[35aab3] | 1 | #ifndef STRUCTS_H |
---|
| 2 | #define STRUCTS_H |
---|
| 3 | /**************************************** |
---|
| 4 | * Computer Algebra System SINGULAR * |
---|
| 5 | ****************************************/ |
---|
[1e579c6] | 6 | /* $Id: structs.h,v 1.39 2007-06-20 09:39:25 wienand Exp $ */ |
---|
[35aab3] | 7 | /* |
---|
| 8 | * ABSTRACT |
---|
| 9 | */ |
---|
| 10 | |
---|
| 11 | #include <string.h> /* for memset */ |
---|
| 12 | |
---|
[994445] | 13 | #ifndef NATNUMBER |
---|
| 14 | #define NATNUMBER unsigned long |
---|
| 15 | #endif |
---|
| 16 | |
---|
[35aab3] | 17 | /* standard types */ |
---|
[de7394] | 18 | typedef unsigned char uchar; |
---|
[35aab3] | 19 | typedef unsigned short CARDINAL; |
---|
[de7394] | 20 | #if (SIZEOF_LONG == 8) |
---|
| 21 | typedef int BOOLEAN; |
---|
| 22 | /* testet on x86_64, gcc 3.4.6: 2 % */ |
---|
| 23 | /* testet on IA64, gcc 3.4.6: 1 % */ |
---|
| 24 | #else |
---|
| 25 | /* testet on athlon, gcc 2.95.4: 1 % */ |
---|
[35aab3] | 26 | typedef short BOOLEAN; |
---|
[de7394] | 27 | #endif |
---|
[35aab3] | 28 | |
---|
| 29 | typedef void * Sy_reference; |
---|
| 30 | #define ADDRESS Sy_reference |
---|
| 31 | #define BITSET unsigned int |
---|
| 32 | |
---|
| 33 | /* EXPONENT_TYPE is determined by configure und defined in mod2.h */ |
---|
| 34 | /* the following defines should really go into mod2.h, |
---|
| 35 | but configure dislikes it */ |
---|
| 36 | |
---|
[445e55] | 37 | #define HAVE_IDI 1 |
---|
[35aab3] | 38 | |
---|
[b0d6b6] | 39 | #if defined(i386) || defined(x86_64_Linux) || defined(ix86_SunOS) |
---|
[cdde7d] | 40 | // the following settings seems to be better on i386 and x86_64 processors |
---|
| 41 | // define if a*b is with mod instead of tables |
---|
| 42 | #define HAVE_MULT_MOD |
---|
| 43 | // #define HAVE_GENERIC_ADD |
---|
| 44 | // #ifdef HAVE_MULT_MOD |
---|
| 45 | // #define HAVE_DIV_MOD |
---|
| 46 | // #endif |
---|
| 47 | #elif defined(IA64_Linux) |
---|
| 48 | // the following settings seems to be better on itanium processors |
---|
| 49 | // #define HAVE_MULT_MOD |
---|
| 50 | #define HAVE_GENERIC_ADD |
---|
| 51 | // #ifdef HAVE_MULT_MOD |
---|
| 52 | // #define HAVE_DIV_MOD |
---|
| 53 | // #endif |
---|
| 54 | #elif defined(SunOS_5) |
---|
| 55 | // #define HAVE_GENERIC_ADD |
---|
| 56 | #define HAVE_MULT_MOD |
---|
| 57 | #ifdef HAVE_MULT_MOD |
---|
| 58 | #define HAVE_DIV_MOD |
---|
| 59 | #endif |
---|
| 60 | #elif defined(ppc_Linux) || defined(ppcMac_darwin) |
---|
| 61 | // the following settings seems to be better on ppc processors |
---|
| 62 | // testet on: ppc_Linux, 740/750 PowerMac G3, 512k L2 cache |
---|
| 63 | #define HAVE_MULT_MOD |
---|
| 64 | // #ifdef HAVE_MULT_MOD |
---|
| 65 | // #define HAVE_DIV_MOD |
---|
| 66 | // #endif |
---|
[8ddce42] | 67 | #endif |
---|
| 68 | |
---|
[fc5095] | 69 | #if SIZEOF_LONG == 4 |
---|
| 70 | typedef long long int64; |
---|
| 71 | #elif SIZEOF_LONG == 8 |
---|
| 72 | typedef long int64; |
---|
| 73 | #else |
---|
[5a9e7b] | 74 | #error int64 undefined |
---|
[fc5095] | 75 | #endif |
---|
| 76 | |
---|
| 77 | |
---|
[35aab3] | 78 | typedef long Exponent_t; |
---|
| 79 | typedef long Order_t; |
---|
| 80 | |
---|
| 81 | enum tHomog |
---|
| 82 | { |
---|
| 83 | isNotHomog = FALSE, |
---|
| 84 | isHomog = TRUE, |
---|
| 85 | testHomog |
---|
| 86 | }; |
---|
| 87 | enum noeof_t |
---|
| 88 | { |
---|
| 89 | noeof_brace = 1, |
---|
| 90 | noeof_asstring, |
---|
| 91 | noeof_block, |
---|
| 92 | noeof_bracket, |
---|
| 93 | noeof_comment, |
---|
| 94 | noeof_procname, |
---|
| 95 | noeof_string |
---|
| 96 | }; |
---|
| 97 | |
---|
| 98 | enum n_coeffType |
---|
| 99 | { |
---|
| 100 | n_unknown=0, |
---|
| 101 | n_Zp, |
---|
| 102 | n_Q, |
---|
| 103 | n_R, |
---|
| 104 | n_GF, |
---|
| 105 | n_long_R, |
---|
| 106 | n_Zp_a, |
---|
| 107 | n_Q_a, |
---|
| 108 | n_long_C |
---|
| 109 | }; |
---|
| 110 | |
---|
[5a9e7b] | 111 | // #ifdef HAVE_PLURAL |
---|
[35aab3] | 112 | enum nc_type |
---|
| 113 | { |
---|
[5a9e7b] | 114 | nc_error = -1, // Something's gone wrong! |
---|
| 115 | nc_general = 0, /* yx=q xy+... */ |
---|
[35aab3] | 116 | nc_skew, /*1*/ /* yx=q xy */ |
---|
[6c0f53] | 117 | nc_comm, /*2*/ /* yx= xy */ |
---|
| 118 | nc_lie, /*3*/ /* yx=xy+... */ |
---|
[5a9e7b] | 119 | nc_undef, /*4*/ /* for internal reasons */ |
---|
| 120 | |
---|
| 121 | nc_exterior /*5*/ // Exterior Algebra(SCA): yx= -xy & (!:) x^2 = 0 |
---|
[35aab3] | 122 | }; |
---|
[5a9e7b] | 123 | // #endif |
---|
[35aab3] | 124 | |
---|
[1ea9a7] | 125 | typedef enum { LT_NONE, LT_NOTFOUND, LT_SINGULAR, LT_ELF, LT_HPUX, LT_MACH_O} lib_types; |
---|
[35aab3] | 126 | |
---|
| 127 | /* C++-part */ |
---|
| 128 | #ifdef __cplusplus |
---|
| 129 | class ip_smatrix; |
---|
| 130 | class idrec; |
---|
| 131 | class intvec; |
---|
| 132 | class sleftv; |
---|
| 133 | class slists; |
---|
| 134 | class sattr; |
---|
| 135 | class skStrategy; |
---|
| 136 | class ssyStrategy; |
---|
| 137 | class procinfo; |
---|
| 138 | class namerec; |
---|
| 139 | class kBucket; |
---|
| 140 | class sBucket; |
---|
| 141 | #endif |
---|
| 142 | |
---|
| 143 | struct n_Procs_s; |
---|
| 144 | struct sip_sring; |
---|
| 145 | struct sip_sideal; |
---|
| 146 | struct sip_link; |
---|
| 147 | struct spolynom; |
---|
| 148 | struct _ssubexpr; |
---|
| 149 | struct _sssym; |
---|
| 150 | struct snumber; |
---|
| 151 | struct sip_command; |
---|
| 152 | struct sip_package; |
---|
| 153 | struct s_si_link_extension; |
---|
| 154 | |
---|
| 155 | typedef struct n_Procs_s n_Procs_s; |
---|
| 156 | |
---|
[5a9e7b] | 157 | // #ifdef HAVE_PLURAL |
---|
[35aab3] | 158 | struct nc_struct; |
---|
| 159 | typedef struct nc_struct nc_struct; |
---|
[5a9e7b] | 160 | // #endif |
---|
[35aab3] | 161 | |
---|
| 162 | typedef struct _ssubexpr sSubexpr; |
---|
| 163 | typedef struct _sssym ssym; |
---|
| 164 | typedef struct spolyrec polyrec; |
---|
| 165 | typedef struct sip_sideal ip_sideal; |
---|
| 166 | typedef struct sip_smap ip_smap; |
---|
| 167 | typedef struct sip_sring ip_sring; |
---|
| 168 | typedef struct sip_link ip_link; |
---|
| 169 | typedef struct sip_command ip_command; |
---|
| 170 | typedef struct sip_package ip_package; |
---|
| 171 | |
---|
| 172 | /* the pointer types */ |
---|
| 173 | typedef char * char_ptr; |
---|
| 174 | typedef int * int_ptr; |
---|
| 175 | typedef short * short_ptr; |
---|
| 176 | typedef void * void_ptr; |
---|
| 177 | typedef ip_sring * ring; |
---|
| 178 | typedef int idtyp; |
---|
| 179 | typedef struct snumber * number; |
---|
| 180 | typedef polyrec * poly; |
---|
| 181 | typedef poly * polyset; |
---|
| 182 | typedef ip_sideal * ideal; |
---|
[45b750f] | 183 | typedef ip_smap * map; |
---|
[35aab3] | 184 | typedef struct sideal_list * ideal_list; |
---|
| 185 | typedef ideal * resolvente; |
---|
| 186 | typedef union uutypes utypes; |
---|
| 187 | typedef ip_command * command; |
---|
| 188 | typedef struct s_si_link_extension *si_link_extension; |
---|
| 189 | typedef polyrec * napoly; |
---|
| 190 | |
---|
| 191 | #ifdef __cplusplus |
---|
| 192 | typedef idrec * idhdl; |
---|
| 193 | typedef ip_smatrix * matrix; |
---|
| 194 | typedef ip_link * si_link; |
---|
| 195 | typedef sleftv * leftv; |
---|
| 196 | typedef slists * lists; |
---|
| 197 | typedef sSubexpr * Subexpr; |
---|
| 198 | typedef sattr * attr; |
---|
| 199 | typedef skStrategy * kStrategy; |
---|
| 200 | typedef ip_package * package; |
---|
| 201 | typedef ssyStrategy * syStrategy; |
---|
| 202 | typedef procinfo * procinfov; |
---|
| 203 | typedef namerec * namehdl; |
---|
| 204 | typedef kBucket* kBucket_pt; |
---|
| 205 | typedef sBucket* sBucket_pt; |
---|
| 206 | typedef struct p_Procs_s p_Procs_s; |
---|
| 207 | |
---|
| 208 | // for hdegree.cc |
---|
| 209 | typedef struct sindlist indlist; |
---|
| 210 | typedef indlist * indset; |
---|
| 211 | struct sindlist |
---|
| 212 | { |
---|
| 213 | indset nx; |
---|
| 214 | intvec * set; |
---|
| 215 | }; |
---|
| 216 | |
---|
| 217 | // for longalg.cc |
---|
| 218 | struct snaIdeal |
---|
| 219 | { |
---|
| 220 | int anz; |
---|
| 221 | napoly *liste; |
---|
| 222 | }; |
---|
| 223 | typedef struct snaIdeal * naIdeal; |
---|
| 224 | |
---|
| 225 | |
---|
| 226 | // for sparsemat.cc |
---|
| 227 | typedef struct smprec sm_prec; |
---|
| 228 | typedef sm_prec * smpoly; |
---|
| 229 | struct smprec |
---|
| 230 | { |
---|
| 231 | smpoly n; // the next element |
---|
| 232 | int pos; // position |
---|
| 233 | int e; // level |
---|
| 234 | poly m; // the element |
---|
| 235 | float f; // complexity of the element |
---|
| 236 | }; |
---|
| 237 | |
---|
| 238 | struct _scmdnames |
---|
| 239 | { |
---|
| 240 | char *name; |
---|
| 241 | short alias; |
---|
| 242 | short tokval; |
---|
| 243 | short toktype; |
---|
| 244 | }; |
---|
| 245 | typedef struct _scmdnames cmdnames; |
---|
| 246 | |
---|
| 247 | typedef number (*numberfunc)(number a,number b); |
---|
| 248 | typedef number (*nMapFunc)(number a); |
---|
| 249 | struct n_Procs_s |
---|
| 250 | { |
---|
| 251 | n_Procs_s* next; |
---|
| 252 | // the union stuff |
---|
| 253 | // Zp: |
---|
| 254 | int npPrimeM; |
---|
| 255 | int npPminus1M; |
---|
| 256 | #ifdef HAVE_DIV_MOD |
---|
| 257 | CARDINAL *npInvTable; |
---|
| 258 | #endif |
---|
| 259 | #if !defined(HAVE_DIV_MOD) || !defined(HAVE_MULT_MOD) |
---|
| 260 | CARDINAL *npExpTable; |
---|
| 261 | CARDINAL *npLogTable; |
---|
| 262 | #endif |
---|
| 263 | // Zp_a, Q_a |
---|
| 264 | |
---|
| 265 | // general stuff |
---|
| 266 | numberfunc nMult, nSub ,nAdd ,nDiv, nIntDiv, nIntMod, nExactDiv; |
---|
| 267 | void (*nNew)(number * a); |
---|
| 268 | number (*nInit)(int i); |
---|
| 269 | number (*nPar)(int i); |
---|
| 270 | int (*nParDeg)(number n); |
---|
| 271 | int (*nSize)(number n); |
---|
| 272 | int (*nInt)(number &n); |
---|
[206e158] | 273 | #ifdef HAVE_RINGS |
---|
| 274 | int (*nComp)(number a,number b); |
---|
[1e579c6] | 275 | BOOLEAN (*nIsUnit)(number a); |
---|
| 276 | number (*nGetUnit)(number a); |
---|
| 277 | number (*nExtGcd)(number a, number b, number *s, number *t); |
---|
[206e158] | 278 | #endif |
---|
[35aab3] | 279 | number (*nNeg)(number a); |
---|
| 280 | number (*nInvers)(number a); |
---|
| 281 | number (*nCopy)(number a); |
---|
| 282 | number (*cfCopy)(number a, const ring r); |
---|
| 283 | number (*nRePart)(number a); |
---|
| 284 | number (*nImPart)(number a); |
---|
| 285 | void (*nWrite)(number &a); |
---|
| 286 | char * (*nRead)(char * s, number * a); |
---|
| 287 | void (*nNormalize)(number &a); |
---|
| 288 | BOOLEAN (*nGreater)(number a,number b), |
---|
[009d80] | 289 | #ifdef HAVE_RINGS |
---|
| 290 | (*nDivBy)(number a, number b), |
---|
| 291 | #endif |
---|
[35aab3] | 292 | (*nEqual)(number a,number b), |
---|
| 293 | (*nIsZero)(number a), |
---|
| 294 | (*nIsOne)(number a), |
---|
| 295 | (*nIsMOne)(number a), |
---|
| 296 | (*nGreaterZero)(number a); |
---|
| 297 | void (*nPower)(number a, int i, number * result); |
---|
| 298 | number (*n_GetDenom)(number &n, const ring r); |
---|
| 299 | number (*nGcd)(number a, number b, const ring r); |
---|
| 300 | number (*nLcm)(number a, number b, const ring r); |
---|
| 301 | void (*cfDelete)(number * a, const ring r); |
---|
| 302 | nMapFunc (*cfSetMap)(ring src, ring dst); |
---|
| 303 | char * (*nName)(number n); |
---|
| 304 | void (*nInpMult)(number &a, number b, ring r); |
---|
[3332cc6] | 305 | #ifdef LDEBUG |
---|
| 306 | BOOLEAN (*nDBTest)(number a, char *f,int l); |
---|
| 307 | #endif |
---|
[35aab3] | 308 | //extern number (*nMap)(number from); |
---|
| 309 | |
---|
| 310 | number nNULL; /* the 0 as constant */ |
---|
| 311 | int char_flag; |
---|
| 312 | int ref; |
---|
| 313 | short nChar; |
---|
| 314 | n_coeffType type; |
---|
| 315 | }; |
---|
| 316 | /* current ring stuff */ |
---|
| 317 | |
---|
| 318 | extern ring currRing; |
---|
| 319 | extern ideal currQuotient; |
---|
| 320 | extern idhdl currRingHdl; |
---|
| 321 | |
---|
| 322 | #ifndef HAVE_NS |
---|
| 323 | extern idhdl idroot; |
---|
| 324 | #define IDROOT idroot |
---|
| 325 | #endif /* ! HAVE_NS */ |
---|
| 326 | |
---|
| 327 | #ifdef HAVE_NS |
---|
| 328 | extern idhdl currPackHdl; |
---|
| 329 | extern idhdl basePackHdl; |
---|
| 330 | extern package currPack; |
---|
| 331 | extern package basePack; |
---|
| 332 | #define IDROOT (currPack->idroot) |
---|
| 333 | #endif /* HAVE_NS */ |
---|
| 334 | |
---|
| 335 | /* the function pointer types */ |
---|
| 336 | |
---|
[b130fb] | 337 | typedef long (*pLDegProc)(poly p, int *length, ring r); |
---|
| 338 | typedef long (*pFDegProc)(poly p, ring r); |
---|
[33c36d] | 339 | typedef void (*p_SetmProc)(poly p, const ring r); |
---|
[35aab3] | 340 | |
---|
| 341 | typedef enum |
---|
| 342 | { |
---|
| 343 | ro_dp, // ordering is a degree ordering |
---|
| 344 | ro_wp, // ordering is a weighted degree ordering |
---|
[fc5095] | 345 | ro_wp64, // ordering is a weighted64 degree ordering |
---|
[35aab3] | 346 | ro_wp_neg, // ordering is a weighted degree ordering |
---|
| 347 | // with possibly negative weights |
---|
| 348 | ro_cp, // ordering duplicates variables |
---|
| 349 | ro_syzcomp, // ordering indicates "subset" of component number |
---|
| 350 | ro_syz, // ordering with component number >syzcomp is lower |
---|
| 351 | ro_none |
---|
| 352 | } |
---|
| 353 | ro_typ; |
---|
| 354 | |
---|
| 355 | // ordering is a degree ordering |
---|
| 356 | struct sro_dp |
---|
| 357 | { |
---|
| 358 | short place; // where degree is stored (in L): |
---|
| 359 | short start; // bounds of ordering (in E): |
---|
| 360 | short end; |
---|
| 361 | }; |
---|
| 362 | typedef struct sro_dp sro_dp; |
---|
| 363 | |
---|
| 364 | // ordering is a weighted degree ordering |
---|
| 365 | struct sro_wp |
---|
| 366 | { |
---|
| 367 | short place; // where weighted degree is stored (in L) |
---|
| 368 | short start; // bounds of ordering (in E) |
---|
| 369 | short end; |
---|
| 370 | int *weights; // pointers into wvhdl field |
---|
| 371 | }; |
---|
| 372 | typedef struct sro_wp sro_wp; |
---|
| 373 | |
---|
[fc5095] | 374 | // ordering is a weighted degree ordering |
---|
| 375 | struct sro_wp64 |
---|
| 376 | { |
---|
| 377 | short place; // where weighted degree is stored (in L) |
---|
| 378 | short start; // bounds of ordering (in E) |
---|
| 379 | short end; |
---|
| 380 | int64 *weights64; // pointers into wvhdl field |
---|
| 381 | }; |
---|
| 382 | typedef struct sro_wp64 sro_wp64; |
---|
| 383 | |
---|
[35aab3] | 384 | // ordering duplicates variables |
---|
| 385 | struct sro_cp |
---|
| 386 | { |
---|
| 387 | short place; // where start is copied to (in E) |
---|
| 388 | short start; // bounds of sources of copied variables (in E) |
---|
| 389 | short end; |
---|
| 390 | }; |
---|
| 391 | typedef struct sro_cp sro_cp; |
---|
| 392 | |
---|
| 393 | // ordering indicates "subset" of component number |
---|
| 394 | struct sro_syzcomp |
---|
| 395 | { |
---|
| 396 | short place; // where the index is stored (in L) |
---|
| 397 | long *ShiftedComponents; // pointer into index field |
---|
| 398 | int* Components; |
---|
| 399 | #ifdef PDEBUG |
---|
| 400 | long length; |
---|
| 401 | #endif |
---|
| 402 | }; |
---|
| 403 | typedef struct sro_syzcomp sro_syzcomp; |
---|
| 404 | |
---|
| 405 | // ordering with component number >syzcomp is lower |
---|
| 406 | struct sro_syz |
---|
| 407 | { |
---|
| 408 | short place; // where the index is stored (in L) |
---|
| 409 | int limit; // syzcomp |
---|
| 410 | int* syz_index; // mapping Component -> SyzIndex for Comp <= limit |
---|
| 411 | int curr_index; // SyzIndex for Component > limit |
---|
| 412 | }; |
---|
| 413 | |
---|
| 414 | typedef struct sro_syz sro_syz; |
---|
| 415 | |
---|
| 416 | #ifndef OM_ALLOC_H |
---|
| 417 | struct omBin_s; |
---|
| 418 | #endif |
---|
| 419 | |
---|
| 420 | struct sro_ord |
---|
| 421 | { |
---|
| 422 | ro_typ ord_typ; |
---|
| 423 | int order_index; // comes from r->order[order_index] |
---|
| 424 | union |
---|
| 425 | { |
---|
| 426 | sro_dp dp; |
---|
| 427 | sro_wp wp; |
---|
[fc5095] | 428 | sro_wp64 wp64; |
---|
[35aab3] | 429 | sro_cp cp; |
---|
| 430 | sro_syzcomp syzcomp; |
---|
| 431 | sro_syz syz; |
---|
| 432 | } data; |
---|
| 433 | }; |
---|
| 434 | |
---|
[1daae71] | 435 | #ifdef HAVE_PLURAL |
---|
[5a9e7b] | 436 | // NC pProcs: |
---|
[d5f9aea] | 437 | typedef poly (*mm_Mult_p_Proc_Ptr)(const poly m, poly p, const ring r); |
---|
| 438 | typedef poly (*mm_Mult_pp_Proc_Ptr)(const poly m, const poly p, const ring r); |
---|
[5a9e7b] | 439 | |
---|
[d5f9aea] | 440 | typedef ideal (*GB_Proc_Ptr)(const ideal F, const ideal Q, const intvec *w, const intvec *hilb, kStrategy strat); |
---|
[5a9e7b] | 441 | |
---|
[d5f9aea] | 442 | typedef poly (*SPoly_Proc_Ptr)(const poly p1, const poly p2, const ring r); |
---|
| 443 | typedef poly (*SPolyReduce_Proc_Ptr)(const poly p1, poly p2, const ring r); |
---|
[5a9e7b] | 444 | |
---|
[d5f9aea] | 445 | typedef void (*bucket_Proc_Ptr)(kBucket_pt b, poly p, number *c); |
---|
[5a9e7b] | 446 | |
---|
| 447 | struct nc_pProcs |
---|
| 448 | { |
---|
| 449 | public: |
---|
| 450 | mm_Mult_p_Proc_Ptr mm_Mult_p; |
---|
| 451 | mm_Mult_pp_Proc_Ptr mm_Mult_pp; |
---|
| 452 | |
---|
[d5f9aea] | 453 | bucket_Proc_Ptr BucketPolyRed; |
---|
| 454 | bucket_Proc_Ptr BucketPolyRed_Z; |
---|
[5a9e7b] | 455 | |
---|
| 456 | SPoly_Proc_Ptr SPoly; |
---|
| 457 | SPolyReduce_Proc_Ptr ReduceSPoly; |
---|
| 458 | |
---|
| 459 | GB_Proc_Ptr GB; |
---|
| 460 | // GlobalGB, // BBA |
---|
| 461 | // LocalGB; // MORA |
---|
| 462 | }; |
---|
| 463 | |
---|
| 464 | |
---|
| 465 | struct nc_struct |
---|
| 466 | { |
---|
| 467 | short ref; |
---|
| 468 | nc_type type; |
---|
| 469 | ring basering; // the ring C,D,.. live in |
---|
| 470 | matrix C; |
---|
| 471 | matrix D; |
---|
| 472 | matrix *MT; |
---|
| 473 | matrix COM; |
---|
| 474 | int *MTsize; |
---|
| 475 | |
---|
| 476 | // IsSkewConstantindicates whethere coeffs C_ij are all equal, effective together with nc_type=nc_skew |
---|
| 477 | int IsSkewConstant; |
---|
| 478 | |
---|
| 479 | private: |
---|
| 480 | // treat variables from iAltVarsStart till iAltVarsEnd as alternating vars. |
---|
| 481 | // these variables should have odd degree, though that will not be checked |
---|
| 482 | // iAltVarsStart, iAltVarsEnd are only used together with nc_type=nc_exterior |
---|
| 483 | // 1 <= iAltVarsStart <= iAltVarsEnd <= r->N |
---|
[86016d] | 484 | unsigned int iFirstAltVar, iLastAltVar; // = 0 by default |
---|
| 485 | |
---|
| 486 | // for factors of super-commutative algebras we need |
---|
| 487 | // the part of general quotient ideal modulo squares! |
---|
| 488 | ideal idSCAQuotient; // = NULL by default. |
---|
[5a9e7b] | 489 | |
---|
| 490 | public: |
---|
| 491 | inline unsigned int& FirstAltVar() { return (iFirstAltVar); }; |
---|
| 492 | inline unsigned int& LastAltVar () { return (iLastAltVar ); }; |
---|
| 493 | |
---|
| 494 | inline unsigned int FirstAltVar() const { return (iFirstAltVar); }; |
---|
| 495 | inline unsigned int LastAltVar () const { return (iLastAltVar ); }; |
---|
| 496 | |
---|
[86016d] | 497 | inline ideal& SCAQuotient() { return (idSCAQuotient); }; |
---|
| 498 | |
---|
[5a9e7b] | 499 | public: |
---|
| 500 | nc_pProcs p_Procs; // NC procedures. |
---|
| 501 | |
---|
| 502 | }; |
---|
[1daae71] | 503 | #endif |
---|
[5a9e7b] | 504 | #if 0 |
---|
[35aab3] | 505 | struct nc_struct |
---|
| 506 | { |
---|
| 507 | short ref; |
---|
| 508 | nc_type type; |
---|
| 509 | ring basering; // the ring C,D,.. live in |
---|
| 510 | matrix C; |
---|
| 511 | matrix D; |
---|
| 512 | matrix *MT; |
---|
| 513 | matrix COM; |
---|
| 514 | int *MTsize; |
---|
| 515 | int IsSkewConstant; /* indicates whethere coeffs C_ij are all equal */ |
---|
| 516 | /* effective together with nc_type=nc_skew */ |
---|
| 517 | }; |
---|
| 518 | #endif |
---|
| 519 | |
---|
[5a9e7b] | 520 | |
---|
[35aab3] | 521 | struct sip_sring |
---|
| 522 | { |
---|
| 523 | idhdl idroot; /* local objects */ |
---|
| 524 | int* order; /* array of orderings */ |
---|
| 525 | int* block0; /* starting pos.*/ |
---|
| 526 | int* block1; /* ending pos.*/ |
---|
| 527 | char** parameter; /* names of parameters */ |
---|
| 528 | number minpoly; |
---|
[a686c9] | 529 | ideal minideal; |
---|
[35aab3] | 530 | int** wvhdl; /* array of weight vectors */ |
---|
| 531 | char ** names; /* array of variable names */ |
---|
| 532 | |
---|
| 533 | unsigned long options; /* ring dependent options */ |
---|
| 534 | |
---|
| 535 | // what follows below here should be set by rComplete, _only_ |
---|
| 536 | long *ordsgn; /* array of +/- 1 (or 0) for comparing monomials */ |
---|
| 537 | /* ExpL_Size entries*/ |
---|
| 538 | |
---|
| 539 | // is NULL for lp or N == 1, otherwise non-NULL (with OrdSize > 0 entries) */ |
---|
| 540 | sro_ord* typ; /* array of orderings + sizes, OrdSize entries */ |
---|
| 541 | |
---|
| 542 | ideal qideal; /* extension to the ring structure: qring */ |
---|
| 543 | |
---|
| 544 | |
---|
[7567b0] | 545 | int* VarOffset; |
---|
[35aab3] | 546 | int* firstwv; |
---|
| 547 | |
---|
| 548 | struct omBin_s* PolyBin; /* Bin from where monoms are allocated */ |
---|
[7567b0] | 549 | int ch; /* characteristic */ |
---|
[009d80] | 550 | #ifdef HAVE_RINGS |
---|
| 551 | unsigned int ringtype; /* cring = 0 => coefficient field, cring = 1 => coeffs from Z/2^m */ |
---|
| 552 | unsigned long ringflaga; |
---|
| 553 | unsigned int ringflagb; |
---|
[585bbcb] | 554 | #endif |
---|
[8247fd] | 555 | int ref; /* reference counter to the ring */ |
---|
[585bbcb] | 556 | |
---|
[35aab3] | 557 | short float_len; /* additional char-flags */ |
---|
| 558 | short float_len2; /* additional char-flags */ |
---|
| 559 | |
---|
| 560 | short N; /* number of vars */ |
---|
| 561 | |
---|
| 562 | short P; /* number of pars */ |
---|
| 563 | short OrdSgn; /* 1 for polynomial rings, -1 otherwise */ |
---|
| 564 | |
---|
| 565 | short firstBlockEnds; |
---|
| 566 | |
---|
| 567 | |
---|
| 568 | BOOLEAN VectorOut; |
---|
| 569 | BOOLEAN ShortOut; |
---|
| 570 | BOOLEAN CanShortOut; |
---|
| 571 | BOOLEAN LexOrder; |
---|
| 572 | // TRUE if the monomial ordering has polynomial and power series blocks |
---|
| 573 | BOOLEAN MixedOrder; |
---|
| 574 | // 1 for lex ordering (except ls), -1 otherwise |
---|
| 575 | BOOLEAN ComponentOrder; |
---|
| 576 | |
---|
| 577 | |
---|
| 578 | // what follows below here should be set by rComplete, _only_ |
---|
| 579 | // contains component, but no weight fields in E */ |
---|
| 580 | short ExpL_Size; // size of exponent vector in long |
---|
| 581 | short CmpL_Size; // portions which need to be compared |
---|
| 582 | /* number of long vars in exp vector: |
---|
| 583 | long vars are those longs in the exponent vector which are |
---|
| 584 | occupied by variables, only */ |
---|
| 585 | short VarL_Size; |
---|
| 586 | |
---|
| 587 | short BitsPerExp; /* number of bits per exponent */ |
---|
| 588 | short ExpPerLong; /* maximal number of Exponents per long */ |
---|
| 589 | |
---|
| 590 | short pCompIndex; /* p->exp.e[pCompIndex] is the component */ |
---|
| 591 | short pOrdIndex; /* p->exp[pOrdIndex] is pGetOrd(p) */ |
---|
| 592 | |
---|
| 593 | short OrdSize; /* size of ord vector (in sro_ord) */ |
---|
| 594 | |
---|
| 595 | |
---|
| 596 | /* if >= 0, long vars in exp vector are consecutive and start there |
---|
| 597 | if < 0, long vars in exp vector are not consecutive */ |
---|
| 598 | short VarL_LowIndex; |
---|
| 599 | // number of exponents in r->VarL_Offset[0] |
---|
| 600 | // is minimal number of exponents in a long var |
---|
| 601 | short MinExpPerLong; |
---|
| 602 | |
---|
| 603 | /* if this is > 0, then NegWeightL_Offset[0..size_1] is index of longs in |
---|
| 604 | ExpVector whose values need an offset due to negative weights */ |
---|
| 605 | short NegWeightL_Size; |
---|
| 606 | /* array of NegWeigtL_Size indicies */ |
---|
| 607 | int* NegWeightL_Offset; |
---|
| 608 | |
---|
| 609 | /* array of size VarL_Size, |
---|
| 610 | VarL_Offset[i] gets i-th long var in exp vector */ |
---|
| 611 | int* VarL_Offset; |
---|
| 612 | |
---|
| 613 | /* mask for getting single exponents */ |
---|
| 614 | unsigned long bitmask; |
---|
| 615 | /* mask used for divisiblity tests */ |
---|
| 616 | unsigned long divmask; |
---|
| 617 | |
---|
| 618 | p_Procs_s* p_Procs; |
---|
| 619 | |
---|
| 620 | /* FDeg and LDeg */ |
---|
| 621 | pFDegProc pFDeg; |
---|
| 622 | pLDegProc pLDeg; |
---|
| 623 | |
---|
| 624 | /* as it was determined by rComplete */ |
---|
| 625 | pFDegProc pFDegOrig; |
---|
| 626 | /* and as it was determined before rOptimizeLDeg */ |
---|
| 627 | pLDegProc pLDegOrig; |
---|
| 628 | |
---|
| 629 | p_SetmProc p_Setm; |
---|
| 630 | n_Procs_s* cf; |
---|
| 631 | ring algring; |
---|
| 632 | #ifdef HAVE_PLURAL |
---|
| 633 | nc_struct *nc; |
---|
| 634 | #endif |
---|
| 635 | }; |
---|
| 636 | |
---|
| 637 | struct sip_sideal |
---|
| 638 | { |
---|
| 639 | poly* m; |
---|
| 640 | long rank; |
---|
| 641 | int nrows; |
---|
| 642 | int ncols; |
---|
| 643 | #define IDELEMS(i) ((i)->ncols) |
---|
| 644 | inline int& idelems(void) { return ncols; } |
---|
| 645 | }; |
---|
| 646 | |
---|
| 647 | struct sip_smap |
---|
| 648 | { |
---|
| 649 | poly *m; |
---|
| 650 | char *preimage; |
---|
| 651 | int nrows; |
---|
| 652 | int ncols; |
---|
| 653 | }; |
---|
| 654 | |
---|
| 655 | struct sideal_list |
---|
| 656 | { |
---|
| 657 | ideal_list next; |
---|
| 658 | ideal d; |
---|
[2d9e1e] | 659 | #ifndef NDEBUG |
---|
| 660 | int nr; |
---|
| 661 | #endif |
---|
[35aab3] | 662 | }; |
---|
| 663 | #endif /* __cplusplus */ |
---|
| 664 | |
---|
| 665 | |
---|
| 666 | |
---|
| 667 | /* |
---|
| 668 | ** 7. runtime procedures/global data |
---|
| 669 | */ |
---|
| 670 | |
---|
| 671 | /* 7.1 C-routines : */ |
---|
| 672 | |
---|
| 673 | |
---|
| 674 | #ifdef __cplusplus |
---|
| 675 | extern "C" { |
---|
| 676 | #endif |
---|
[de7394] | 677 | void m2_end(int i); |
---|
[35aab3] | 678 | #ifdef __cplusplus |
---|
| 679 | } |
---|
| 680 | #endif |
---|
| 681 | |
---|
| 682 | /* 7.2 C++-routines : */ |
---|
| 683 | |
---|
| 684 | #ifdef __cplusplus |
---|
| 685 | int inits(void); |
---|
| 686 | int IsPrime(int i); |
---|
| 687 | #ifdef buildin_rand |
---|
| 688 | extern int siSeed; |
---|
| 689 | int siRand(); |
---|
| 690 | #endif |
---|
| 691 | #endif |
---|
| 692 | |
---|
| 693 | /*the general set of std-options --> kutil.cc */ |
---|
| 694 | extern BITSET test; |
---|
| 695 | /*the general set of verbose-options --> febase.cc */ |
---|
| 696 | #ifdef __cplusplus |
---|
| 697 | extern "C" BITSET verbose; |
---|
| 698 | #else |
---|
| 699 | extern BITSET verbose; |
---|
| 700 | #endif |
---|
| 701 | /*debugging the bison grammar --> grammar.cc*/ |
---|
| 702 | #ifdef YYDEBUG |
---|
| 703 | #if YYDEBUG |
---|
| 704 | extern int yydebug; |
---|
| 705 | #endif |
---|
| 706 | #endif |
---|
| 707 | |
---|
| 708 | extern int yylineno; |
---|
| 709 | extern char my_yylinebuf[80]; |
---|
| 710 | |
---|
| 711 | #define loop for(;;) |
---|
| 712 | |
---|
| 713 | #ifndef ABS |
---|
| 714 | #define ABS(x) ((x)<0?(-(x)):(x)) |
---|
| 715 | #endif |
---|
| 716 | |
---|
| 717 | #if defined(__cplusplus) |
---|
| 718 | inline int si_max(const int a, const int b) { return (a>b) ? a : b; } |
---|
| 719 | inline int si_min(const int a, const int b) { return (a<b) ? a : b; } |
---|
| 720 | #if defined(DecAlpha_Linux) || defined(IA64_Linux) |
---|
| 721 | inline long si_max(const long a, const long b) { return (a>b) ? a : b; } |
---|
| 722 | inline long si_min(const long a, const long b) { return (a<b) ? a : b; } |
---|
| 723 | #endif |
---|
| 724 | #else |
---|
| 725 | #define si_max(A,B) ((A) > (B) ? (A) : (B)) |
---|
| 726 | #define si_min(A,B) ((A) < (B) ? (A) : (B)) |
---|
| 727 | #endif |
---|
| 728 | |
---|
| 729 | /* |
---|
| 730 | ** Set operations (small sets only) |
---|
| 731 | */ |
---|
| 732 | |
---|
| 733 | #define Sy_bit(x) ((unsigned)1<<(x)) |
---|
| 734 | #define Sy_inset(x,s) ((Sy_bit(x)&(s))?TRUE:FALSE) |
---|
| 735 | #define BTEST1(a) Sy_inset((a), test) |
---|
| 736 | #define BVERBOSE(a) Sy_inset((a), verbose) |
---|
| 737 | |
---|
| 738 | /* |
---|
| 739 | ** defines for BITSETs |
---|
| 740 | */ |
---|
| 741 | |
---|
[225d94] | 742 | #define V_SHOW_MEM 2 |
---|
| 743 | #define V_YACC 3 |
---|
| 744 | #define V_REDEFINE 4 |
---|
| 745 | #define V_READING 5 |
---|
| 746 | #define V_LOAD_LIB 6 |
---|
| 747 | #define V_DEBUG_LIB 7 |
---|
| 748 | #define V_LOAD_PROC 8 |
---|
| 749 | #define V_DEF_RES 9 |
---|
| 750 | #define V_DEBUG_MEM 10 |
---|
| 751 | #define V_SHOW_USE 11 |
---|
| 752 | #define V_IMAP 12 |
---|
| 753 | #define V_PROMPT 13 |
---|
| 754 | #define V_NSB 14 |
---|
| 755 | #define V_CONTENTSB 15 |
---|
[35aab3] | 756 | #define V_CANCELUNIT 16 |
---|
[3f8042] | 757 | #define V_MODPSOLVSB 17 |
---|
[1cf21dd] | 758 | #define V_UPTORADICAL 18 |
---|
[225d94] | 759 | #define V_FINDMONOM 19 |
---|
| 760 | #define V_COEFSTRAT 20 |
---|
| 761 | #define V_IDLIFT 21 |
---|
[2502b8] | 762 | #define V_LENGTH 22 |
---|
[225d94] | 763 | #define V_DEG_STOP 31 |
---|
[35aab3] | 764 | |
---|
| 765 | |
---|
| 766 | #define OPT_PROT 0 |
---|
| 767 | #define OPT_REDSB 1 |
---|
| 768 | #define OPT_NOT_BUCKETS 2 |
---|
| 769 | #define OPT_NOT_SUGAR 3 |
---|
| 770 | #define OPT_INTERRUPT 4 |
---|
| 771 | #define OPT_SUGARCRIT 5 |
---|
| 772 | #define OPT_DEBUG 6 |
---|
| 773 | #define OPT_REDTHROUGH 7 |
---|
| 774 | #define OPT_RETURN_SB 9 |
---|
| 775 | #define OPT_FASTHC 10 |
---|
| 776 | #define OPT_OLDSTD 20 |
---|
| 777 | #define OPT_KEEPVARS 21 |
---|
| 778 | #define OPT_STAIRCASEBOUND 22 |
---|
| 779 | #define OPT_MULTBOUND 23 |
---|
| 780 | #define OPT_DEGBOUND 24 |
---|
| 781 | #define OPT_REDTAIL 25 |
---|
| 782 | #define OPT_INTSTRATEGY 26 |
---|
| 783 | #define OPT_INFREDTAIL 28 |
---|
| 784 | #define OPT_SB_1 29 |
---|
| 785 | #define OPT_NOTREGULARITY 30 |
---|
| 786 | #define OPT_WEIGHTM 31 |
---|
| 787 | |
---|
| 788 | /* define ring dependent options */ |
---|
| 789 | #define TEST_RINGDEP_OPTS \ |
---|
| 790 | (Sy_bit(OPT_INTSTRATEGY) | Sy_bit(OPT_REDTHROUGH) | Sy_bit(OPT_REDTAIL)) |
---|
| 791 | |
---|
| 792 | #define TEST_OPT_PROT BTEST1(OPT_PROT) |
---|
| 793 | #define TEST_OPT_REDSB BTEST1(OPT_REDSB) |
---|
| 794 | #define TEST_OPT_NOT_BUCKETS BTEST1(OPT_NOT_BUCKETS) |
---|
| 795 | #define TEST_OPT_NOT_SUGAR BTEST1(OPT_NOT_SUGAR) |
---|
| 796 | #define TEST_OPT_SUGARCRIT BTEST1(OPT_SUGARCRIT) |
---|
| 797 | #define TEST_OPT_DEBUG BTEST1(OPT_DEBUG) |
---|
| 798 | #define TEST_OPT_FASTHC BTEST1(OPT_FASTHC) |
---|
| 799 | #define TEST_OPT_INTSTRATEGY BTEST1(OPT_INTSTRATEGY) |
---|
| 800 | #define TEST_OPT_RETURN_SB BTEST1(OPT_RETURN_SB) |
---|
| 801 | #define TEST_OPT_KEEPVARS BTEST1(OPT_KEEPVARS) |
---|
| 802 | #define TEST_OPT_DEGBOUND BTEST1(OPT_DEGBOUND) |
---|
| 803 | #define TEST_OPT_MULTBOUND BTEST1(OPT_MULTBOUND) |
---|
| 804 | #define TEST_OPT_STAIRCASEBOUND BTEST1(OPT_STAIRCASEBOUND) |
---|
| 805 | #define TEST_OPT_REDTAIL BTEST1(OPT_REDTAIL) |
---|
| 806 | #define TEST_OPT_INFREDTAIL BTEST1(OPT_INFREDTAIL) |
---|
| 807 | #define TEST_OPT_SB_1 BTEST1(OPT_SB_1) |
---|
| 808 | #define TEST_OPT_NOTREGULARITY BTEST1(OPT_NOTREGULARITY) |
---|
| 809 | #define TEST_OPT_WEIGHTM BTEST1(OPT_WEIGHTM) |
---|
| 810 | #define TEST_OPT_REDTHROUGH BTEST1(OPT_REDTHROUGH) |
---|
| 811 | #define TEST_OPT_OLDSTD BTEST1(OPT_OLDSTD) |
---|
| 812 | #define TEST_OPT_CONTENTSB BVERBOSE(V_CONTENTSB) |
---|
| 813 | #define TEST_OPT_CANCELUNIT BVERBOSE(V_CANCELUNIT) |
---|
[225d94] | 814 | #define TEST_OPT_IDLIFT BVERBOSE(V_IDLIFT) |
---|
[2502b8] | 815 | #define TEST_OPT_LENGTH BVERBOSE(V_LENGTH) |
---|
[35aab3] | 816 | |
---|
| 817 | #define TEST_VERB_NSB BVERBOSE(V_NSB) |
---|
| 818 | #define TEST_V_DEG_STOP BVERBOSE(V_DEG_STOP) |
---|
[3f8042] | 819 | #define TEST_V_MODPSOLVSB BVERBOSE(V_MODPSOLVSB) |
---|
[3f0210] | 820 | #define TEST_V_COEFSTRAT BVERBOSE(V_COEFSTRAT) |
---|
[1cf21dd] | 821 | #define TEST_V_UPTORADICAL BVERBOSE(V_UPTORADICAL) |
---|
| 822 | #define TEST_V_FINDMONOM BVERBOSE(V_FINDMONOM) |
---|
[35aab3] | 823 | #ifdef HAVE_LIBPARSER |
---|
| 824 | #ifdef __cplusplus |
---|
| 825 | class libstack; |
---|
| 826 | typedef libstack * libstackv; |
---|
| 827 | #endif |
---|
| 828 | #endif /* HAVE_LIBPARSER */ |
---|
| 829 | |
---|
| 830 | extern struct omBin_s* MP_INT_bin; |
---|
| 831 | extern struct omBin_s* char_ptr_bin; |
---|
| 832 | extern struct omBin_s* ideal_bin; |
---|
| 833 | extern struct omBin_s* int_bin; |
---|
| 834 | extern struct omBin_s* poly_bin; |
---|
| 835 | extern struct omBin_s* void_ptr_bin; |
---|
| 836 | extern struct omBin_s* indlist_bin; |
---|
| 837 | extern struct omBin_s* naIdeal_bin; |
---|
| 838 | extern struct omBin_s* snaIdeal_bin; |
---|
| 839 | extern struct omBin_s* sm_prec_bin; |
---|
| 840 | extern struct omBin_s* smprec_bin; |
---|
| 841 | extern struct omBin_s* sip_sideal_bin; |
---|
| 842 | extern struct omBin_s* sip_smap_bin; |
---|
| 843 | extern struct omBin_s* sip_sring_bin; |
---|
| 844 | extern struct omBin_s* ip_sideal_bin; |
---|
| 845 | extern struct omBin_s* ip_smap_bin; |
---|
| 846 | extern struct omBin_s* ip_sring_bin; |
---|
| 847 | extern struct omBin_s* sleftv_bin; |
---|
| 848 | |
---|
| 849 | #ifdef __cplusplus |
---|
| 850 | union uutypes |
---|
| 851 | { |
---|
| 852 | int i; |
---|
| 853 | ring uring; |
---|
| 854 | poly p; |
---|
| 855 | number n; |
---|
| 856 | ideal uideal; |
---|
[45b750f] | 857 | map umap; |
---|
[35aab3] | 858 | matrix umatrix; |
---|
| 859 | char * ustring; |
---|
| 860 | intvec * iv; |
---|
| 861 | lists l; |
---|
| 862 | si_link li; |
---|
| 863 | package pack; |
---|
| 864 | procinfo * pinf; |
---|
| 865 | }; |
---|
| 866 | |
---|
| 867 | class idrec |
---|
| 868 | { |
---|
| 869 | public: |
---|
| 870 | /* !! do not change the first 6 entries !! (see subexpr.h: sleftv) */ |
---|
| 871 | idhdl next; |
---|
| 872 | char * id; |
---|
| 873 | utypes data; |
---|
| 874 | attr attribute; |
---|
| 875 | BITSET flag; |
---|
| 876 | idtyp typ; |
---|
| 877 | |
---|
| 878 | short lev; |
---|
| 879 | short ref; |
---|
[445e55] | 880 | #ifdef HAVE_IDI |
---|
| 881 | int id_i; |
---|
| 882 | #endif |
---|
[35aab3] | 883 | |
---|
| 884 | #define IDNEXT(a) ((a)->next) |
---|
| 885 | #define IDTYP(a) ((a)->typ) |
---|
| 886 | #define IDFLAG(a) ((a)->flag) |
---|
| 887 | #define IDLEV(a) ((a)->lev) |
---|
| 888 | #define IDID(a) ((a)->id) |
---|
| 889 | #define IDATTR(a) ((a)->attribute) |
---|
| 890 | |
---|
[8ddce42] | 891 | #define IDINT(a) ((int)(long)((a)->data.ustring)) |
---|
[35aab3] | 892 | #define IDDATA(a) ((a)->data.ustring) |
---|
| 893 | #define IDRING(a) ((a)->data.uring) |
---|
| 894 | #define IDINTVEC(a) ((a)->data.iv) |
---|
| 895 | #define IDPOLY(a) ((a)->data.p) |
---|
[8ce2038] | 896 | #define IDBIGINT(a) ((a)->data.n) |
---|
[35aab3] | 897 | #define IDNUMBER(a) ((a)->data.n) |
---|
| 898 | #define IDIDEAL(a) (((a)->data).uideal) |
---|
| 899 | #define IDMATRIX(a) (((a)->data).umatrix) |
---|
| 900 | #define IDMAP(a) (((a)->data).umap) |
---|
| 901 | #define IDSTRING(a) ((a)->data.ustring) |
---|
| 902 | #define IDLIST(a) ((a)->data.l) |
---|
| 903 | #define IDLINK(a) ((a)->data.li) |
---|
| 904 | #define IDPACKAGE(a) ((a)->data.pack) |
---|
| 905 | #define IDPROC(a) ((a)->data.pinf) |
---|
| 906 | |
---|
| 907 | idrec() { memset(this,0,sizeof(*this)); } |
---|
| 908 | idhdl get(const char * s, int lev); |
---|
| 909 | idhdl set(char * s, int lev, idtyp t, BOOLEAN init=TRUE); |
---|
| 910 | char * String(); |
---|
| 911 | // ~idrec(); |
---|
| 912 | }; |
---|
[5dc702] | 913 | |
---|
| 914 | class proc_singular |
---|
| 915 | { |
---|
| 916 | public: |
---|
| 917 | long proc_start; // position where proc is starting |
---|
| 918 | long def_end; // position where proc header is ending |
---|
| 919 | long help_start; // position where help is starting |
---|
| 920 | long help_end; // position where help is starting |
---|
| 921 | long body_start; // position where proc-body is starting |
---|
| 922 | long body_end; // position where proc-body is ending |
---|
| 923 | long example_start; // position where example is starting |
---|
| 924 | long proc_end; // position where proc is ending |
---|
| 925 | int proc_lineno; |
---|
| 926 | int body_lineno; |
---|
| 927 | int example_lineno; |
---|
| 928 | char *body; |
---|
| 929 | long help_chksum; |
---|
| 930 | }; |
---|
| 931 | |
---|
| 932 | struct proc_object |
---|
| 933 | { |
---|
| 934 | //public: |
---|
| 935 | BOOLEAN (*function)(leftv res, leftv v); |
---|
| 936 | }; |
---|
| 937 | |
---|
| 938 | union uprocinfodata; |
---|
| 939 | |
---|
| 940 | union uprocinfodata |
---|
| 941 | { |
---|
| 942 | public: |
---|
| 943 | proc_singular s; // data of Singular-procedure |
---|
| 944 | struct proc_object o; // pointer to binary-function |
---|
| 945 | }; |
---|
| 946 | |
---|
| 947 | typedef union uprocinfodata procinfodata; |
---|
| 948 | |
---|
| 949 | typedef enum { LANG_NONE, LANG_TOP, LANG_SINGULAR, LANG_C, LANG_MAX} language_defs; |
---|
| 950 | // LANG_TOP : Toplevel package only |
---|
| 951 | // LANG_SINGULAR: |
---|
| 952 | // LANG_C : |
---|
| 953 | class procinfo |
---|
| 954 | { |
---|
| 955 | public: |
---|
| 956 | char *libname; |
---|
| 957 | char *procname; |
---|
| 958 | #ifdef HAVE_NS |
---|
| 959 | package pack; |
---|
| 960 | #endif |
---|
| 961 | language_defs language; |
---|
| 962 | short ref; |
---|
| 963 | char is_static; // if set, proc not accessible for user |
---|
| 964 | char trace_flag; |
---|
| 965 | procinfodata data; |
---|
| 966 | }; |
---|
| 967 | |
---|
[35aab3] | 968 | #endif |
---|
| 969 | |
---|
| 970 | #endif |
---|
| 971 | |
---|