My Project
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes
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
 
borderElemborder
 
List< fglmSelemnlist
 
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.

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

◆ ~fglmSdata()

fglmSdata::~fglmSdata ( )

Definition at line 403 of file fglmzero.cc.

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

Member Function Documentation

◆ candidatesLeft()

BOOLEAN fglmSdata::candidatesLeft ( ) const
inline

Definition at line 363 of file fglmzero.cc.

363{ return ( nlist.isEmpty() ? FALSE : TRUE ); }
#define FALSE
Definition: auxiliary.h:96
int isEmpty() const
Definition: ftmpl_list.cc:267
List< fglmSelem > nlist
Definition: fglmzero.cc:353

◆ getBasisSize()

int fglmSdata::getBasisSize ( ) const
inline

Definition at line 360 of file fglmzero.cc.

360{ return basisSize; };

◆ getBorderDiv()

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

Definition at line 578 of file fglmzero.cc.

579{
580// int num2 = borderSize;
581// while ( num2 > 0 ) {
582// poly temp = border[num2].monom;
583// if ( pDivisibleBy( temp, m ) ) {
584// poly divisor = pDivideM( m, temp );
585// int var = pIsPurePower( divisor );
586// if ( (var != 0) && (pGetCoeff( divisor, var ) == 1) ) {
587// Print( "poly %s divides poly %s", pString( temp ), pString( m ) );
588// }
589// }
590// num2--;
591// }
592 int num = borderSize;
593 while ( num > 0 ) {
594 poly temp = border[num].monom;
595 if ( pDivisibleBy( temp, m ) ) {
596 var = (currRing->N);
597 while ( var > 0 ) {
598 if ( (pGetExp( m, var ) - pGetExp( temp, var )) == 1 )
599 return border[num].nf;
600 var--;
601 }
602 }
603 num--;
604 }
605 return fglmVector();
606}
CanonicalForm num(const CanonicalForm &f)
int m
Definition: cfEzgcd.cc:128
poly monom
Definition: fglmzero.cc:302
#define pGetExp(p, i)
Exponent.
Definition: polys.h:41
#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:138
Definition: gnumpfl.cc:25

◆ getEdgeNumber()

int fglmSdata::getEdgeNumber ( const poly  m) const

Definition at line 529 of file fglmzero.cc.

530{
531 for ( int k = idelems; k > 0; k-- )
532 if ( pLmEqual( m, (theIdeal->m)[k-1] ) )
533 return k;
534 return 0;
535}
#define pLmEqual(p1, p2)
Definition: polys.h:111

◆ getSpanPoly()

poly fglmSdata::getSpanPoly ( int  number) const
inline

Definition at line 367 of file fglmzero.cc.

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

◆ getVectorRep()

fglmVector fglmSdata::getVectorRep ( const poly  m)

Definition at line 543 of file fglmzero.cc.

544{
545 fglmVector temp( basisSize );
546 poly m = p;
547 int num = basisSize;
548 while ( m != NULL ) {
549 int comp = pCmp( m, basis[num] );
550 if ( comp == 0 ) {
551 fglmASSERT( num > 0, "Error(1) in fglmSdata::getVectorRep" );
552 number newelem = nCopy( pGetCoeff( m ) );
553 temp.setelem( num, newelem );
554 num--;
555 pIter( m );
556 }
557 else {
558 if ( comp < 0 ) {
559 num--;
560 }
561 else {
562 // This is the place where we can detect if the sourceIdeal
563 // is not reduced. In this case m is not in basis[]. Since basis[]
564 // is ordered this is the case, if and only if basis[i]<m
565 // and basis[j]>m for all j>i
566 _state= FALSE;
567 return temp;
568 }
569 }
570 }
571 return temp;
572}
int p
Definition: cfModGcd.cc:4078
int comp(const CanonicalForm &A, const CanonicalForm &B)
compare polynomials
#define fglmASSERT(ignore1, ignore2)
Definition: fglmzero.cc:52
#define pIter(p)
Definition: monomials.h:37
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
#define nCopy(n)
Definition: numbers.h:15
#define NULL
Definition: omList.c:12
#define pCmp(p1, p2)
pCmp: args may be NULL returns: (p2==NULL ? 1 : (p1 == NULL ? -1 : p_LmCmp(p1, p2)))
Definition: polys.h:115

◆ newBasisElem()

int fglmSdata::newBasisElem ( poly &  p)

Definition at line 424 of file fglmzero.cc.

425{
426 basisSize++;
427 if ( basisSize == basisMax ) {
428 basis= (polyset)omReallocSize( basis, basisMax*sizeof( poly ), (basisMax + basisBS)*sizeof( poly ) );
430 }
431 basis[basisSize]= m;
432 m= NULL;
433 return basisSize;
434}
#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.

442{
443 borderSize++;
444 if ( borderSize == borderMax ) {
445#ifndef HAVE_EXPLICIT_CONSTR
446 borderElem * tempborder = new borderElem[ borderMax+borderBS ];
447 for ( int k = 0; k < borderMax; k++ ) {
448 tempborder[k]= border[k];
449 border[k].insertElem( NULL, fglmVector() );
450 }
451 delete [] border;
452 border= tempborder;
453#else
455#endif
457 }
458#ifndef HAVE_EXPLICIT_CONSTR
459 border[borderSize].insertElem( m, v );
460#else
462#endif
463 m= NULL;
464}
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:39

◆ nextCandidate()

fglmSelem fglmSdata::nextCandidate ( )

Definition at line 467 of file fglmzero.cc.

468{
471 return result;
472}
T getFirst() const
Definition: ftmpl_list.cc:279
void removeFirst()
Definition: ftmpl_list.cc:287
Definition: fglm.h:28
return result
Definition: facAbsBiFact.cc:75

◆ state()

BOOLEAN fglmSdata::state ( ) const
inline

Definition at line 359 of file fglmzero.cc.

359{ return _state; };

◆ updateCandidates()

void fglmSdata::updateCandidates ( )

Definition at line 479 of file fglmzero.cc.

480{
482 fglmASSERT( basisSize > 0 && basisSize < basisMax, "Error(1) in fglmSdata::updateCandidates - wrong bassSize" );
483 poly m = basis[basisSize];
484 poly newmonom = NULL;
485 int k = (currRing->N);
486 BOOLEAN done = FALSE;
487 int state = 0;
488 while ( k >= 1 )
489 {
490 newmonom = pCopy( m );
491 pIncrExp( newmonom, varpermutation[k] );
492 pSetm( newmonom );
493 done= FALSE;
494 while ( list.hasItem() && (!done) )
495 {
496 if ( (state= pCmp( list.getItem().monom, newmonom )) < 0 )
497 list++;
498 else done= TRUE;
499 }
500 if ( !done )
501 {
502 nlist.append( fglmSelem( newmonom, varpermutation[k] ) );
503 break;
504 }
505 if ( state == 0 )
506 {
507 list.getItem().newDivisor( varpermutation[k] );
508 pLmDelete(&newmonom);
509 }
510 else
511 {
512 list.insert( fglmSelem( newmonom, varpermutation[k] ) );
513 }
514 k--;
515 }
516 while ( --k >= 1 )
517 {
518 newmonom= pCopy( m ); // HIER
519 pIncrExp( newmonom, varpermutation[k] );
520 pSetm( newmonom );
521 nlist.append( fglmSelem( newmonom, varpermutation[k] ) );
522 }
523}
int BOOLEAN
Definition: auxiliary.h:87
T & getItem() const
Definition: ftmpl_list.cc:431
void insert(const T &)
Definition: ftmpl_list.cc:492
void append(const T &)
Definition: ftmpl_list.cc:256
BOOLEAN state() const
Definition: fglmzero.cc:359
#define pSetm(p)
Definition: polys.h:271
#define pIncrExp(p, i)
Definition: polys.h:43

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: