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

Method resMatrixSparse

kernel/numeric/mpr_base.cc:1571–1724  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1569//----------------------------------------------------------------------------------------
1570
1571resMatrixSparse::resMatrixSparse( const ideal _gls, const int special )
1572 : resMatrixBase(), gls( _gls )
1573{
1574 pointSet **Qi; // vertices sets of Conv(Supp(f_i)), i=0..idelem
1575 pointSet *E; // all integer lattice points of the minkowski sum of Q0...Qn
1576 int i,k;
1577 int pnt;
1578 int totverts; // total number of exponent vectors in ideal gls
1579 mprfloat shift[MAXVARS+2]; // shiftvector delta, index [1..dim]
1580
1581 if ( (currRing->N) > MAXVARS )
1582 {
1583 WerrorS("resMatrixSparse::resMatrixSparse: Too many variables!");
1584 return;
1585 }
1586
1587 rmat= NULL;
1588 numSet0= 0;
1589
1590 if ( special == SNONE ) linPolyS= 0;
1591 else linPolyS= special;
1592
1593 istate= resMatrixBase::ready;
1594
1595 n= (currRing->N);
1596 idelem= IDELEMS(gls); // should be n+1
1597
1598 // prepare matrix LP->LiPM for Linear Programming
1599 totverts = 0;
1600 for( i=0; i < idelem; i++) totverts += pLength( (gls->m)[i] );
1601
1602 LP = new simplex( idelem+totverts*2+5, totverts+5 ); // rows, cols
1603
1604 // get shift vector
1605#ifdef mprTEST
1606 shift[0]=0.005; shift[1]=0.003; shift[2]=0.008; shift[3]=0.005; shift[4]=0.002;
1607 shift[5]=0.1; shift[6]=0.3; shift[7]=0.2; shift[8]=0.4; shift[9]=0.2;
1608#else
1609 randomVector( idelem, shift );
1610#endif
1611#ifdef mprDEBUG_PROT
1612 PrintS(" shift vector: ");
1613 for ( i= 1; i <= idelem; i++ ) Print(" %.12f ",(double)shift[i]);
1614 PrintLn();
1615#endif
1616
1617 // evaluate convex hull for supports of gls
1618 convexHull chnp( LP );
1619 Qi= chnp.newtonPolytopesP( gls );
1620
1621#ifdef mprMINKSUM
1622 E= minkSumAll( Qi, n+1, n);
1623#else
1624 // get inner points
1625 mayanPyramidAlg mpa( LP );
1626 E= mpa.getInnerPoints( Qi, shift );
1627#endif
1628

Callers

nothing calls this directly

Calls 12

WerrorSFunction · 0.85
pLengthFunction · 0.85
PrintSFunction · 0.85
print_expFunction · 0.85
newtonPolytopesPMethod · 0.80
getInnerPointsMethod · 0.80
liftMethod · 0.80
removePointMethod · 0.80
unliftMethod · 0.80
PrintFunction · 0.50
PrintLnFunction · 0.50
sortMethod · 0.45

Tested by

no test coverage detected