source: git/kernel/tgbgauss.h @ 6a9f2e

spielwiese
Last change on this file since 6a9f2e was 762407, checked in by Oleksandr Motsak <motsak@…>, 12 years ago
config.h is for sources files only FIX: config.h should only be used by source (not from inside kernel/mod2.h!) NOTE: each source file should better include mod2.h right after config.h, while headers should better not include mod2.h.
  • Property mode set to 100644
File size: 2.6 KB
Line 
1#ifndef TGBGAUSS_HEADER
2#define TGBGAUSS_HEADER
3/****************************************
4*  Computer Algebra System SINGULAR     *
5****************************************/
6/* $Id$ */
7/*
8* ABSTRACT: gauss implementation for F4 header
9*/
10// #include <kernel/mod2.h>
11#include <coeffs/numbers.h>
12#include <polys/monomials/p_polys.h>
13//#include "tgb_internal.h"
14
15struct slimgb_alg;
16
17class tgb_matrix{
18 private:
19  number** n;
20  int columns;
21  int rows;
22  BOOLEAN free_numbers;
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
42class mac_poly_r{
43public:
44  number coef;
45  mac_poly_r* next;
46  int exp;
47  mac_poly_r():next(NULL){}
48};
49//mac_polys exp are smaller iff they are greater by monomial ordering
50//corresponding to solving linear equations notation
51
52typedef mac_poly_r* mac_poly;
53
54class tgb_sparse_matrix{
55 private:
56  ring r;
57  mac_poly* mp;
58  int columns;
59  int rows;
60  BOOLEAN free_numbers;
61 public:
62  void sort_rows();
63  friend poly free_row_to_poly(tgb_sparse_matrix* mat, int row, poly* monoms, int monom_index);
64  friend void init_with_mac_poly(tgb_sparse_matrix* mat, int row, mac_poly m);
65  tgb_sparse_matrix(int i, int j, ring rarg);
66  ~tgb_sparse_matrix();
67  int get_rows();
68  int get_columns();
69  void print();
70  void row_normalize(int row);
71  void row_content(int row);
72  //  void perm_rows(int i, int j);
73  void perm_rows(int i, int j){
74  mac_poly h;
75  h=mp[i];
76  mp[i]=mp[j];
77  mp[j]=h;
78  }
79  void set(int i, int j, number n);
80  number get(int i, int j);
81  BOOLEAN is_zero_entry(int i, int j);
82  void free_row(int row, BOOLEAN free_non_zeros=TRUE);
83  int min_col_not_zero_in_row(int row);
84  int next_col_not_zero(int row,int pre);
85  BOOLEAN zero_row(int row);
86  void mult_row(int row,number factor);
87  void add_lambda_times_row(int add_to,int summand,number factor);
88  int non_zero_entries(int row);
89};
90void simple_gauss(tgb_sparse_matrix* mat, slimgb_alg* c);
91void simple_gauss2(tgb_matrix* mat);
92
93
94
95mac_poly mac_p_add_ff_qq(mac_poly a, number f,mac_poly b);
96
97void mac_mult_cons(mac_poly p,number c);
98int mac_length(mac_poly p);
99
100//contrary to delete on the mac_poly_r, the coefficients are also destroyed here
101void mac_destroy(mac_poly p);
102
103#endif
Note: See TracBrowser for help on using the repository browser.