Loading...
Searching...
No Matches
tgb_matrix Class Reference

`#include <tgbgauss.h>`

## Public Member Functions

| 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)

## Private Attributes

number ** | n
int | columns
int | rows
BOOLEAN | free_numbers

## Detailed Description

Definition at line 18 of file tgbgauss.h.

## Constructor & Destructor Documentation

## tgb_matrix()

tgb_matrix::tgb_matrix | ( | int | i,
|  | int | j )

Definition at line 459 of file tgbgauss.cc.

{
n=(number**) omAlloc(i*sizeof (number*));;
int z;
int z2;
for(z=0;z<i;z++)
{
n[z]=(number*)omAlloc(j*sizeof(number));
for(z2=0;z2<j;z2++)
{
n[z][z2]=nInit(0);
}
}
columns=j;
rows=i;
free_numbers=FALSE;
}
FALSE
#define FALSE
Definition auxiliary.h:97
i
int i
Definition cfEzgcd.cc:132
tgb_matrix::rows
int rows
Definition tgbgauss.h:23
tgb_matrix::n
number ** n
Definition tgbgauss.h:21
tgb_matrix::free_numbers
BOOLEAN free_numbers
Definition tgbgauss.h:24
tgb_matrix::columns
int columns
Definition tgbgauss.h:22
j
int j
Definition facHensel.cc:110
nInit
#define nInit(i)
Definition numbers.h:24
omAlloc
#define omAlloc(size)
Definition omAllocDecl.h:210

## ~tgb_matrix()

tgb_matrix::~tgb_matrix | ( |  | ) |

Definition at line 477 of file tgbgauss.cc.

{
int z;
for(z=0;z<rows;z++)
{
if(n[z])
{
if(free_numbers)
{
int z2;
for(z2=0;z2<columns;z2++)
{
nDelete(&(n[z][z2]));
}
}
omFree(n[z]);
}
}
omfree(n);
}
nDelete
#define nDelete(n)
Definition numbers.h:16
omfree
#define omfree(addr)
Definition omAllocDecl.h:237
omFree
#define omFree(addr)
Definition omAllocDecl.h:261

## Member Function Documentation

## add_lambda_times_row()

void tgb_matrix::add_lambda_times_row | ( | int | add_to,
|  | int | summand,
|  | number | factor )

Definition at line 603 of file tgbgauss.cc.

{
int i;
for(i=0;i<columns;i++)
{
if(!(nIsZero(n[summand][i])))
{
number n1=n[add_to][i];
number n2=nMult(factor,n[summand][i]);
n[add_to][i]=nAdd(n1,n2);
nDelete(&n1);
nDelete(&n2);
}
}
}
factor
CanonicalForm factor
Definition facAbsFact.cc:97
nIsZero
#define nIsZero(n)
Definition numbers.h:19
nAdd
#define nAdd(n1, n2)
Definition numbers.h:18
nMult
#define nMult(n1, n2)
Definition numbers.h:17

## free_row()

void tgb_matrix::free_row | ( | int | row,
|  | BOOLEAN | free_non_zeros = TRUE )

Definition at line 635 of file tgbgauss.cc.

{
int i;
for(i=0;i<columns;i++)
if((free_non_zeros)||(!(nIsZero(n[row][i]))))
nDelete(&(n[row][i]));
omFree(n[row]);
n[row]=NULL;
}
NULL
#define NULL
Definition omList.c:12

## get()

number tgb_matrix::get | ( | int | i,
|  | int | j )

Definition at line 537 of file tgbgauss.cc.

{
assume(i<rows);
assume(j<columns);
return n[i][j];
}
assume
#define assume(x)
Definition mod2.h:389

## get_columns()

int tgb_matrix::get_columns | ( |  | ) |

Definition at line 532 of file tgbgauss.cc.

{
return columns;
}

## get_rows()

int tgb_matrix::get_rows | ( |  | ) |

Definition at line 527 of file tgbgauss.cc.

{
return rows;
}

## is_zero_entry()

BOOLEAN tgb_matrix::is_zero_entry | ( | int | i,
|  | int | j )

Definition at line 544 of file tgbgauss.cc.

{
return (nIsZero(n[i][j]));
}

## min_col_not_zero_in_row()

int tgb_matrix::min_col_not_zero_in_row | ( | int | row | ) |

Definition at line 557 of file tgbgauss.cc.

{
int i;
for(i=0;i<columns;i++)
{
if(!(nIsZero(n[row][i])))
return i;
}
return columns;//error code
}

## mult_row()

void tgb_matrix::mult_row | ( | int | row,
|  | number | factor )

Definition at line 619 of file tgbgauss.cc.

{
if (nIsOne(factor))
return;
int i;
for(i=0;i<columns;i++)
{
if(!(nIsZero(n[row][i])))
{
number n1=n[row][i];
n[row][i]=nMult(n1,factor);
nDelete(&n1);
}
}
}
nIsOne
#define nIsOne(n)
Definition numbers.h:25

## next_col_not_zero()

int tgb_matrix::next_col_not_zero | ( | int | row,
|  | int | pre )

Definition at line 568 of file tgbgauss.cc.

{
int i;
for(i=pre+1;i<columns;i++)
{
if(!(nIsZero(n[row][i])))
return i;
}
return columns;//error code
}

## non_zero_entries()

int tgb_matrix::non_zero_entries | ( | int | row | ) |

Definition at line 590 of file tgbgauss.cc.

{
int i;
int z=0;
for(i=0;i<columns;i++)
{
if(!(nIsZero(n[row][i])))
z++;
}
return z;
}

## perm_rows()

void tgb_matrix::perm_rows | ( | int | i,
|  | int | j )

Definition at line 549 of file tgbgauss.cc.

{
number* h;
h=n[i];
n[i]=n[j];
n[j]=h;
}
h
STATIC_VAR Poly * h
Definition janet.cc:971

## print()

void tgb_matrix::print | ( |  | ) |

Definition at line 498 of file tgbgauss.cc.

{
int i;
int j;
PrintLn();
for(i=0;i<rows;i++)
{
PrintS("(");
for(j=0;j<columns;j++)
{
StringSetS("");
n_Write(n[i][j],currRing->cf);
char *s=StringEndS();
PrintS(s);
omFree(s);
PrintS("\t");
}
PrintS(")\n");
}
}
n_Write
static FORCE_INLINE void n_Write(number n, const coeffs r, const BOOLEAN bShortOut=TRUE)
Definition coeffs.h:594
s
const CanonicalForm int s
Definition facAbsFact.cc:51
currRing
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition polys.cc:13
StringSetS
void StringSetS(const char *st)
Definition reporter.cc:128
PrintS
void PrintS(const char *s)
Definition reporter.cc:288
StringEndS
char * StringEndS()
Definition reporter.cc:151
PrintLn
void PrintLn()
Definition reporter.cc:314

## set()

void tgb_matrix::set | ( | int | i,
|  | int | j,
|  | number | n )

Definition at line 520 of file tgbgauss.cc.

{
assume(i<rows);
assume(j<columns);
n[i][j]=nn;
}

## zero_row()

BOOLEAN tgb_matrix::zero_row | ( | int | row | ) |

Definition at line 579 of file tgbgauss.cc.

{
int i;
for(i=0;i<columns;i++)
{
if(!(nIsZero(n[row][i])))
return FALSE;
}
return TRUE;
}
TRUE
#define TRUE
Definition auxiliary.h:101

## Field Documentation

## columns

int tgb_matrix::columns

private

Definition at line 22 of file tgbgauss.h.

## free_numbers

BOOLEAN tgb_matrix::free_numbers

private

Definition at line 24 of file tgbgauss.h.

## n

number** tgb_matrix::n

private

Definition at line 21 of file tgbgauss.h.

## rows

int tgb_matrix::rows

private

Definition at line 23 of file tgbgauss.h.

The documentation for this class was generated from the following files:

- kernel/GBEngine/tgbgauss.h
- kernel/GBEngine/tgbgauss.cc