My Project  UNKNOWN_GIT_VERSION
fglmcomb.cc
Go to the documentation of this file.
1 // emacs edit mode for this file is -*- C++ -*-
2 
3 /****************************************
4 * Computer Algebra System SINGULAR *
5 ****************************************/
6 /*
7 * ABSTRACT -
8 */
9 
10 
11 
12 
13 #include "kernel/mod2.h"
14 
15 #include "factory/factory.h"
16 #include "misc/options.h"
17 #include "kernel/polys.h"
18 #include "kernel/ideals.h"
19 #include "polys/monomials/ring.h"
20 #include "polys/monomials/maps.h"
21 #include "omalloc/omalloc.h"
22 #include "fglmvec.h"
23 #include "fglmgauss.h"
24 #include "kernel/GBEngine/kstd1.h"
25 
26 #include "fglm.h"
27 
28 #ifndef NOSTREAMIO
29 # ifdef HAVE_IOSTREAM
30 # include <iostream>
31 # else
32 # include <iostream.h>
33 # endif
34 #endif
35 
36 static void
37 fglmEliminateMonomials( poly * pptr, fglmVector & v, polyset monomials, int numMonoms )
38 {
39  poly temp = *pptr;
40  poly pretemp = NULL;
41  int point = 0;
42  int state;
43 
44  while ( (temp != NULL) && (point < numMonoms) ) {
45  state= pCmp( temp, monomials[point] );
46  if ( state == 0 ) {
47  // Eliminate this monomial
48  poly todelete;
49  if ( pretemp == NULL ) {
50  todelete = temp;
51  pIter( *pptr );
52  temp= *pptr;
53  }
54  else {
55  todelete= temp;
56  pIter( temp );
57  pretemp->next= temp;
58  }
59  pGetCoeff( todelete )= nInpNeg( pGetCoeff( todelete ) );
60  number newelem = nAdd( pGetCoeff( todelete ), v.getconstelem( point+1 ) );
61  v.setelem( point+1, newelem );
62  nDelete( & pGetCoeff( todelete ) );
63  pLmFree( todelete );
64  point++;
65  }
66  else if ( state < 0 )
67  point++;
68  else {
69  pretemp= temp;
70  pIter( temp );
71  }
72  }
73 }
74 
75 static BOOLEAN
76 fglmReductionStep( poly * pptr, ideal source, int * w )
77 {
78 // returns TRUE if the leading monomial was reduced
79  if ( *pptr == NULL ) return FALSE;
80  int k;
81  int best = 0;
82  for ( k= IDELEMS( source ) - 1; k >= 0; k-- ) {
83  if ( pDivisibleBy( (source->m)[k], *pptr ) ) {
84  if ( best == 0 ) {
85  best= k + 1;
86  }
87  else {
88  if ( w[k] < w[best-1] ) {
89  best= k + 1;
90  }
91  }
92  }
93  }
94  if ( best > 0 )
95  {
96  // OwnSPoly
97  poly p2 = (source->m)[best-1];
98  int i, diff;
99 
100  poly m = pOne();
101  for ( i= (currRing->N); i > 0; i-- )
102  {
103  diff= pGetExp( *pptr, i ) - pGetExp( p2, i );
104  pSetExp( m, i, diff );
105  }
106  pSetm( m );
107  number n1 = nCopy( pGetCoeff( *pptr ) );
108  number n2 = pGetCoeff( p2 );
109 
110  p2= pCopy( p2 );
111  pLmDelete(pptr);
112  pLmDelete( & p2 );
113  p2= pMult( m, p2 );
114 
115  number temp = nDiv( n1, n2 );
116  n_Normalize( temp, currRing->cf );
117  nDelete( & n1 );
118  n1= temp;
119  n1= nInpNeg( n1 );
120  p2=__p_Mult_nn( p2, n1, currRing );
121 // pNormalize( p2 );
122  nDelete( & n1 );
123  *pptr= pAdd( *pptr, p2 );
124  }
125  return ( (best > 0) );
126 }
127 
128 static void
129 fglmReduce( poly * pptr, fglmVector & v, polyset m, int numMonoms, ideal source, int * w )
130 {
131  BOOLEAN reduced = FALSE;
132  reduced= fglmReductionStep( pptr, source, w );
133  while ( reduced == TRUE ) {
134  fglmEliminateMonomials( pptr, v, m, numMonoms );
135  reduced= fglmReductionStep( pptr, source, w );
136  }
137  STICKYPROT( "<" );
138  poly temp = * pptr;
139  if ( temp != NULL ) {
140  while ( pNext( temp ) != NULL ) {
141  STICKYPROT( ">" );
142  reduced= fglmReductionStep( & pNext( temp ), source, w );
143  while ( reduced == TRUE ) {
144  fglmEliminateMonomials( & pNext( temp ), v, m, numMonoms );
145  reduced= fglmReductionStep( & pNext( temp ), source, w );
146  }
147  if ( pNext( temp ) != NULL ) {
148  pIter( temp );
149  }
150  }
151  }
152 }
153 
154 poly fglmNewLinearCombination( ideal source, poly monset )
155 {
156  polyset m = NULL;
157  polyset nf = NULL;
158  fglmVector * mv = NULL;
159 
160  fglmVector * v = NULL;
161  polyset basis = NULL;
162  int basisSize = 0;
163  int basisBS = 16;
164  int basisMax = basisBS;
165 
166  int * weights = NULL;
167  int * lengthes = NULL;
168  int * order = NULL;
169 
170  int numMonoms = 0;
171  int k;
172 
173  // get number of monoms
174  numMonoms= pLength( monset );
175  STICKYPROT2( "%i monoms\n", numMonoms );
176 
177  // Allcoate Memory and initialize sets
178  m= (polyset)omAlloc( numMonoms * sizeof( poly ) );
179  poly temp= monset;
180  for ( k= 0; k < numMonoms; k++ ) {
181 // m[k]= pOne();
182 // pSetExpV( m[k], temp->exp );
183 // pSetm( m[k] );
184  m[k]=pLmInit(temp);
185  pSetCoeff( m[k], nInit(1) );
186  pIter( temp );
187  }
188 
189  nf= (polyset)omAlloc( numMonoms * sizeof( poly ) );
190 
191 #ifndef HAVE_EXPLICIT_CONSTR
192  mv= new fglmVector[ numMonoms ];
193 #else
194  mv= (fglmVector *)omAlloc( numMonoms * sizeof( fglmVector ) );
195 #endif
196 
197 #ifndef HAVE_EXPLICIT_CONSTR
198  v= new fglmVector[ numMonoms ];
199 #else
200  v= (fglmVector *)omAlloc( numMonoms * sizeof( fglmVector ) );
201 #endif
202 
203  basisMax= basisBS;
204  basis= (polyset)omAlloc( basisMax * sizeof( poly ) );
205 
206  weights= (int *)omAlloc( IDELEMS( source ) * sizeof( int ) );
207  STICKYPROT( "weights: " );
208  for ( k= 0; k < IDELEMS( source ); k++ ) {
209  poly temp= (source->m)[k];
210  int w = 0;
211  while ( temp != NULL ) {
212  w+= nSize( pGetCoeff( temp ) );
213  pIter( temp );
214  }
215  weights[k]= w;
216  STICKYPROT2( "%i ", w );
217  }
218  STICKYPROT( "\n" );
219  lengthes= (int *)omAlloc( numMonoms * sizeof( int ) );
220  order= (int *)omAlloc( numMonoms * sizeof( int ) );
221 
222  // calculate the NormalForm in a special way
223  for ( k= 0; k < numMonoms; k++ )
224  {
225  STICKYPROT( "#" );
226  poly current = pCopy( m[k] );
227  fglmVector currV( numMonoms, k+1 );
228 
229  fglmReduce( & current, currV, m, numMonoms, source, weights );
230  poly temp = current;
231  int b;
232  while ( temp != NULL )
233  {
234  BOOLEAN found = FALSE;
235  for ( b= 0; (b < basisSize) && (found == FALSE); b++ )
236  {
237  if ( pLmEqual( temp, basis[b] ) )
238  {
239  found= TRUE;
240  }
241  }
242  if ( found == FALSE )
243  {
244  if ( basisSize == basisMax )
245  {
246  // Expand the basis
247  basis= (polyset)omReallocSize( basis, basisMax * sizeof( poly ), (basisMax + basisBS ) * sizeof( poly ) );
248  basisMax+= basisBS;
249  }
250 // basis[basisSize]= pOne();
251 // pSetExpV( basis[basisSize], temp->exp );
252 // pSetm( basis[basisSize] );
253  basis[basisSize]=pLmInit(temp);
254  pSetCoeff( basis[basisSize], nInit(1) );
255  basisSize++;
256  }
257  pIter( temp );
258  }
259  nf[k]= current;
260 #ifndef HAVE_EXPLICIT_CONSTR
261  mv[k].mac_constr( currV );
262 #else
263  mv[k].fglmVector( currV );
264 #endif
265  STICKYPROT( "\n" );
266  }
267  // get the vector representation
268  for ( k= 0; k < numMonoms; k++ ) {
269  STICKYPROT( "." );
270 
271 #ifndef HAVE_EXPLICIT_CONSTR
272  v[k].mac_constr_i( basisSize );
273 #else
274  v[k].fglmVector( basisSize );
275 #endif
276  poly mon= nf[k];
277  while ( mon != NULL ) {
278  BOOLEAN found = FALSE;
279  int b= 0;
280  while ( found == FALSE ) {
281  if ( pLmEqual( mon, basis[b] ) ) {
282  found= TRUE;
283  }
284  else {
285  b++;
286  }
287  }
288  number coeff = nCopy( pGetCoeff( mon ) );
289  v[k].setelem( b+1, coeff );
290  pIter( mon );
291  }
292  pDelete( nf + k );
293  }
294  // Free Memory not needed anymore
295  omFreeSize( (ADDRESS)nf, numMonoms * sizeof( poly ) );
296  omFreeSize( (ADDRESS)weights, IDELEMS( source ) * sizeof( int ) );
297 
298  STICKYPROT2( "\nbasis size: %i\n", basisSize );
299  STICKYPROT( "(clear basis" );
300  for ( k= 0; k < basisSize; k++ )
301  pDelete( basis + k );
302  STICKYPROT( ")\n" );
303  // gauss reduce
304  gaussReducer gauss( basisSize );
305  BOOLEAN isZero = FALSE;
306  fglmVector p;
307 
308  STICKYPROT( "sizes: " );
309  for ( k= 0; k < numMonoms; k++ ) {
310  lengthes[k]= v[k].numNonZeroElems();
311  STICKYPROT2( "%i ", lengthes[k] );
312  }
313  STICKYPROT( "\n" );
314 
315  int act = 0;
316  while ( (isZero == FALSE) && (act < numMonoms) ) {
317  int best = 0;
318  for ( k= numMonoms - 1; k >= 0; k-- ) {
319  if ( lengthes[k] > 0 ) {
320  if ( best == 0 ) {
321  best= k+1;
322  }
323  else {
324  if ( lengthes[k] < lengthes[best-1] ) {
325  best= k+1;
326  }
327  }
328  }
329  }
330  lengthes[best-1]= 0;
331  order[act]= best-1;
332  STICKYPROT2( " (%i) ", best );
333  if ( ( isZero= gauss.reduce( v[best-1] )) == TRUE ) {
334  p= gauss.getDependence();
335  }
336  else {
337  STICKYPROT( "+" );
338  gauss.store();
339  act++;
340  }
341 #ifndef HAVE_EXPLICIT_CONSTR
342  v[best-1].clearelems();
343 #else
344  v[best-1].~fglmVector();
345 #endif
346  }
347  poly result = NULL;
348  if ( isZero == TRUE ) {
349  number gcd = p.gcd();
350  if ( ! nIsZero( gcd ) && ! ( nIsOne( gcd ) ) ) {
351  p/= gcd;
352  }
353  nDelete( & gcd );
354  fglmVector temp( numMonoms );
355  for ( k= 0; k < p.size(); k++ ) {
356  if ( ! p.elemIsZero( k+1 ) ) {
357  temp+= p.getconstelem( k+1 ) * mv[order[k]];
358  }
359  }
360  number denom = temp.clearDenom();
361  nDelete( & denom );
362  gcd = temp.gcd();
363  if ( ! nIsZero( gcd ) && ! nIsOne( gcd ) ) {
364  temp/= gcd;
365  }
366  nDelete( & gcd );
367 
368  poly sum = NULL;
369  for ( k= 1; k <= numMonoms; k++ ) {
370  if ( ! temp.elemIsZero( k ) ) {
371  if ( result == NULL ) {
372  result= pCopy( m[k-1] );
373  sum= result;
374  }
375  else {
376  sum->next= pCopy( m[k-1] );
377  pIter( sum );
378  }
379  pSetCoeff( sum, nCopy( temp.getconstelem( k ) ) );
380  }
381  }
383  }
384  // Free Memory
385  omFreeSize( (ADDRESS)lengthes, numMonoms * sizeof( int ) );
386  omFreeSize( (ADDRESS)order, numMonoms * sizeof( int ) );
387 // for ( k= 0; k < numMonoms; k++ )
388 // v[k].~fglmVector();
389 #ifndef HAVE_EXPLICIT_CONSTR
390  delete [] v;
391 #else
392  omFreeSize( (ADDRESS)v, numMonoms * sizeof( fglmVector ) );
393 #endif
394 
395  for ( k= 0; k < basisSize; k++ )
396  pDelete( basis + k );
397  omFreeSize( (ADDRESS)basis, basisMax * sizeof( poly ) );
398 
399 #ifndef HAVE_EXPLICIT_CONSTR
400  delete [] mv;
401 #else
402  for ( k= 0; k < numMonoms; k++ )
403  mv[k].~fglmVector();
404  omFreeSize( (ADDRESS)mv, numMonoms * sizeof( fglmVector ) );
405 #endif
406 
407  for ( k= 0; k < numMonoms; k++ )
408  pDelete( m + k );
409  omFreeSize( (ADDRESS)m, numMonoms * sizeof( poly ) );
410 
411  STICKYPROT( "\n" );
412  return result;
413 }
414 
415 
416 poly fglmLinearCombination( ideal source, poly monset )
417 {
418  int k;
419  poly temp;
420 
421  polyset m;
422  polyset nf;
423  fglmVector * v;
424 
425  polyset basis;
426  int basisSize = 0;
427  int basisBS = 16;
428  int basisMax;
429  // get number of monomials in monset
430  int numMonoms = 0;
431  temp = monset;
432  while ( temp != NULL ) {
433  numMonoms++;
434  pIter( temp );
435  }
436  // Allocate Memory
437  m= (polyset)omAlloc( numMonoms * sizeof( poly ) );
438  nf= (polyset)omAlloc( numMonoms * sizeof( poly ) );
439  // Warning: The fglmVectors in v are yet not initialized
440  v= (fglmVector *)omAlloc( numMonoms * sizeof( fglmVector ) );
441  basisMax= basisBS;
442  basis= (polyset)omAlloc( basisMax * sizeof( poly ) );
443 
444  // get the NormalForm and the basis monomials
445  temp= monset;
446  for ( k= 0; k < numMonoms; k++ ) {
447  poly mon= pHead( temp );
448  if ( ! nIsOne( pGetCoeff( mon ) ) ) {
449  nDelete( & pGetCoeff( mon ) );
450  pSetCoeff( mon, nInit( 1 ) );
451  }
452  STICKYPROT( "(" );
453  nf[k]= kNF( source, currRing->qideal, mon );
454  STICKYPROT( ")" );
455 
456  // search through basis
457  STICKYPROT( "[" );
458  poly sm = nf[k];
459  while ( sm != NULL ) {
460  BOOLEAN found = FALSE;
461  int b;
462  for ( b= 0; (b < basisSize) && (found == FALSE); b++ )
463  if ( pLmEqual( sm, basis[b] ) ) found= TRUE;
464  if ( found == FALSE ) {
465  // Expand the basis
466  if ( basisSize == basisMax ) {
467  basis= (polyset)omReallocSize( basis, basisMax * sizeof( poly ), (basisMax + basisBS ) * sizeof( poly ) );
468  basisMax+= basisBS;
469  }
470  basis[basisSize]= pHead( sm );
471  nDelete( & pGetCoeff( basis[basisSize] ) );
472  pSetCoeff( basis[basisSize], nInit( 1 ) );
473  basisSize++;
474  }
475  pIter( sm );
476  }
477  STICKYPROT( "]" );
478  m[k]= mon;
479  pIter( temp );
480  }
481  // get the vector representation
482  STICKYPROT2( "(%i)", basisSize );
483  for ( k= 0; k < numMonoms; k++ ) {
484 #ifndef HAVE_EXPLICIT_CONSTR
485  v[k].mac_constr_i( basisSize );
486 #else
487  v[k].fglmVector( basisSize );
488 #endif
489  STICKYPROT( "(+" );
490  poly mon= nf[k];
491  while ( mon != NULL ) {
492  BOOLEAN found = FALSE;
493  int b= 0;
494  while ( found == FALSE ) {
495  if ( pLmEqual( mon, basis[b] ) )
496  found= TRUE;
497  else
498  b++;
499  }
500  number coeff = nCopy( pGetCoeff( mon ) );
501  v[k].setelem( b+1, coeff );
502  pIter( mon );
503  }
504  STICKYPROT( ")" );
505  }
506  // gauss reduce
507  gaussReducer gauss( basisSize );
508  BOOLEAN isZero = FALSE;
509  fglmVector p;
510  for ( k= 0; (k < numMonoms) && (isZero == FALSE); k++ ) {
511  STICKYPROT( "(-" );
512  if ( ( isZero= gauss.reduce( v[k] )) == TRUE )
513  p= gauss.getDependence();
514  else
515  gauss.store();
516  STICKYPROT( ")" );
517  }
518  poly comb = NULL;
519  if ( isZero == TRUE ) {
520  number gcd = p.gcd();
521  if ( ! nIsZero( gcd ) && ! ( nIsOne( gcd ) ) )
522  p/= gcd;
523  nDelete( & gcd );
524  for ( k= 1; k <= p.size(); k++ ) {
525  if ( ! p.elemIsZero( k ) ) {
526  poly temp = pCopy( m[k-1] );
527  pSetCoeff( temp, nCopy( p.getconstelem( k ) ) );
528  comb= pAdd( comb, temp );
529  }
530  }
531  if ( ! nGreaterZero( pGetCoeff( comb ) ) ) comb= pNeg( comb );
532  }
533 
534  // Free Memory
535  for ( k= 0; k < numMonoms; k++ ) {
536  pDelete( m + k );
537  pDelete( nf + k );
538  }
539  omFreeSize( (ADDRESS)m, numMonoms * sizeof( poly ) );
540  omFreeSize( (ADDRESS)nf, numMonoms * sizeof( poly ) );
541  // Warning: At this point all Vectors in v have to be initialized
542  for ( k= numMonoms - 1; k >= 0; k-- ) v[k].~fglmVector();
543  omFreeSize( (ADDRESS)v, numMonoms * sizeof( fglmVector ) );
544  for ( k= 0; k < basisSize; k++ )
545  pDelete( basis + k );
546  omFreeSize( (ADDRESS)basis, basisMax * sizeof( poly ) );
547  STICKYPROT( "\n" );
548  return comb;
549 }
550 
551 // Local Variables: ***
552 // compile-command: "make Singular" ***
553 // page-delimiter: "^\\( \\|//!\\)" ***
554 // fold-internal-margins: nil ***
555 // End: ***
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:132
FALSE
#define FALSE
Definition: auxiliary.h:94
omalloc.h
pLmEqual
#define pLmEqual(p1, p2)
Definition: polys.h:107
fglmVector::clearDenom
number clearDenom()
Definition: fglmvec.cc:502
isZero
bool isZero(const CFArray &A)
checks if entries of A are zero
Definition: facSparseHensel.h:468
k
int k
Definition: cfEzgcd.cc:92
pLmFree
static void pLmFree(poly p)
frees the space of the monomial m, assumes m != NULL coef is not freed, m is not advanced
Definition: polys.h:68
gaussReducer::reduce
BOOLEAN reduce(fglmVector v)
Definition: fglmgauss.cc:89
diff
static gmp_float * diff
Definition: mpr_complex.cc:45
result
return result
Definition: facAbsBiFact.cc:76
nAdd
#define nAdd(n1, n2)
Definition: numbers.h:18
polyset
poly * polyset
Definition: polys.h:243
pGetExp
#define pGetExp(p, i)
Exponent.
Definition: polys.h:40
ADDRESS
void * ADDRESS
Definition: auxiliary.h:133
polys.h
pNeg
#define pNeg(p)
Definition: polys.h:185
options.h
pDelete
#define pDelete(p_ptr)
Definition: polys.h:174
fglmVector
Definition: fglmvec.h:17
fglmNewLinearCombination
poly fglmNewLinearCombination(ideal source, poly monset)
Definition: fglmcomb.cc:154
pMult
#define pMult(p, q)
Definition: polys.h:194
fglmVector::fglmVector
fglmVector(fglmVectorRep *rep)
Definition: fglmvec.cc:152
w
const CanonicalForm & w
Definition: facAbsFact.cc:55
b
CanonicalForm b
Definition: cfModGcd.cc:4044
__p_Mult_nn
#define __p_Mult_nn(p, n, r)
Definition: p_polys.h:913
n_Normalize
static FORCE_INLINE void n_Normalize(number &n, const coeffs r)
inplace-normalization of n; produces some canonical representation of n;
Definition: coeffs.h:577
nf
Definition: gnumpfl.cc:26
found
bool found
Definition: facFactorize.cc:56
nGreaterZero
#define nGreaterZero(n)
Definition: numbers.h:27
pLength
static unsigned pLength(poly a)
Definition: p_polys.h:184
nInpNeg
#define nInpNeg(n)
Definition: numbers.h:21
currRing
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:13
TRUE
#define TRUE
Definition: auxiliary.h:98
i
int i
Definition: cfEzgcd.cc:125
nIsOne
#define nIsOne(n)
Definition: numbers.h:25
act
static scmon act
Definition: hdegree.cc:1078
omFreeSize
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:258
BOOLEAN
int BOOLEAN
Definition: auxiliary.h:85
mod2.h
pOne
#define pOne()
Definition: polys.h:297
fglmgauss.h
gaussReducer
Definition: fglmgauss.h:17
pIter
#define pIter(p)
Definition: monomials.h:35
p_Cleardenom
poly p_Cleardenom(poly p, const ring r)
Definition: p_polys.cc:2779
omAlloc
#define omAlloc(size)
Definition: omAllocDecl.h:208
nDiv
#define nDiv(a, b)
Definition: numbers.h:32
fglmReductionStep
static BOOLEAN fglmReductionStep(poly *pptr, ideal source, int *w)
Definition: fglmcomb.cc:76
maps.h
STICKYPROT
#define STICKYPROT(msg)
Definition: fglm.h:20
fglmReduce
static void fglmReduce(poly *pptr, fglmVector &v, polyset m, int numMonoms, ideal source, int *w)
Definition: fglmcomb.cc:129
kNF
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition: kstd1.cc:2821
gaussReducer::getDependence
fglmVector getDependence()
Definition: fglmgauss.cc:196
pAdd
#define pAdd(p, q)
Definition: polys.h:190
pLmInit
#define pLmInit(p)
like pInit, except that expvector is initialized to that of p, p must be != NULL
Definition: polys.h:62
fglmEliminateMonomials
static void fglmEliminateMonomials(poly *pptr, fglmVector &v, polyset monomials, int numMonoms)
Definition: fglmcomb.cc:37
pSetCoeff
#define pSetCoeff(p, n)
deletes old coeff before setting the new one
Definition: polys.h:30
fglmVector::gcd
number gcd() const
Definition: fglmvec.cc:458
nIsZero
#define nIsZero(n)
Definition: numbers.h:19
ring.h
kstd1.h
gaussReducer::store
void store()
Definition: fglmgauss.cc:159
m
int m
Definition: cfEzgcd.cc:121
NULL
#define NULL
Definition: omList.c:9
pLmDelete
#define pLmDelete(p)
assume p != NULL, deletes Lm(p)->coef and Lm(p)
Definition: polys.h:74
pSetm
#define pSetm(p)
Definition: polys.h:254
ideals.h
fglmVector::getconstelem
number getconstelem(int i) const
Definition: fglmvec.cc:446
nDelete
#define nDelete(n)
Definition: numbers.h:16
STICKYPROT2
#define STICKYPROT2(msg, arg)
Definition: fglm.h:22
gcd
int gcd(int a, int b)
Definition: walkSupport.cc:836
pSetExp
#define pSetExp(p, i, v)
Definition: polys.h:41
v
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
p
int p
Definition: cfModGcd.cc:4019
fglmvec.h
nInit
#define nInit(i)
Definition: numbers.h:24
pCopy
#define pCopy(p)
return a copy of the poly
Definition: polys.h:173
IDELEMS
#define IDELEMS(i)
Definition: simpleideals.h:24
pHead
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL
Definition: polys.h:65
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:42
fglm.h
nCopy
#define nCopy(n)
Definition: numbers.h:15
fglmLinearCombination
poly fglmLinearCombination(ideal source, poly monset)
Definition: fglmcomb.cc:416
pNext
#define pNext(p)
Definition: monomials.h:34
pCmp
#define pCmp(p1, p2)
pCmp: args may be NULL returns: (p2==NULL ? 1 : (p1 == NULL ? -1 : p_LmCmp(p1, p2)))
Definition: polys.h:111
nSize
#define nSize(n)
Definition: numbers.h:39
fglmVector::elemIsZero
int elemIsZero(int i)
Definition: fglmvec.cc:300
omReallocSize
#define omReallocSize(addr, o_size, size)
Definition: omAllocDecl.h:218