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

Function idKeepFirstK

kernel/ideals.cc:3140–3150  ·  view source on GitHub ↗

keeps the first k (>= 1) entries of the given ideal (Note that the kept polynomials may be zero.)

Source from the content-addressed store, hash-verified

3138/// keeps the first k (>= 1) entries of the given ideal
3139/// (Note that the kept polynomials may be zero.)
3140void idKeepFirstK(ideal id, const int k)
3141{
3142 for (int i = IDELEMS(id)-1; i >= k; i--)
3143 {
3144 if (id->m[i] != NULL) pDelete(&id->m[i]);
3145 }
3146 int kk=k;
3147 if (k==0) kk=1; /* ideals must have at least one element(0)*/
3148 pEnlargeSet(&(id->m), IDELEMS(id), kk-IDELEMS(id));
3149 IDELEMS(id) = kk;
3150}
3151
3152typedef struct
3153{

Callers 1

getMinorIdeal_PolyFunction · 0.85

Calls 1

pEnlargeSetFunction · 0.85

Tested by

no test coverage detected