163 int basisMax = basisBS;
165 int * weights =
NULL;
166 int * lengthes =
NULL;
179 for ( k= 0; k < numMonoms; k++ ) {
190 #ifndef HAVE_EXPLICIT_CONSTR 196 #ifndef HAVE_EXPLICIT_CONSTR 207 for ( k= 0; k <
IDELEMS( source ); k++ ) {
208 poly temp= (source->m)[k];
210 while ( temp !=
NULL ) {
218 lengthes= (
int *)
omAlloc( numMonoms *
sizeof(
int ) );
219 order= (
int *)
omAlloc( numMonoms *
sizeof(
int ) );
222 for ( k= 0; k < numMonoms; k++ )
225 poly current =
pCopy( m[k] );
228 fglmReduce( & current, currV, m, numMonoms, source, weights );
231 while ( temp !=
NULL )
234 for ( b= 0; (b < basisSize) && (found ==
FALSE); b++ )
241 if ( found ==
FALSE )
243 if ( basisSize == basisMax )
246 basis= (
polyset)
omReallocSize( basis, basisMax *
sizeof( poly ), (basisMax + basisBS ) *
sizeof( poly ) );
252 basis[basisSize]=
pLmInit(temp);
259 #ifndef HAVE_EXPLICIT_CONSTR 260 mv[
k].mac_constr( currV );
267 for ( k= 0; k < numMonoms; k++ ) {
270 #ifndef HAVE_EXPLICIT_CONSTR 271 v[
k].mac_constr_i( basisSize );
276 while ( mon !=
NULL ) {
279 while ( found ==
FALSE ) {
299 for ( k= 0; k < basisSize; k++ )
308 for ( k= 0; k < numMonoms; k++ ) {
315 while ( (isZero ==
FALSE) && (act < numMonoms) ) {
317 for ( k= numMonoms - 1; k >= 0; k-- ) {
318 if ( lengthes[k] > 0 ) {
323 if ( lengthes[k] < lengthes[best-1] ) {
332 if ( ( isZero= gauss.reduce( v[best-1] )) ==
TRUE ) {
333 p= gauss.getDependence();
340 #ifndef HAVE_EXPLICIT_CONSTR 341 v[best-1].clearelems();
347 if ( isZero ==
TRUE ) {
354 for ( k= 0; k < p.
size(); k++ ) {
368 for ( k= 1; k <= numMonoms; k++ ) {
369 if ( ! temp.elemIsZero( k ) ) {
370 if ( result ==
NULL ) {
371 result=
pCopy( m[k-1] );
375 sum->next=
pCopy( m[k-1] );
388 #ifndef HAVE_EXPLICIT_CONSTR 394 for ( k= 0; k < basisSize; k++ )
398 #ifndef HAVE_EXPLICIT_CONSTR 401 for ( k= 0; k < numMonoms; k++ )
406 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)