MCPcopy Create free account
hub / github.com/Singular/Singular / getVectorRep

Method getVectorRep

kernel/fglm/fglmzero.cc:542–572  ·  view source on GitHub ↗

Returns the fglmVector v, s.t. p = v[1]*basis(1) + .. + v[basisSize]*basis(basisSize) So the size of v depends on the current size of the basis. Assumes that such an representation exists, i.e. all monoms in p have to be smaller than basis[basisSize] and that basis[k] < basis[l] for k < l.

Source from the content-addressed store, hash-verified

540// Assumes that such an representation exists, i.e. all monoms in p have to be
541// smaller than basis[basisSize] and that basis[k] < basis[l] for k < l.
542fglmVector
543fglmSdata::getVectorRep( const poly p )
544{
545 fglmVector temp( basisSize );
546 poly m = p;
547 int num = basisSize;
548 while ( m != NULL ) {
549 int comp = pCmp( m, basis[num] );
550 if ( comp == 0 ) {
551 fglmASSERT( num > 0, "Error(1) in fglmSdata::getVectorRep" );
552 number newelem = nCopy( pGetCoeff( m ) );
553 temp.setelem( num, newelem );
554 num--;
555 pIter( m );
556 }
557 else {
558 if ( comp < 0 ) {
559 num--;
560 }
561 else {
562 // This is the place where we can detect if the sourceIdeal
563 // is not reduced. In this case m is not in basis[]. Since basis[]
564 // is ordered this is the case, if and only if basis[i]<m
565 // and basis[j]>m for all j>i
566 _state= FALSE;
567 return temp;
568 }
569 }
570 }
571 return temp;
572}
573
574// Searches through the border for a monomial bm which divides m and returns
575// its normalform in vector representation.

Callers 2

CalculateFunctionalsFunction · 0.80

Calls 1

setelemMethod · 0.45

Tested by

no test coverage detected