164 int basisMax = basisBS;
166 int * weights =
NULL;
167 int * lengthes =
NULL;
180 for ( k= 0; k < numMonoms; k++ ) {
191 #ifndef HAVE_EXPLICIT_CONSTR 197 #ifndef HAVE_EXPLICIT_CONSTR 208 for ( k= 0; k <
IDELEMS( source ); k++ ) {
209 poly temp= (source->m)[k];
211 while ( temp !=
NULL ) {
219 lengthes= (
int *)
omAlloc( numMonoms *
sizeof(
int ) );
220 order= (
int *)
omAlloc( numMonoms *
sizeof(
int ) );
223 for ( k= 0; k < numMonoms; k++ )
226 poly current =
pCopy( m[k] );
229 fglmReduce( & current, currV, m, numMonoms, source, weights );
232 while ( temp !=
NULL )
235 for ( b= 0; (b < basisSize) && (found ==
FALSE); b++ )
242 if ( found ==
FALSE )
244 if ( basisSize == basisMax )
247 basis= (
polyset)
omReallocSize( basis, basisMax *
sizeof( poly ), (basisMax + basisBS ) *
sizeof( poly ) );
253 basis[basisSize]=
pLmInit(temp);
260 #ifndef HAVE_EXPLICIT_CONSTR 261 mv[
k].mac_constr( currV );
268 for ( k= 0; k < numMonoms; k++ ) {
271 #ifndef HAVE_EXPLICIT_CONSTR 272 v[
k].mac_constr_i( basisSize );
277 while ( mon !=
NULL ) {
280 while ( found ==
FALSE ) {
300 for ( k= 0; k < basisSize; k++ )
309 for ( k= 0; k < numMonoms; k++ ) {
316 while ( (isZero ==
FALSE) && (act < numMonoms) ) {
318 for ( k= numMonoms - 1; k >= 0; k-- ) {
319 if ( lengthes[k] > 0 ) {
324 if ( lengthes[k] < lengthes[best-1] ) {
333 if ( ( isZero= gauss.reduce( v[best-1] )) ==
TRUE ) {
334 p= gauss.getDependence();
341 #ifndef HAVE_EXPLICIT_CONSTR 342 v[best-1].clearelems();
348 if ( isZero ==
TRUE ) {
355 for ( k= 0; k < p.
size(); k++ ) {
369 for ( k= 1; k <= numMonoms; k++ ) {
370 if ( ! temp.elemIsZero( k ) ) {
371 if ( result ==
NULL ) {
372 result=
pCopy( m[k-1] );
376 sum->next=
pCopy( m[k-1] );
389 #ifndef HAVE_EXPLICIT_CONSTR 395 for ( k= 0; k < basisSize; k++ )
399 #ifndef HAVE_EXPLICIT_CONSTR 402 for ( k= 0; k < numMonoms; k++ )
407 for ( k= 0; k < numMonoms; k++ )
int numNonZeroElems() const
fglmVector(fglmVectorRep *rep)
Implementation of class fglmVector
number getconstelem(int i) const
#define omFreeSize(addr, size)
static void fglmReduce(poly *pptr, fglmVector &v, polyset m, int numMonoms, ideal source, int *w)
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
#define omReallocSize(addr, o_size, size)
#define pLmInit(p)
like pInit, except that expvector is initialized to that of p, p must be != NULL
static unsigned pLength(poly a)
const Variable & v
< [in] a sqrfree bivariate poly
void setelem(int i, number &n)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
bool isZero(const CFArray &A)
checks if entries of A are zero
poly p_Cleardenom(poly p, const ring r)
#define pSetCoeff(p, n)
deletes old coeff before setting the new one
#define pCopy(p)
return a copy of the poly
#define STICKYPROT2(msg, arg)