Loading...
Searching...
No Matches
fglmSdata Class Reference

## Public Member Functions

| fglmSdata (const ideal thisIdeal)
| ~fglmSdata ()
BOOLEAN | state () const
int | getBasisSize () const
int | newBasisElem (poly &p)
void | newBorderElem (poly &m, fglmVector v)
BOOLEAN | candidatesLeft () const
fglmSelem | nextCandidate ()
void | updateCandidates ()
int | getEdgeNumber (const poly m) const
poly | getSpanPoly (int number) const
fglmVector | getVectorRep (const poly m)
fglmVector | getBorderDiv (const poly m, int &var) const

## Private Attributes

ideal | theIdeal
int | idelems
int * | varpermutation
int | basisBS
int | basisMax
int | basisSize
polyset | basis
int | borderBS
int | borderMax
int | borderSize
borderElem * | border
List< fglmSelem > | nlist
BOOLEAN | _state

## Detailed Description

Definition at line 336 of file fglmzero.cc.

## Constructor & Destructor Documentation

## fglmSdata()

fglmSdata::fglmSdata | ( | const ideal | thisIdeal | ) |

Definition at line 372 of file fglmzero.cc.

{
// An dieser Stelle kann die BlockSize ( =BS ) noch sinnvoller berechnet
// werden, jenachdem wie das Ideal aussieht.
theIdeal= thisIdeal;
idelems= IDELEMS( theIdeal );
varpermutation = (int*)omAlloc( ((currRing->N)+1)*sizeof(int) );
// Sort ring variables by increasing values (because of weighted orderings)
ideal perm = idMaxIdeal(1);
intvec *iv = idSort(perm,TRUE);
idDelete(&perm);
for(int i = (currRing->N); i > 0; i--) varpermutation[(currRing->N)+1-i] = (*iv)[i-1];
delete iv;
basisBS= 100;
basisMax= basisBS;
basisSize= 0;
basis= (polyset)omAlloc( basisMax*sizeof( poly ) );
borderBS= 100;
borderMax= borderBS;
borderSize= 0;
#ifndef HAVE_EXPLICIT_CONSTR
border= new borderElem[ borderMax ];
#else
border= (borderElem *)omAlloc( borderMax*sizeof( borderElem ) );
#endif
// rem: the constructors are called in newBorderElem().
_state= TRUE;
}
TRUE
#define TRUE
Definition auxiliary.h:101
i
int i
Definition cfEzgcd.cc:132
fglmSdata::basis
polyset basis
Definition fglmzero.cc:346
fglmSdata::basisMax
int basisMax
Definition fglmzero.cc:344
fglmSdata::basisBS
int basisBS
Definition fglmzero.cc:343
fglmSdata::idelems
int idelems
Definition fglmzero.cc:340
fglmSdata::theIdeal
ideal theIdeal
Definition fglmzero.cc:339
fglmSdata::basisSize
int basisSize
Definition fglmzero.cc:345
fglmSdata::borderMax
int borderMax
Definition fglmzero.cc:349
fglmSdata::varpermutation
int * varpermutation
Definition fglmzero.cc:341
fglmSdata::_state
BOOLEAN _state
Definition fglmzero.cc:354
fglmSdata::border
borderElem * border
Definition fglmzero.cc:351
fglmSdata::borderSize
int borderSize
Definition fglmzero.cc:350
fglmSdata::borderBS
int borderBS
Definition fglmzero.cc:348
idDelete
#define idDelete(H)
delete an ideal
Definition ideals.h:29
idMaxIdeal
#define idMaxIdeal(D)
initialise the maximal ideal (at 0)
Definition ideals.h:33
idSort
static intvec * idSort(ideal id, BOOLEAN nolex=TRUE)
Definition ideals.h:188
omAlloc
#define omAlloc(size)
Definition omAllocDecl.h:210
currRing
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition polys.cc:13
polyset
poly * polyset
Definition polys.h:260
IDELEMS
#define IDELEMS(i)
Definition simpleideals.h:23

## ~fglmSdata()

fglmSdata::~fglmSdata | ( |  | ) |

Definition at line 403 of file fglmzero.cc.

{
omFreeSize( (ADDRESS)varpermutation, ((currRing->N)+1)*sizeof(int) );
for ( int k = basisSize; k > 0; k-- )
pLmDelete( basis + k ); //. rem: basis runs from basis[1]..basis[basisSize]
omFreeSize( (ADDRESS)basis, basisMax*sizeof( poly ) );
#ifndef HAVE_EXPLICIT_CONSTR
delete [] border;
#else
for ( int l = borderSize; l > 0; l-- )
// rem: the polys of borderElem are deleted via ~borderElem()
border[l].~borderElem();
omFreeSize( (ADDRESS)border, borderMax*sizeof( borderElem ) );
#endif
}
ADDRESS
void * ADDRESS
Definition auxiliary.h:120
l
int l
Definition cfEzgcd.cc:100
k
int k
Definition cfEzgcd.cc:99
omFreeSize
#define omFreeSize(addr, size)
Definition omAllocDecl.h:260
pLmDelete
#define pLmDelete(p)
assume p != NULL, deletes Lm(p)->coef and Lm(p)
Definition polys.h:77

## Member Function Documentation

## candidatesLeft()

BOOLEAN fglmSdata::candidatesLeft | ( |  | ) | const

inline

Definition at line 363 of file fglmzero.cc.

{ return ( nlist.isEmpty() ? FALSE : TRUE ); }
FALSE
#define FALSE
Definition auxiliary.h:97
fglmSdata::nlist
List< fglmSelem > nlist
Definition fglmzero.cc:353

## getBasisSize()

int fglmSdata::getBasisSize | ( |  | ) | const

inline

Definition at line 360 of file fglmzero.cc.

{ return basisSize; };

## getBorderDiv()

fglmVector fglmSdata::getBorderDiv | ( | const poly | m,
|  | int & | var ) const

Definition at line 578 of file fglmzero.cc.

{
// int num2 = borderSize;
// while ( num2 > 0 ) {
// poly temp = border[num2].monom;
// if ( pDivisibleBy( temp, m ) ) {
// poly divisor = pDivideM( m, temp );
// int var = pIsPurePower( divisor );
// if ( (var != 0) && (pGetCoeff( divisor, var ) == 1) ) {
// Print( "poly %s divides poly %s", pString( temp ), pString( m ) );
// }
// }
// num2--;
// }
int num = borderSize;
while ( num > 0 ) {
poly temp = border[num].monom;
if ( pDivisibleBy( temp, m ) ) {
var = (currRing->N);
while ( var > 0 ) {
if ( (pGetExp( m, var ) - pGetExp( temp, var )) == 1 )
return border[num].nf;
var--;
}
}
num--;
}
return fglmVector();
}
num
CanonicalForm num(const CanonicalForm &f)
Definition canonicalform.h:337
m
int m
Definition cfEzgcd.cc:128
pGetExp
#define pGetExp(p, i)
Exponent.
Definition polys.h:42
pDivisibleBy
#define pDivisibleBy(a, b)
returns TRUE, if leading monom of a divides leading monom of b i.e., if there exists a expvector c > ...
Definition polys.h:139

## getEdgeNumber()

int fglmSdata::getEdgeNumber | ( | const poly | m | ) | const

Definition at line 529 of file fglmzero.cc.

{
for ( int k = idelems; k > 0; k-- )
if ( pLmEqual( m, (theIdeal->m)[k-1] ) )
return k;
return 0;
}
pLmEqual
#define pLmEqual(p1, p2)
Definition polys.h:112

## getSpanPoly()

poly fglmSdata::getSpanPoly | ( | int | number | ) | const

inline

Definition at line 367 of file fglmzero.cc.

{ return pCopy( (theIdeal->m)[number-1] ); }
pCopy
#define pCopy(p)
return a copy of the poly
Definition polys.h:186

## getVectorRep()

fglmVector fglmSdata::getVectorRep | ( | const poly | m | ) |

Definition at line 543 of file fglmzero.cc.

{
fglmVector temp( basisSize );
poly m = p;
int num = basisSize;
while ( m != NULL ) {
int comp = pCmp( m, basis[num] );
if ( comp == 0 ) {
fglmASSERT( num > 0, "Error(1) in fglmSdata::getVectorRep" );
number newelem = nCopy( pGetCoeff( m ) );
temp.setelem( num, newelem );
num--;
pIter( m );
}
else {
if ( comp < 0 ) {
num--;
}
else {
// This is the place where we can detect if the sourceIdeal
// is not reduced. In this case m is not in basis[]. Since basis[]
// is ordered this is the case, if and only if basis[i]<m
// and basis[j]>m for all j>i
_state= FALSE;
return temp;
}
}
}
return temp;
}
p
int p
Definition cfModGcd.cc:4086
comp
int comp(const CanonicalForm &A, const CanonicalForm &B)
compare polynomials
Definition facSparseHensel.h:25
fglmASSERT
#define fglmASSERT(ignore1, ignore2)
Definition fglmzero.cc:52
pIter
#define pIter(p)
Definition monomials.h:37
pGetCoeff
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
Definition monomials.h:44
nCopy
#define nCopy(n)
Definition numbers.h:15
NULL
#define NULL
Definition omList.c:12
pCmp
#define pCmp(p1, p2)
pCmp: args may be NULL returns: (p2==NULL ? 1 : (p1 == NULL ? -1 : p_LmCmp(p1, p2)))
Definition polys.h:116

## newBasisElem()

int fglmSdata::newBasisElem | ( | poly & | p | ) |

Definition at line 424 of file fglmzero.cc.

{
basisSize++;
if ( basisSize == basisMax ) {
basis= (polyset)omReallocSize( basis, basisMax*sizeof( poly ), (basisMax + basisBS)*sizeof( poly ) );
basisMax+= basisBS;
}
basis[basisSize]= m;
m= NULL;
return basisSize;
}
omReallocSize
#define omReallocSize(addr, o_size, size)
Definition omAllocDecl.h:220

## newBorderElem()

void fglmSdata::newBorderElem | ( | poly & | m,
|  | fglmVector | v )

Definition at line 441 of file fglmzero.cc.

{
borderSize++;
if ( borderSize == borderMax ) {
#ifndef HAVE_EXPLICIT_CONSTR
borderElem * tempborder = new borderElem[ borderMax+borderBS ];
for ( int k = 0; k < borderMax; k++ ) {
tempborder[k]= border[k];
border[k].insertElem( NULL, fglmVector() );
}
delete [] border;
border= tempborder;
#else
border= (borderElem *)omReallocSize( border, borderMax*sizeof( borderElem ), (borderMax + borderBS)*sizeof( borderElem ) );
#endif
borderMax+= borderBS;
}
#ifndef HAVE_EXPLICIT_CONSTR
border[borderSize].insertElem( m, v );
#else
border[borderSize].borderElem( m, v );
#endif
m= NULL;
}
v
const Variable & v
< [in] a sqrfree bivariate poly
Definition facBivar.h:39

## nextCandidate()

fglmSelem fglmSdata::nextCandidate | ( |  | ) |

Definition at line 467 of file fglmzero.cc.

{
fglmSelem result = nlist.getFirst();
nlist.removeFirst();
return result;
}
result
return result
Definition facAbsBiFact.cc:76

## state()

BOOLEAN fglmSdata::state | ( |  | ) | const

inline

Definition at line 359 of file fglmzero.cc.

{ return _state; };

## updateCandidates()

void fglmSdata::updateCandidates | ( |  | ) |

Definition at line 479 of file fglmzero.cc.

{
ListIterator<fglmSelem> list = nlist;
fglmASSERT( basisSize > 0 && basisSize < basisMax, "Error(1) in fglmSdata::updateCandidates - wrong bassSize" );
poly m = basis[basisSize];
poly newmonom = NULL;
int k = (currRing->N);
BOOLEAN done = FALSE;
int state = 0;
while ( k >= 1 )
{
newmonom = pCopy( m );
pIncrExp( newmonom, varpermutation[k] );
pSetm( newmonom );
done= FALSE;
while ( list.hasItem() && (!done) )
{
if ( (state= pCmp( list.getItem().monom, newmonom )) < 0 )
list++;
else done= TRUE;
}
if ( !done )
{
nlist.append( fglmSelem( newmonom, varpermutation[k] ) );
break;
}
if ( state == 0 )
{
list.getItem().newDivisor( varpermutation[k] );
pLmDelete(&newmonom);
}
else
{
list.insert( fglmSelem( newmonom, varpermutation[k] ) );
}
k--;
}
while ( --k >= 1 )
{
newmonom= pCopy( m ); // HIER
pIncrExp( newmonom, varpermutation[k] );
pSetm( newmonom );
nlist.append( fglmSelem( newmonom, varpermutation[k] ) );
}
}
BOOLEAN
int BOOLEAN
Definition auxiliary.h:88
ListIterator::hasItem
int hasItem()
Definition ftmpl_list.cc:439
ListIterator::getItem
T & getItem() const
Definition ftmpl_list.cc:431
ListIterator::insert
void insert(const T &)
Definition ftmpl_list.cc:492
fglmSdata::state
BOOLEAN state() const
Definition fglmzero.cc:359
pSetm
#define pSetm(p)
Definition polys.h:272
pIncrExp
#define pIncrExp(p, i)
Definition polys.h:44

## Field Documentation

## _state

BOOLEAN fglmSdata::_state

private

Definition at line 354 of file fglmzero.cc.

## basis

polyset fglmSdata::basis

private

Definition at line 346 of file fglmzero.cc.

## basisBS

int fglmSdata::basisBS

private

Definition at line 343 of file fglmzero.cc.

## basisMax

int fglmSdata::basisMax

private

Definition at line 344 of file fglmzero.cc.

## basisSize

int fglmSdata::basisSize

private

Definition at line 345 of file fglmzero.cc.

## border

borderElem* fglmSdata::border

private

Definition at line 351 of file fglmzero.cc.

## borderBS

int fglmSdata::borderBS

private

Definition at line 348 of file fglmzero.cc.

## borderMax

int fglmSdata::borderMax

private

Definition at line 349 of file fglmzero.cc.

## borderSize

int fglmSdata::borderSize

private

Definition at line 350 of file fglmzero.cc.

## idelems

int fglmSdata::idelems

private

Definition at line 340 of file fglmzero.cc.

## nlist

List<fglmSelem> fglmSdata::nlist

private

Definition at line 353 of file fglmzero.cc.

## theIdeal

ideal fglmSdata::theIdeal

private

Definition at line 339 of file fglmzero.cc.

## varpermutation

int* fglmSdata::varpermutation

private

Definition at line 341 of file fglmzero.cc.

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

- kernel/fglm/fglmzero.cc