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

Function id_DelMultiples

libpolys/polys/simpleideals.cc:295–326  ·  view source on GitHub ↗

ideal id = (id[i]), c any unit if id[i] = c*id[j] then id[j] is deleted for j > i

Source from the content-addressed store, hash-verified

293/// ideal id = (id[i]), c any unit
294/// if id[i] = c*id[j] then id[j] is deleted for j > i
295void id_DelMultiples(ideal id, const ring r)
296{
297 id_Test(id, r);
298
299 int i, j;
300 int k = IDELEMS(id)-1;
301 for (i=k; i>=0; i--)
302 {
303 if (id->m[i]!=NULL)
304 {
305 for (j=k; j>i; j--)
306 {
307 if (id->m[j]!=NULL)
308 {
309 if (rField_is_Ring(r))
310 {
311 /* if id[j] = c*id[i] then delete id[j].
312 In the below cases of a ground field, we
313 check whether id[i] = c*id[j] and, if so,
314 delete id[j] for historical reasons (so
315 that previous output does not change) */
316 if (p_ComparePolys(id->m[j], id->m[i],r)) p_Delete(&id->m[j],r);
317 }
318 else
319 {
320 if (p_ComparePolys(id->m[i], id->m[j],r)) p_Delete(&id->m[j],r);
321 }
322 }
323 }
324 }
325 }
326}
327
328/// ideal id = (id[i])
329/// if id[i] = id[j] then id[j] is deleted for j > i

Callers 4

id_CompactifyFunction · 0.85
jjSIMPL_IDFunction · 0.85
idSyzygies_printFunction · 0.85
idSyzygiesFunction · 0.85

Calls 2

p_ComparePolysFunction · 0.85
p_DeleteFunction · 0.85

Tested by

no test coverage detected