tgbgauss.h
Go to the documentation of this file.
1 #ifndef TGBGAUSS_HEADER
2 #define TGBGAUSS_HEADER
3 /****************************************
4 * Computer Algebra System SINGULAR *
5 ****************************************/
6 /*
7 * ABSTRACT: gauss implementation for F4 header
8 */
9 // #include <kernel/mod2.h>
10 #include <coeffs/numbers.h>
12 #include <omalloc/omallocClass.h>
13 //#include "tgb_internal.h"
14 
15 class slimgb_alg;
16 
17 class tgb_matrix{
18  private:
19  number** n;
20  int columns;
21  int rows;
23  public:
24  tgb_matrix(int i, int j);
25  ~tgb_matrix();
26  int get_rows();
27  int get_columns();
28  void print();
29  void perm_rows(int i, int j);
30  void set(int i, int j, number n);
31  number get(int i, int j);
32  BOOLEAN is_zero_entry(int i, int j);
33  void free_row(int row, BOOLEAN free_non_zeros=TRUE);
34  int min_col_not_zero_in_row(int row);
35  int next_col_not_zero(int row,int pre);
36  BOOLEAN zero_row(int row);
37  void mult_row(int row,number factor);
38  void add_lambda_times_row(int add_to,int summand,number factor);
39  int non_zero_entries(int row);
40 };
41 
42 class mac_poly_r :public omallocClass
43 {
44 public:
45  number coef;
47  int exp;
48  mac_poly_r():next(NULL){}
49 };
50 //mac_polys exp are smaller iff they are greater by monomial ordering
51 //corresponding to solving linear equations notation
52 
54 
56  private:
57  ring r;
59  int columns;
60  int rows;
62  public:
63  void sort_rows();
64  friend poly free_row_to_poly(tgb_sparse_matrix* mat, int row, poly* monoms, int monom_index);
65  friend void init_with_mac_poly(tgb_sparse_matrix* mat, int row, mac_poly m);
66  tgb_sparse_matrix(int i, int j, ring rarg);
68  int get_rows();
69  int get_columns();
70  void print();
71  void row_normalize(int row);
72  void row_content(int row);
73  // void perm_rows(int i, int j);
74  void perm_rows(int i, int j){
75  mac_poly h;
76  h=mp[i];
77  mp[i]=mp[j];
78  mp[j]=h;
79  }
80  void set(int i, int j, number n);
81  number get(int i, int j);
82  BOOLEAN is_zero_entry(int i, int j);
83  void free_row(int row, BOOLEAN free_non_zeros=TRUE);
84  int min_col_not_zero_in_row(int row);
85  int next_col_not_zero(int row,int pre);
86  BOOLEAN zero_row(int row);
87  void mult_row(int row,number factor);
88  void add_lambda_times_row(int add_to,int summand,number factor);
89  int non_zero_entries(int row);
90 };
92 void simple_gauss2(tgb_matrix* mat);
93 
94 
95 
97 
98 void mac_mult_cons(mac_poly p,number c);
99 int mac_length(mac_poly p);
100 
101 //contrary to delete on the mac_poly_r, the coefficients are also destroyed here
102 void mac_destroy(mac_poly p);
103 
104 #endif
void simple_gauss(tgb_sparse_matrix *mat, slimgb_alg *c)
Definition: tgbgauss.cc:128
int columns
Definition: tgbgauss.h:20
void row_content(int row)
Definition: tgbgauss.cc:850
tgb_matrix(int i, int j)
Definition: tgbgauss.cc:462
tgb_sparse_matrix(int i, int j, ring rarg)
Definition: tgbgauss.cc:648
void free_row(int row, BOOLEAN free_non_zeros=TRUE)
Definition: tgbgauss.cc:931
const poly a
Definition: syzextra.cc:212
void row_normalize(int row)
Definition: tgbgauss.cc:834
BOOLEAN is_zero_entry(int i, int j)
Definition: tgbgauss.cc:785
int min_col_not_zero_in_row(int row)
Definition: tgbgauss.cc:560
void mac_mult_cons(mac_poly p, number c)
Definition: tgbgauss.cc:94
int min_col_not_zero_in_row(int row)
Definition: tgbgauss.cc:801
int next_col_not_zero(int row, int pre)
Definition: tgbgauss.cc:812
return P p
Definition: myNF.cc:203
mac_poly mac_p_add_ff_qq(mac_poly a, number f, mac_poly b)
Definition: tgbgauss.cc:19
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
int exp
Definition: tgbgauss.h:47
#define TRUE
Definition: auxiliary.h:144
void set(int i, int j, number n)
Definition: tgbgauss.cc:724
number coef
Definition: tgbgauss.h:45
mac_poly_r * next
Definition: tgbgauss.h:46
void simple_gauss2(tgb_matrix *mat)
Definition: tgbgauss.cc:368
void set(int i, int j, number n)
Definition: tgbgauss.cc:523
BOOLEAN zero_row(int row)
Definition: tgbgauss.cc:582
void print()
Definition: tgbgauss.cc:501
mac_poly_r * mac_poly
Definition: tgbgauss.h:53
void add_lambda_times_row(int add_to, int summand, number factor)
Definition: tgbgauss.cc:606
friend void init_with_mac_poly(tgb_sparse_matrix *mat, int row, mac_poly m)
Definition: tgb.cc:3086
void add_lambda_times_row(int add_to, int summand, number factor)
Definition: tgbgauss.cc:912
int j
Definition: myNF.cc:70
void perm_rows(int i, int j)
Definition: tgbgauss.cc:552
int next_col_not_zero(int row, int pre)
Definition: tgbgauss.cc:571
int m
Definition: cfEzgcd.cc:119
FILE * f
Definition: checklibs.c:7
int i
Definition: cfEzgcd.cc:123
CanonicalForm factor
Definition: facAbsFact.cc:101
mac_poly_r()
Definition: tgbgauss.h:48
void free_row(int row, BOOLEAN free_non_zeros=TRUE)
Definition: tgbgauss.cc:638
int get_rows()
Definition: tgbgauss.cc:530
number ** n
Definition: tgbgauss.h:19
void perm_rows(int i, int j)
Definition: tgbgauss.h:74
void mult_row(int row, number factor)
Definition: tgbgauss.cc:917
BOOLEAN free_numbers
Definition: tgbgauss.h:22
void mult_row(int row, number factor)
Definition: tgbgauss.cc:622
void mac_destroy(mac_poly p)
Definition: tgbgauss.cc:116
#define NULL
Definition: omList.c:10
int get_columns()
Definition: tgbgauss.cc:535
BOOLEAN zero_row(int row)
Definition: tgbgauss.cc:825
int mac_length(mac_poly p)
Definition: tgbgauss.cc:105
int rows
Definition: tgbgauss.h:21
polyrec * poly
Definition: hilb.h:10
int non_zero_entries(int row)
Definition: tgbgauss.cc:906
BOOLEAN free_numbers
Definition: tgbgauss.h:61
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:131
const poly b
Definition: syzextra.cc:213
int non_zero_entries(int row)
Definition: tgbgauss.cc:593
mac_poly * mp
Definition: tgbgauss.h:58
BOOLEAN is_zero_entry(int i, int j)
Definition: tgbgauss.cc:547
friend poly free_row_to_poly(tgb_sparse_matrix *mat, int row, poly *monoms, int monom_index)
Definition: tgb.cc:3101