source: git/kernel/tgbgauss.h @ 81306a

spielwiese
Last change on this file since 81306a was 81306a, checked in by Michael Brickenstein <bricken@…>, 18 years ago
*bricken: moved mac_poly things to tgbgauss git-svn-id: file:///usr/local/Singular/svn/trunk@8102 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 2.3 KB
Line 
1#ifndef TGBGAUSS_HEADER
2#define TGBGAUSS_HEADER
3#include "mod2.h"
4#include "numbers.h"
5#include "tgb_internal.h"
6
7class tgb_matrix{
8 private:
9  number** n;
10  int columns;
11  int rows;
12  BOOLEAN free_numbers;
13 public:
14  tgb_matrix(int i, int j);
15  ~tgb_matrix();
16  int get_rows();
17  int get_columns();
18  void print();
19  void perm_rows(int i, int j);
20  void set(int i, int j, number n);
21  number get(int i, int j);
22  BOOLEAN is_zero_entry(int i, int j);
23  void free_row(int row, BOOLEAN free_non_zeros=TRUE);
24  int min_col_not_zero_in_row(int row);
25  int next_col_not_zero(int row,int pre);
26  BOOLEAN zero_row(int row);
27  void mult_row(int row,number factor);
28  void add_lambda_times_row(int add_to,int summand,number factor);
29  int non_zero_entries(int row);
30};
31
32class mac_poly_r{
33public:
34  number coef;
35  mac_poly_r* next;
36  int exp;
37  mac_poly_r():next(NULL){}
38};
39//mac_polys exp are smaller iff they are greater by monomial ordering
40//corresponding to solving linear equations notation
41
42typedef mac_poly_r* mac_poly;
43
44class tgb_sparse_matrix{
45 private:
46  ring r;
47  mac_poly* mp;
48  int columns;
49  int rows;
50  BOOLEAN free_numbers;
51 public:
52  void sort_rows();
53  friend poly free_row_to_poly(tgb_sparse_matrix* mat, int row, poly* monoms, int monom_index);
54  friend void init_with_mac_poly(tgb_sparse_matrix* mat, int row, mac_poly m);
55  tgb_sparse_matrix(int i, int j, ring rarg);
56  ~tgb_sparse_matrix();
57  int get_rows();
58  int get_columns();
59  void print();
60  void row_normalize(int row);
61  void row_content(int row);
62  //  void perm_rows(int i, int j);
63  void perm_rows(int i, int j){
64  mac_poly h;
65  h=mp[i];
66  mp[i]=mp[j];
67  mp[j]=h;
68  }
69  void set(int i, int j, number n);
70  number get(int i, int j);
71  BOOLEAN is_zero_entry(int i, int j);
72  void free_row(int row, BOOLEAN free_non_zeros=TRUE);
73  int min_col_not_zero_in_row(int row);
74  int next_col_not_zero(int row,int pre);
75  BOOLEAN zero_row(int row);
76  void mult_row(int row,number factor);
77  void add_lambda_times_row(int add_to,int summand,number factor);
78  int non_zero_entries(int row);
79};
80void simple_gauss(tgb_sparse_matrix* mat, calc_dat* c);
81void simple_gauss2(tgb_matrix* mat);
82
83
84
85mac_poly mac_p_add_ff_qq(mac_poly a, number f,mac_poly b);
86
87void mac_mult_cons(mac_poly p,number c);
88int mac_length(mac_poly p);
89
90//contrary to delete on the mac_poly_r, the coefficients are also destroyed here
91void mac_destroy(mac_poly p);
92
93#endif
Note: See TracBrowser for help on using the repository browser.