source: git/Singular/tgb.h @ 4f006f

spielwiese
Last change on this file since 4f006f was 4f006f, checked in by Michael Brickenstein <bricken@…>, 21 years ago
* bricken: new structures, cleaning git-svn-id: file:///usr/local/Singular/svn/trunk@6550 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 3.6 KB
Line 
1#ifndef TGB_H
2#define TGB_H
3
4#include "mod2.h"
5#include <omalloc.h>
6#include "p_polys.h"
7
8#include "ideals.h"
9#include "ring.h"
10#include "febase.h"
11#include "structs.h"
12#include "polys.h"
13#include "stdlib.h"
14
15
16#include "kutil.h"
17#include "kInline.cc"
18#include "kstd1.h"
19#include "kbuckets.h"
20
21#define FULLREDUCTIONS
22//#define HALFREDUCTIONS
23//#define HEAD_BIN
24//#define HOMOGENEOUS_EXAMPLE
25#define REDTAIL_S
26
27//#define REDTAIL_PROT
28//#define QUICK_SPOLY_TEST
29
30
31class reduction_accumulator{
32 public:
33  number multiplied;
34  kBucket_pt bucket;
35  int counter;
36  void decrease_counter(){
37    if((--counter)==0)
38      {
39        nDelete(&multiplied);
40        kBucketDeleteAndDestroy(&bucket);
41        delete this; //self destruction
42      }
43  }
44 
45};
46struct formal_sum_descriptor{
47  number c_my;
48  number c_ac;
49  reduction_accumulator* ac;
50};
51struct int_pair_node{
52  int_pair_node* next;
53  int a;
54  int b;
55};
56class red_object{
57 public:
58  kBucket_pt bucket;
59  poly p;
60  formal_sum_descriptor* sum;
61  unsigned long sev;
62  void flatten();
63  void validate();
64};
65struct sorted_pair_node{
66  //criterium, which is stable 0. small lcm 1. small i 2. small j
67  int i;
68  int j;
69  int deg;
70  int expected_length;
71  poly lcm_of_lm;
72};
73
74
75enum calc_state
76  {
77    UNCALCULATED,
78    HASTREP,
79    UNIMPORTANT,
80    SOONTREP
81  };
82struct calc_dat
83{
84  int* rep;
85  char** states;
86  ideal S;
87  ring r;
88  int* lengths;
89  long* short_Exps;
90  kStrategy strat;
91  int* T_deg;
92  poly* gcd_of_terms;
93  int_pair_node* soon_free;
94  sorted_pair_node** apairs;
95#ifdef HEAD_BIN
96  struct omBin_s*   HeadBin;
97#endif
98  unsigned int reduction_steps;
99  int n;
100  int normal_forms;
101  int current_degree;
102  int Rcounter;
103  int last_index;
104  int max_pairs;
105  int pair_top;
106  int easy_product_crit;
107  int extended_product_crit;
108  BOOLEAN is_char0;
109};
110static int add_to_reductors(calc_dat* c, poly h, int len);
111static int bucket_guess(kBucket* bucket);
112static poly redNFTail (poly h,const int sl,kStrategy strat, int len);
113static poly redNF2 (poly h,calc_dat* c , int &len);
114static void free_sorted_pair_node(sorted_pair_node* s, ring r);
115static void shorten_tails(calc_dat* c, poly monom);
116static void replace_pair(int & i, int & j, calc_dat* c);
117static sorted_pair_node** add_to_basis(poly h, int i, int j,calc_dat* c, int* ip=NULL);
118static void do_this_spoly_stuff(int i,int j,calc_dat* c);
119ideal t_rep_gb(ring r,ideal arg_I);
120static BOOLEAN has_t_rep(const int & arg_i, const int & arg_j, calc_dat* state);
121static int* make_connections(int from, poly bound, calc_dat* c);
122static int* make_connections(int from, int to, poly bound, calc_dat* c);
123static void now_t_rep(const int & arg_i, const int & arg_j, calc_dat* c);
124static void soon_t_rep(const int & arg_i, const int & arg_j, calc_dat* c);
125static int pLcmDeg(poly a, poly b);
126static int simple_posInS (kStrategy strat, poly p,int len, BOOLEAN is_char0);
127static BOOLEAN find_next_pair(calc_dat* c, BOOLEAN go_higher=TRUE);
128
129static sorted_pair_node* pop_pair(calc_dat* c);
130static BOOLEAN no_pairs(calc_dat* c);
131static void clean_top_of_pair_list(calc_dat* c);
132static void super_clean_top_of_pair_list(calc_dat* c);
133static BOOLEAN state_is(calc_state state, const int & i, const int & j, calc_dat* c);
134static BOOLEAN pair_better(sorted_pair_node* a,sorted_pair_node* b, calc_dat* c);
135static int pair_better_gen(const void* ap,const void* bp);
136static poly redTailShort(poly h, kStrategy strat);
137static poly gcd_of_terms(poly p, ring r);
138static BOOLEAN extended_product_criterion(poly p1, poly gcd1, poly p2, poly gcd2, calc_dat* c);
139static poly kBucketGcd(kBucket* b, ring r);
140static void multi_reduction(red_object* los, int & losl, calc_dat* c);
141static sorted_pair_node* quick_pop_pair(calc_dat* c);
142static sorted_pair_node* top_pair(calc_dat* c);
143#endif
Note: See TracBrowser for help on using the repository browser.