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 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++ )
229 fglmReduce( & current, currV,
m, numMonoms, source, weights );
232 while ( temp !=
NULL )
244 if ( basisSize == basisMax )
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 );
274 v[
k].fglmVector( basisSize );
277 while ( mon !=
NULL ) {
289 v[
k].setelem(
b+1, coeff );
300 for (
k= 0;
k < basisSize;
k++ )
309 for (
k= 0;
k < numMonoms;
k++ ) {
310 lengthes[
k]=
v[
k].numNonZeroElems();
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();
344 v[best-1].~fglmVector();
349 number
gcd =
p.gcd();
355 for (
k= 0;
k <
p.size();
k++ ) {
356 if ( !
p.elemIsZero(
k+1 ) ) {
357 temp+=
p.getconstelem(
k+1 ) * mv[order[
k]];
369 for (
k= 1;
k <= numMonoms;
k++ ) {
370 if ( ! temp.elemIsZero(
k ) ) {
390 #ifndef HAVE_EXPLICIT_CONSTR 396 for (
k= 0;
k < basisSize;
k++ )
400 #ifndef HAVE_EXPLICIT_CONSTR 403 for (
k= 0;
k < numMonoms;
k++ )
408 for (
k= 0;
k < numMonoms;
k++ )
fglmVector(fglmVectorRep *rep)
Implementation of class fglmVector
#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)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
#define pLmInit(p)
like pInit, except that expvector is initialized to that of p, p must be != NULL
static unsigned pLength(poly a)
void p_Content(poly ph, const ring r)
const Variable & v
< [in] a sqrfree bivariate poly
bool isZero(const CFArray &A)
checks if entries of A are zero
#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)