Loading...
Searching...
No Matches
tgbgauss.h
Go to the documentation of this file.
#ifndef TGBGAUSS_HEADER
#define TGBGAUSS_HEADER
/****************************************
* Computer Algebra System SINGULAR *
****************************************/
/*
* ABSTRACT: gauss implementation for F4 header
*/
#include "coeffs/numbers.h"
#include "polys/monomials/p_polys.h"
#include "omalloc/omalloc.h"
#ifdef HAVE_OMALLOC
#include "omalloc/omallocClass.h"
#endif
class slimgb_alg;
class tgb_matrix
{
private:
number** n;
int columns;
int rows;
BOOLEAN free_numbers;
public:
tgb_matrix(int i, int j);
~tgb_matrix();
int get_rows();
int get_columns();
void print();
void perm_rows(int i, int j);
void set(int i, int j, number n);
number get(int i, int j);
BOOLEAN is_zero_entry(int i, int j);
void free_row(int row, BOOLEAN free_non_zeros=TRUE);
int min_col_not_zero_in_row(int row);
int next_col_not_zero(int row,int pre);
BOOLEAN zero_row(int row);
void mult_row(int row,number factor);
void add_lambda_times_row(int add_to,int summand,number factor);
int non_zero_entries(int row);
};
class mac_poly_r
#ifdef HAVE_OMALLOC
:public omallocClass
#endif
{
public:
number coef;
mac_poly_r* next;
int exp;
mac_poly_r():next(NULL){}
};
//mac_polys exp are smaller iff they are greater by monomial ordering
//corresponding to solving linear equations notation
typedef mac_poly_r* mac_poly;
class tgb_sparse_matrix
{
private:
ring r;
mac_poly* mp;
int columns;
int rows;
BOOLEAN free_numbers;
public:
void sort_rows();
friend poly free_row_to_poly(tgb_sparse_matrix* mat, int row, poly* monoms, int monom_index);
friend void init_with_mac_poly(tgb_sparse_matrix* mat, int row, mac_poly m);
tgb_sparse_matrix(int i, int j, ring rarg);
~tgb_sparse_matrix();
int get_rows();
int get_columns();
void print();
void row_normalize(int row);
void row_content(int row);
// void perm_rows(int i, int j);
void perm_rows(int i, int j){
mac_poly h;
h=mp[i];
mp[i]=mp[j];
mp[j]=h;
}
void set(int i, int j, number n);
number get(int i, int j);
BOOLEAN is_zero_entry(int i, int j);
void free_row(int row, BOOLEAN free_non_zeros=TRUE);
int min_col_not_zero_in_row(int row);
int next_col_not_zero(int row,int pre);
BOOLEAN zero_row(int row);
void mult_row(int row,number factor);
void add_lambda_times_row(int add_to,int summand,number factor);
int non_zero_entries(int row);
};
void simple_gauss(tgb_sparse_matrix* mat, slimgb_alg* c);
void simple_gauss2(tgb_matrix* mat);
mac_poly mac_p_add_ff_qq(mac_poly a, number f,mac_poly b);
void mac_mult_cons(mac_poly p,number c);
int mac_length(mac_poly p);
//contrary to delete on the mac_poly_r, the coefficients are also destroyed here
void mac_destroy(mac_poly p);
#endif
BOOLEAN
int BOOLEAN
Definition auxiliary.h:88
TRUE
#define TRUE
Definition auxiliary.h:101
m
int m
Definition cfEzgcd.cc:128
i
int i
Definition cfEzgcd.cc:132
p
int p
Definition cfModGcd.cc:4086
b
CanonicalForm b
Definition cfModGcd.cc:4111
f
FILE * f
Definition checklibs.c:9
mac_poly_r
Definition tgbgauss.h:48
mac_poly_r::next
mac_poly_r * next
Definition tgbgauss.h:51
mac_poly_r::coef
number coef
Definition tgbgauss.h:50
mac_poly_r::exp
int exp
Definition tgbgauss.h:52
mac_poly_r::mac_poly_r
mac_poly_r()
Definition tgbgauss.h:53
omallocClass
Definition omallocClass.h:20
slimgb_alg
Definition tgb_internal.h:199
tgb_matrix
Definition tgbgauss.h:19
tgb_matrix::mult_row
void mult_row(int row, number factor)
Definition tgbgauss.cc:619
tgb_matrix::rows
int rows
Definition tgbgauss.h:23
tgb_matrix::n
number ** n
Definition tgbgauss.h:21
tgb_matrix::tgb_matrix
tgb_matrix(int i, int j)
Definition tgbgauss.cc:459
tgb_matrix::add_lambda_times_row
void add_lambda_times_row(int add_to, int summand, number factor)
Definition tgbgauss.cc:603
tgb_matrix::set
void set(int i, int j, number n)
Definition tgbgauss.cc:520
tgb_matrix::~tgb_matrix
~tgb_matrix()
Definition tgbgauss.cc:477
tgb_matrix::min_col_not_zero_in_row
int min_col_not_zero_in_row(int row)
Definition tgbgauss.cc:557
tgb_matrix::non_zero_entries
int non_zero_entries(int row)
Definition tgbgauss.cc:590
tgb_matrix::next_col_not_zero
int next_col_not_zero(int row, int pre)
Definition tgbgauss.cc:568
tgb_matrix::free_numbers
BOOLEAN free_numbers
Definition tgbgauss.h:24
tgb_matrix::columns
int columns
Definition tgbgauss.h:22
tgb_matrix::zero_row
BOOLEAN zero_row(int row)
Definition tgbgauss.cc:579
tgb_matrix::is_zero_entry
BOOLEAN is_zero_entry(int i, int j)
Definition tgbgauss.cc:544
tgb_matrix::free_row
void free_row(int row, BOOLEAN free_non_zeros=TRUE)
Definition tgbgauss.cc:635
tgb_matrix::perm_rows
void perm_rows(int i, int j)
Definition tgbgauss.cc:549
tgb_matrix::get
number get(int i, int j)
Definition tgbgauss.cc:537
tgb_matrix::get_columns
int get_columns()
Definition tgbgauss.cc:532
tgb_matrix::print
void print()
Definition tgbgauss.cc:498
tgb_matrix::get_rows
int get_rows()
Definition tgbgauss.cc:527
tgb_sparse_matrix
Definition tgbgauss.h:61
tgb_sparse_matrix::set
void set(int i, int j, number n)
Definition tgbgauss.cc:721
tgb_sparse_matrix::columns
int columns
Definition tgbgauss.h:65
tgb_sparse_matrix::rows
int rows
Definition tgbgauss.h:66
tgb_sparse_matrix::is_zero_entry
BOOLEAN is_zero_entry(int i, int j)
Definition tgbgauss.cc:782
tgb_sparse_matrix::min_col_not_zero_in_row
int min_col_not_zero_in_row(int row)
Definition tgbgauss.cc:798
tgb_sparse_matrix::~tgb_sparse_matrix
~tgb_sparse_matrix()
Definition tgbgauss.cc:659
tgb_sparse_matrix::tgb_sparse_matrix
tgb_sparse_matrix(int i, int j, ring rarg)
Definition tgbgauss.cc:645
tgb_sparse_matrix::add_lambda_times_row
void add_lambda_times_row(int add_to, int summand, number factor)
Definition tgbgauss.cc:909
tgb_sparse_matrix::r
ring r
Definition tgbgauss.h:63
tgb_sparse_matrix::zero_row
BOOLEAN zero_row(int row)
Definition tgbgauss.cc:822
tgb_sparse_matrix::free_numbers
BOOLEAN free_numbers
Definition tgbgauss.h:67
tgb_sparse_matrix::mp
mac_poly * mp
Definition tgbgauss.h:64
tgb_sparse_matrix::row_normalize
void row_normalize(int row)
Definition tgbgauss.cc:831
tgb_sparse_matrix::get_rows
int get_rows()
Definition tgbgauss.cc:756
tgb_sparse_matrix::perm_rows
void perm_rows(int i, int j)
Definition tgbgauss.h:80
tgb_sparse_matrix::sort_rows
void sort_rows()
Definition tgbgauss.cc:693
tgb_sparse_matrix::next_col_not_zero
int next_col_not_zero(int row, int pre)
Definition tgbgauss.cc:809
tgb_sparse_matrix::print
void print()
Definition tgbgauss.cc:698
tgb_sparse_matrix::non_zero_entries
int non_zero_entries(int row)
Definition tgbgauss.cc:903
tgb_sparse_matrix::mult_row
void mult_row(int row, number factor)
Definition tgbgauss.cc:914
tgb_sparse_matrix::row_content
void row_content(int row)
Definition tgbgauss.cc:847
tgb_sparse_matrix::get
number get(int i, int j)
Definition tgbgauss.cc:766
tgb_sparse_matrix::get_columns
int get_columns()
Definition tgbgauss.cc:761
tgb_sparse_matrix::init_with_mac_poly
friend void init_with_mac_poly(tgb_sparse_matrix *mat, int row, mac_poly m)
Definition tgb.cc:3113
tgb_sparse_matrix::free_row_to_poly
friend poly free_row_to_poly(tgb_sparse_matrix *mat, int row, poly *monoms, int monom_index)
Definition tgb.cc:3128
tgb_sparse_matrix::free_row
void free_row(int row, BOOLEAN free_non_zeros=TRUE)
Definition tgbgauss.cc:928
factor
CanonicalForm factor
Definition facAbsFact.cc:97
j
int j
Definition facHensel.cc:110
h
STATIC_VAR Poly * h
Definition janet.cc:971
numbers.h
NULL
#define NULL
Definition omList.c:12
omallocClass.h
omalloc.h
p_polys.h
mac_p_add_ff_qq
mac_poly mac_p_add_ff_qq(mac_poly a, number f, mac_poly b)
Definition tgbgauss.cc:16
mac_destroy
void mac_destroy(mac_poly p)
Definition tgbgauss.cc:113
simple_gauss
void simple_gauss(tgb_sparse_matrix *mat, slimgb_alg *c)
Definition tgbgauss.cc:125
simple_gauss2
void simple_gauss2(tgb_matrix *mat)
Definition tgbgauss.cc:365
mac_poly
mac_poly_r * mac_poly
Definition tgbgauss.h:58
mac_mult_cons
void mac_mult_cons(mac_poly p, number c)
Definition tgbgauss.cc:91
mac_length
int mac_length(mac_poly p)
Definition tgbgauss.cc:102