My Project  debian-1:4.1.1-p2+ds-4build4
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 338 of file fglmzero.cc.

Constructor & Destructor Documentation

◆ fglmSdata()

fglmSdata::fglmSdata ( const ideal  thisIdeal)

Definition at line 374 of file fglmzero.cc.

375 {
376  // An dieser Stelle kann die BlockSize ( =BS ) noch sinnvoller berechnet
377  // werden, jenachdem wie das Ideal aussieht.
378  theIdeal= thisIdeal;
380  varpermutation = (int*)omAlloc( ((currRing->N)+1)*sizeof(int) );
381  // Sort ring variables by increasing values (because of weighted orderings)
382  ideal perm = idMaxIdeal(1);
383  intvec *iv = idSort(perm,TRUE);
384  idDelete(&perm);
385  for(int i = (currRing->N); i > 0; i--) varpermutation[(currRing->N)+1-i] = (*iv)[i-1];
386  delete iv;
387 
388  basisBS= 100;
389  basisMax= basisBS;
390  basisSize= 0;
391  basis= (polyset)omAlloc( basisMax*sizeof( poly ) );
392 
393  borderBS= 100;
395  borderSize= 0;
396 #ifndef HAVE_EXPLICIT_CONSTR
397  border= new borderElem[ borderMax ];
398 #else
399  border= (borderElem *)omAlloc( borderMax*sizeof( borderElem ) );
400 #endif
401  // rem: the constructors are called in newBorderElem().
402  _state= TRUE;
403 }
#define TRUE
Definition: auxiliary.h:98
int i
Definition: cfEzgcd.cc:125
The old basis.
Definition: fglmzero.cc:302
polyset basis
Definition: fglmzero.cc:348
int basisMax
Definition: fglmzero.cc:346
int basisBS
Definition: fglmzero.cc:345
int idelems
Definition: fglmzero.cc:342
ideal theIdeal
Definition: fglmzero.cc:341
int basisSize
Definition: fglmzero.cc:347
int borderMax
Definition: fglmzero.cc:351
int * varpermutation
Definition: fglmzero.cc:343
BOOLEAN _state
Definition: fglmzero.cc:356
borderElem * border
Definition: fglmzero.cc:353
int borderSize
Definition: fglmzero.cc:352
int borderBS
Definition: fglmzero.cc:350
Definition: intvec.h:21
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
static intvec * idSort(ideal id, BOOLEAN nolex=TRUE)
Definition: ideals.h:186
#define idMaxIdeal(D)
initialise the maximal ideal (at 0)
Definition: ideals.h:33
#define omAlloc(size)
Definition: omAllocDecl.h:210
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:246
#define IDELEMS(i)
Definition: simpleideals.h:24

◆ ~fglmSdata()

fglmSdata::~fglmSdata ( )

Definition at line 405 of file fglmzero.cc.

406 {
407  omFreeSize( (ADDRESS)varpermutation, ((currRing->N)+1)*sizeof(int) );
408  for ( int k = basisSize; k > 0; k-- )
409  pLmDelete( basis + k ); //. rem: basis runs from basis[1]..basis[basisSize]
410  omFreeSize( (ADDRESS)basis, basisMax*sizeof( poly ) );
411 #ifndef HAVE_EXPLICIT_CONSTR
412  delete [] border;
413 #else
414  for ( int l = borderSize; l > 0; l-- )
415  // rem: the polys of borderElem are deleted via ~borderElem()
416  border[l].~borderElem();
418 #endif
419 }
void * ADDRESS
Definition: auxiliary.h:133
int l
Definition: cfEzgcd.cc:93
int k
Definition: cfEzgcd.cc:92
#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 365 of file fglmzero.cc.

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

◆ getBasisSize()

int fglmSdata::getBasisSize ( ) const
inline

Definition at line 362 of file fglmzero.cc.

362 { return basisSize; };

◆ getBorderDiv()

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

Definition at line 580 of file fglmzero.cc.

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

◆ getEdgeNumber()

int fglmSdata::getEdgeNumber ( const poly  m) const

Definition at line 531 of file fglmzero.cc.

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

◆ getSpanPoly()

poly fglmSdata::getSpanPoly ( int  number) const
inline

Definition at line 369 of file fglmzero.cc.

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

◆ getVectorRep()

fglmVector fglmSdata::getVectorRep ( const poly  m)

Definition at line 545 of file fglmzero.cc.

546 {
547  fglmVector temp( basisSize );
548  poly m = p;
549  int num = basisSize;
550  while ( m != NULL ) {
551  int comp = pCmp( m, basis[num] );
552  if ( comp == 0 ) {
553  fglmASSERT( num > 0, "Error(1) in fglmSdata::getVectorRep" );
554  number newelem = nCopy( pGetCoeff( m ) );
555  temp.setelem( num, newelem );
556  num--;
557  pIter( m );
558  }
559  else {
560  if ( comp < 0 ) {
561  num--;
562  }
563  else {
564  // This is the place where we can detect if the sourceIdeal
565  // is not reduced. In this case m is not in basis[]. Since basis[]
566  // is ordered this is the case, if and only if basis[i]<m
567  // and basis[j]>m for all j>i
568  _state= FALSE;
569  return temp;
570  }
571  }
572  }
573  return temp;
574 }
int p
Definition: cfModGcd.cc:4019
int comp(const CanonicalForm &A, const CanonicalForm &B)
compare polynomials
#define fglmASSERT(ignore1, ignore2)
Definition: fglmzero.cc:54
#define pIter(p)
Definition: monomials.h:44
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
Definition: monomials.h:51
#define nCopy(n)
Definition: numbers.h:16
#define NULL
Definition: omList.c:10
#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 426 of file fglmzero.cc.

427 {
428  basisSize++;
429  if ( basisSize == basisMax ) {
430  basis= (polyset)omReallocSize( basis, basisMax*sizeof( poly ), (basisMax + basisBS)*sizeof( poly ) );
431  basisMax+= basisBS;
432  }
433  basis[basisSize]= m;
434  m= NULL;
435  return basisSize;
436 }
#define omReallocSize(addr, o_size, size)
Definition: omAllocDecl.h:220

◆ newBorderElem()

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

Definition at line 443 of file fglmzero.cc.

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

◆ nextCandidate()

fglmSelem fglmSdata::nextCandidate ( )

Definition at line 469 of file fglmzero.cc.

470 {
472  nlist.removeFirst();
473  return result;
474 }
T getFirst() const
Definition: ftmpl_list.cc:279
void removeFirst()
Definition: ftmpl_list.cc:287
Definition: fglm.h:28
return result
Definition: facAbsBiFact.cc:76

◆ state()

BOOLEAN fglmSdata::state ( ) const
inline

Definition at line 361 of file fglmzero.cc.

361 { return _state; };

◆ updateCandidates()

void fglmSdata::updateCandidates ( )

Definition at line 481 of file fglmzero.cc.

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

Field Documentation

◆ _state

BOOLEAN fglmSdata::_state
private

Definition at line 356 of file fglmzero.cc.

◆ basis

polyset fglmSdata::basis
private

Definition at line 348 of file fglmzero.cc.

◆ basisBS

int fglmSdata::basisBS
private

Definition at line 345 of file fglmzero.cc.

◆ basisMax

int fglmSdata::basisMax
private

Definition at line 346 of file fglmzero.cc.

◆ basisSize

int fglmSdata::basisSize
private

Definition at line 347 of file fglmzero.cc.

◆ border

borderElem* fglmSdata::border
private

Definition at line 353 of file fglmzero.cc.

◆ borderBS

int fglmSdata::borderBS
private

Definition at line 350 of file fglmzero.cc.

◆ borderMax

int fglmSdata::borderMax
private

Definition at line 351 of file fglmzero.cc.

◆ borderSize

int fglmSdata::borderSize
private

Definition at line 352 of file fglmzero.cc.

◆ idelems

int fglmSdata::idelems
private

Definition at line 342 of file fglmzero.cc.

◆ nlist

List<fglmSelem> fglmSdata::nlist
private

Definition at line 355 of file fglmzero.cc.

◆ theIdeal

ideal fglmSdata::theIdeal
private

Definition at line 341 of file fglmzero.cc.

◆ varpermutation

int* fglmSdata::varpermutation
private

Definition at line 343 of file fglmzero.cc.


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