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

Function p_MinPolyNormalize

libpolys/polys/monomials/maps.cc:430–457  ·  view source on GitHub ↗

This is a very dirty way to cancel monoms whose number equals the MinPoly

Source from the content-addressed store, hash-verified

428// This is a very dirty way to cancel monoms whose number equals the
429// MinPoly
430poly p_MinPolyNormalize(poly p, const ring r)
431{
432 const coeffs C = r->cf;
433 number one = n_Init(1, C);
434 spolyrec rp;
435
436 poly q = &rp;
437
438 while (p != NULL)
439 {
440 // this returns 0, if p == MinPoly
441 number product = n_Mult(p_GetCoeff(p, r), one, C);
442 if ((product == NULL)||(n_IsZero(product, C)))
443 {
444 p_LmDelete(&p, r);
445 }
446 else
447 {
448 p_SetCoeff(p, product, r);
449 pNext(q) = p;
450 q = p;
451 p = pNext(p);
452 }
453 }
454 pNext(q) = NULL;
455 n_Delete(&one, C);
456 return rp.next;
457}

Callers 3

maEvalFunction · 0.85
jjMINPOLY_redFunction · 0.85
maApplyFetchFunction · 0.85

Calls 6

n_InitFunction · 0.85
n_MultFunction · 0.85
n_IsZeroFunction · 0.85
p_LmDeleteFunction · 0.85
p_SetCoeffFunction · 0.85
n_DeleteFunction · 0.85

Tested by

no test coverage detected