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

Function fglmUpdatesource

Singular/fglm.cc:57–82  ·  view source on GitHub ↗

Has to be called, if currRing->qideal != NULL. ( i.e. qring-case ) Then a new ideal is build, consisting of the generators of sourceIdeal and the generators of currRing->qideal, which are completely reduced by the sourceIdeal. This means: If sourceIdeal is reduced, then the new ideal will be reduced as well. Assumes that currRing == sourceRing

Source from the content-addressed store, hash-verified

55// ideal will be reduced as well.
56// Assumes that currRing == sourceRing
57ideal fglmUpdatesource( const ideal sourceIdeal )
58{
59 int k, l, offset;
60 BOOLEAN found;
61 ideal newSource= idInit( IDELEMS( sourceIdeal ) + IDELEMS( currRing->qideal ), 1 );
62 for ( k= IDELEMS( sourceIdeal )-1; k >=0; k-- )
63 (newSource->m)[k]= pCopy( (sourceIdeal->m)[k] );
64 offset= IDELEMS( sourceIdeal );
65 for ( l= IDELEMS( currRing->qideal )-1; l >= 0; l-- )
66 {
67 if ( (currRing->qideal->m)[l] != NULL )
68 {
69 found= FALSE;
70 for ( k= IDELEMS( sourceIdeal )-1; (k >= 0) && (found == FALSE); k-- )
71 if ( pDivisibleBy( (sourceIdeal->m)[k], (currRing->qideal->m)[l] ) )
72 found= TRUE;
73 if ( ! found )
74 {
75 (newSource->m)[offset]= pCopy( (currRing->qideal->m)[l] );
76 offset++;
77 }
78 }
79 }
80 idSkipZeroes( newSource );
81 return newSource;
82}
83
84// Has to be called, if currRing->qideal != NULL, i.e. in qring-case.
85// Gets rid of the elements of result which are contained in

Callers 1

fglmProcFunction · 0.85

Calls 2

idInitFunction · 0.85
idSkipZeroesFunction · 0.85

Tested by

no test coverage detected