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
| 55 | // ideal will be reduced as well. |
| 56 | // Assumes that currRing == sourceRing |
| 57 | ideal 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 |
no test coverage detected