Loading...
Searching...
No Matches
gaussReducer Class Reference

`#include <fglmgauss.h>`

## Public Member Functions

| gaussReducer (int dimen)
| ~gaussReducer ()
BOOLEAN | reduce (fglmVector v)
void | store ()
fglmVector | getDependence ()

## Private Attributes

gaussElem * | elems
BOOLEAN * | isPivot
int * | perm
fglmVector | v
fglmVector | p
number | pdenom
int | size
int | max

## Detailed Description

Definition at line 18 of file fglmgauss.h.

## Constructor & Destructor Documentation

## gaussReducer()

gaussReducer::gaussReducer | ( | int | dimen | ) |

Definition at line 57 of file fglmgauss.cc.

{
int k;
size= 0;
max= dimen;
#ifndef HAVE_EXPLICIT_CONSTR
elems= new gaussElem[ max+1 ];
#else
elems= (gaussElem *)omAlloc( (max+1)*sizeof( gaussElem ) );
#endif
isPivot= (BOOLEAN *)omAlloc( (max+1)*sizeof( BOOLEAN ) );
for ( k= max; k > 0; k-- )
isPivot[k]= FALSE;
perm= (int *)omAlloc( (max+1)*sizeof( int ) );
}
BOOLEAN
int BOOLEAN
Definition auxiliary.h:88
FALSE
#define FALSE
Definition auxiliary.h:97
k
int k
Definition cfEzgcd.cc:99
gaussReducer::elems
gaussElem * elems
Definition fglmgauss.h:21
gaussReducer::max
int max
Definition fglmgauss.h:28
gaussReducer::isPivot
BOOLEAN * isPivot
Definition fglmgauss.h:22
gaussReducer::size
int size
Definition fglmgauss.h:27
gaussReducer::perm
int * perm
Definition fglmgauss.h:23
omAlloc
#define omAlloc(size)
Definition omAllocDecl.h:210

## ~gaussReducer()

gaussReducer::~gaussReducer | ( |  | ) |

Definition at line 73 of file fglmgauss.cc.

{
#ifndef HAVE_EXPLICIT_CONSTR
delete [] elems;
#else
int k;
for ( k= size; k > 0; k-- )
elems[k].~gaussElem();
omFreeSize( (ADDRESS)elems, (max+1)*sizeof( gaussElem ) );
#endif
omFreeSize( (ADDRESS)isPivot, (max+1)*sizeof( BOOLEAN ) );
omFreeSize( (ADDRESS)perm, (max+1)*sizeof( int ) );
}
ADDRESS
void * ADDRESS
Definition auxiliary.h:120
omFreeSize
#define omFreeSize(addr, size)
Definition omAllocDecl.h:260

## Member Function Documentation

## getDependence()

fglmVector gaussReducer::getDependence | ( |  | ) |

Definition at line 196 of file fglmgauss.cc.

{
nDelete( & pdenom );
// hier kann p noch gekuerzt werden, je nach Charakteristik
fglmVector result = p;
p= fglmVector();
return ( result );
}
gaussReducer::pdenom
number pdenom
Definition fglmgauss.h:26
gaussReducer::p
fglmVector p
Definition fglmgauss.h:25
result
return result
Definition facAbsBiFact.cc:76
nDelete
#define nDelete(n)
Definition numbers.h:16

## reduce()

BOOLEAN gaussReducer::reduce | ( | fglmVector | v | ) |

Definition at line 89 of file fglmgauss.cc.

{
number fac1, fac2;
number temp;
// Hier ueberlegen, ob thev als referenz, oder wie wann was kopiert usw.
v= thev;
p= fglmVector( size + 1, size + 1 );
// fglmASSERT( pdenom == NULL );
pdenom= nInit( 1 );
number vdenom = v.clearDenom();
if ( ! nIsOne( vdenom ) && ! nIsZero( vdenom ) ) {
p.setelem( p.size(), vdenom );
}
else {
nDelete( & vdenom );
}
number gcd = v.gcd();
if ( ! nIsOne( gcd ) && ! nIsZero( gcd ) ) {
v /= gcd;
number temp= nMult( pdenom, gcd );
nDelete( & pdenom );
pdenom= temp;
}
nDelete( & gcd );
int k;
for ( k= 1; k <= size; k++ ) {
if ( ! v.elemIsZero( perm[k] ) ) {
fac1= elems[k].fac;
fac2= nCopy( v.getconstelem( perm[k] ) );
v.nihilate( fac1, fac2, elems[k].v );
fac1= nMult( fac1, elems[k].pdenom );
temp= nMult( fac2, pdenom );
nDelete( & fac2 );
fac2= temp;
p.nihilate( fac1, fac2, elems[k].p );
temp= nMult( pdenom, elems[k].pdenom );
nDelete( & pdenom );
pdenom= temp;
nDelete( & fac1 );
nDelete( & fac2 );
number gcd = v.gcd();
if ( ! nIsOne( gcd ) && ! nIsZero( gcd ) )
{
v/= gcd;
number temp = nMult( pdenom, gcd );
nDelete( & pdenom );
pdenom= temp;
}
nDelete( & gcd );
gcd= p.gcd();
temp= n_SubringGcd( pdenom, gcd, currRing->cf );
nDelete( & gcd );
gcd= temp;
if ( ! nIsZero( gcd ) && ! nIsOne( gcd ) )
{
p/= gcd;
temp= nDiv( pdenom, gcd );
nDelete( & pdenom );
pdenom= temp;
nNormalize( pdenom );
}
nDelete( & gcd );
}
}
return ( v.isZero() );
}
gaussReducer::v
fglmVector v
Definition fglmgauss.h:24
n_SubringGcd
static FORCE_INLINE number n_SubringGcd(number a, number b, const coeffs r)
Definition coeffs.h:669
nDiv
#define nDiv(a, b)
Definition numbers.h:32
nIsZero
#define nIsZero(n)
Definition numbers.h:19
nCopy
#define nCopy(n)
Definition numbers.h:15
nIsOne
#define nIsOne(n)
Definition numbers.h:25
nNormalize
#define nNormalize(n)
Definition numbers.h:30
nInit
#define nInit(i)
Definition numbers.h:24
nMult
#define nMult(n1, n2)
Definition numbers.h:17
currRing
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition polys.cc:13
gcd
int gcd(int a, int b)
Definition walkSupport.cc:836

## store()

void gaussReducer::store | ( |  | ) |

Definition at line 159 of file fglmgauss.cc.

{
// fglmASSERT( size < max );
// number fac;
// find the pivot-element in v:
size++;
int k= 1;
while ( nIsZero(v.getconstelem(k)) || isPivot[k] ) {
k++;
}
// fglmASSERT( k <= dimen, "Error(1) in fglmDdata::pivot-search");
number pivot= v.getconstelem( k );
int pivotcol = k;
k++;
while ( k <= max ) {
if ( ! nIsZero( v.getconstelem(k) ) && ! isPivot[k] ) {
if ( nGreater( v.getconstelem( k ), pivot ) ) {
pivot= v.getconstelem( k );
pivotcol= k;
}
}
k++;
}
// fglmASSERT( ! nIsZero( pivot ), "Error(2) fglmDdata::Pivotelement ist Null" );
isPivot[ pivotcol ]= TRUE;
perm[size]= pivotcol;
pivot= nCopy( v.getconstelem( pivotcol ) );
#ifndef HAVE_EXPLICIT_CONSTR
elems[size].mac_gaussElem( v, p, pdenom, pivot );
#else
elems[size].gaussElem( v, p, pdenom, pivot );
#endif
}
TRUE
#define TRUE
Definition auxiliary.h:101
pivot
bool pivot(const matrix aMat, const int r1, const int r2, const int c1, const int c2, int *bestR, int *bestC, const ring R)
This code computes a score for each non-zero matrix entry in aMat[r1..r2, c1..c2].
Definition linearAlgebra.cc:68
nGreater
#define nGreater(a, b)
Definition numbers.h:28

## Field Documentation

## elems

gaussElem* gaussReducer::elems

private

Definition at line 21 of file fglmgauss.h.

## isPivot

BOOLEAN* gaussReducer::isPivot

private

Definition at line 22 of file fglmgauss.h.

## max

int gaussReducer::max

private

Definition at line 28 of file fglmgauss.h.

## p

fglmVector gaussReducer::p

private

Definition at line 25 of file fglmgauss.h.

## pdenom

number gaussReducer::pdenom

private

Definition at line 26 of file fglmgauss.h.

## perm

int* gaussReducer::perm

private

Definition at line 23 of file fglmgauss.h.

## size

int gaussReducer::size

private

Definition at line 27 of file fglmgauss.h.

## v

fglmVector gaussReducer::v

private

Definition at line 24 of file fglmgauss.h.

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

- kernel/fglm/fglmgauss.h
- kernel/fglm/fglmgauss.cc