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

Function maPoly_EvalMon

kernel/maps/fast_maps.cc:454–495  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

452}
453
454static poly maPoly_EvalMon(poly src, ring src_r, poly* dest_id, ring dest_r)
455{
456 int i;
457 int e;
458 poly p=NULL;
459 poly pp;
460 BOOLEAN is_const=TRUE; // for constant src
461 for(i=1;i<=src_r->N;i++)
462 {
463 e=p_GetExp(src,i,src_r);
464 if (e>0)
465 {
466 pp=dest_id[i-1];
467 if (pp==NULL)
468 {
469 p_Delete(&p,dest_r);
470 return NULL;
471 }
472 if (p==NULL)
473 {
474 if (!is_const) // possible only when the coefficient ring is not a field
475 {
476 return NULL;
477 }
478 p=p_Copy(pp /*dest_id[i-1]*/,dest_r);
479 e--;
480 }
481 while (e>0)
482 {
483 p=p_Mult_q(p,p_Copy(pp /*dest_id[i-1]*/,dest_r),dest_r);
484 e--;
485 }
486 is_const=FALSE;
487 }
488 }
489 if (is_const)
490 {
491 assume(p==NULL);
492 p=p_ISet(1,dest_r);
493 }
494 return p;
495}
496
497void maPoly_Eval(mapoly root, ring src_r, ideal dest_id, ring dest_r, int total_cost)
498{

Callers 1

maPoly_EvalFunction · 0.85

Calls 5

p_GetExpFunction · 0.85
p_DeleteFunction · 0.85
p_CopyFunction · 0.85
p_Mult_qFunction · 0.85
p_ISetFunction · 0.85

Tested by

no test coverage detected