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

Function id_Module2formatedMatrix

libpolys/polys/simpleideals.cc:1565–1595  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1563}
1564
1565matrix id_Module2formatedMatrix(ideal mod,int rows, int cols, const ring R)
1566{
1567 matrix result = mpNew(rows,cols);
1568 int i,cp,r=id_RankFreeModule(mod,R),c=IDELEMS(mod);
1569 poly p,h;
1570
1571 if (r>rows) r = rows;
1572 if (c>cols) c = cols;
1573 for(i=0;i<c;i++)
1574 {
1575 p=pReverse(mod->m[i]);
1576 mod->m[i]=NULL;
1577 while (p!=NULL)
1578 {
1579 h=p;
1580 pIter(p);
1581 pNext(h)=NULL;
1582 cp = p_GetComp(h,R);
1583 if (cp<=r)
1584 {
1585 p_SetComp(h,0,R);
1586 p_SetmComp(h,R);
1587 MATELEM0(result,cp-1,i) = p_Add_q(MATELEM0(result,cp-1,i),h,R);
1588 }
1589 else
1590 p_Delete(&h,R);
1591 }
1592 }
1593 id_Delete(&mod,R);
1594 return result;
1595}
1596
1597ideal id_ResizeModule(ideal mod,int rows, int cols, const ring R)
1598{

Callers 9

jjDIVISIONFunction · 0.85
jjLIFTFunction · 0.85
jjMATRIX_MoFunction · 0.85
jjLIFT3Function · 0.85
jjLIFT_4Function · 0.85
p_DivideFunction · 0.85
pp_DivideFunction · 0.85
matIdLiftFunction · 0.85

Calls 7

mpNewFunction · 0.85
pReverseFunction · 0.85
p_SetCompFunction · 0.85
p_Add_qFunction · 0.85
p_DeleteFunction · 0.85
id_DeleteFunction · 0.85
id_RankFreeModuleFunction · 0.70

Tested by

no test coverage detected