48#define MAXPOINTS 10000
49#define MAXINITELEMS 256
50#define LIFT_COOR 50000
51#define SCALEDOWN 100.0
81 number
getDetAt(
const number* evpoint );
83 poly
getUDet(
const number* evpoint );
156typedef struct _entry * entry;
182 bool addPoint(
const onePointP vert );
213 void getRowMP(
const int indx,
int * vert );
235 inline bool smaller(
int,
int );
238 inline bool larger(
int,
int );
266 bool inHull(poly
p, poly pointPoly,
int m,
int site);
330#if defined(mprDEBUG_PROT) || defined(mprDEBUG_ALL)
331void print_mat(
mprfloat **a,
int maxrow,
int maxcol)
335 for (
i = 1;
i <= maxrow;
i++)
338 for (
j = 1;
j <= maxcol;
j++)
Print(
"% 7.2f, ", a[
i][
j]);
346 printf(
"Output matrix from LinProg");
350 if (
i == 1) printf(
" ");
351 else if (iposv[
i-1] <=
N) printf(
"X%d", iposv[
i-1]);
352 else printf(
"Y%d", iposv[
i-1]-
N+1);
353 for (
j = 1;
j <=
ncols;
j++) printf(
" %7.2f ",(
double)a[
i][
j]);
359void print_exp(
const onePointP vert,
int n )
362 for (
i= 1;
i <= n;
i++ )
364 Print(
" %d",vert->point[
i] );
370void print_matrix(
matrix omat )
417 for (
i= 0;
i <=
max;
i++ )
429 for (
i= 0;
i <=
max;
i++ )
450 (
max+1) *
sizeof(onePointP),
451 (2*
max + 1) *
sizeof(onePointP) );
516 for (
i= 1;
i <=
num;
i++ )
518 for (
j= 1;
j <=
dim;
j++ )
519 if (
points[
i]->point[
j] != vert->point[
j] )
break;
520 if (
j >
dim )
break;
535 for (
i= 1;
i <=
num;
i++ )
537 for (
j= 1;
j <=
dim;
j++ )
539 if (
j >
dim )
break;
555 vert= (
int *)
omAlloc( (
dim+1) *
sizeof(int) );
561 for (
i= 1;
i <=
num;
i++ )
563 for (
j= 1;
j <=
dim;
j++ )
565 if (
j >
dim )
break;
584 vert= (
int *)
omAlloc( (
dim+1) *
sizeof(int) );
587 for (
i= 1;
i <=
num;
i++ )
589 for (
j= 1;
j <=
dim;
j++ )
591 if (
j >
dim )
break;
595 if (
i >
num )
return 0;
605 for (
i= 1;
i <=
dim;
i++ )
606 vert[
i]= (
int)(
points[indx]->point[
i] -
points[indx]->rcPnt->point[
i]);
613 for (
i= 1;
i <=
dim;
i++ )
632 for (
i= 1;
i <=
dim;
i++ )
656 for (
i= 1;
i <
num;
i++ )
688 for (
j=1;
j <=
num;
j++ )
703 PrintS(
" lifted points: \n");
704 for (
j=1;
j <=
num;
j++ )
748 for(
i= 1;
i <=
n;
i++) {
751 for(
j= 1;
j <=
m;
j++ )
762 PrintS(
"Matrix of Linear Programming\n");
784 vert= (
int *)
omAlloc( (idelem+1) *
sizeof(int) );
787 for (
i= 0;
i < idelem;
i++ )
790 for(
i= 0;
i < idelem;
i++ )
796 for(
j= 1;
j <=
m;
j++) {
813 omFreeSize( (
void *) vert, (idelem+1) *
sizeof(
int) );
817 for(
i= 0;
i < idelem;
i++ )
844 vert= (
int *)
omAlloc( (idelem+1) *
sizeof(int) );
847 for(
i= 0;
i < idelem;
i++ )
852 for(
j= 1;
j <=
m;
j++) {
855 if ( (id->m)[
i] ==
NULL )
877 omFreeSize( (
void *) vert, (idelem+1) *
sizeof(
int) );
881 for(
i= 0;
i < idelem;
i++ )
911 int i, ii,
j,
k, col, r;
928 for(
i=0;
i <=
n;
i++ )
941 for (
i= 0;
i <=
n;
i++ )
947 for ( r= 0; r <=
n; r++ )
949 if ( r ==
i )
pLP->
LiPM[r+2][col] = -1.0;
950 else pLP->
LiPM[r+2][col] = 0.0;
952 for( r= 1; r <=
dim; r++ )
958 Werror(
"mayanPyramidAlg::vDistance:"
959 "setting up matrix for udist: col %d != cols %d",col,cols);
966 Print(
"vDistance LP, known koords dim=%d, constr %d, cols %d, acoords= ",
969 Print(
" %d",acoords_a[
i]);
977 PrintS(
"LP returns matrix\n");
983 WerrorS(
"mayanPyramidAlg::vDistance:");
985 WerrorS(
" Unbounded v-distance: probably 1st v-coor=0");
987 WerrorS(
" Infeasible v-distance");
998 int i,
j,
k, cols, cons;
1008 for(
i=2;
i<=
n+2;
i++)
1016 for(
i=0;
i<=
n;
i++)
1023 for(
k=2;
k<=
n+2;
k++)
1025 if(
k != la_cons_row)
pLP->
LiPM[
k][cols] = 0.0;
1028 for(
k=1;
k<=
n;
k++)
1033 for(
i= 0;
i <
dim;
i++ )
1045 Print(
"\nThats the matrix for minR, dim= %d, acoords= ",
dim);
1046 for(
i= 0;
i <
dim;
i++ )
1049 print_mat(
pLP->
LiPM, cons+1, cols);
1062 WerrorS(
" mn_mx_MinkowskiSum: LinearProgram: minR: infeasible");
1064 WerrorS(
" mn_mx_MinkowskiSum: LinearProgram: minR: unbounded");
1074 for(
i=2;
i<=
n+2;
i++)
1081 for(
i=0;
i<=
n;
i++)
1088 for(
k=2;
k<=
n+2;
k++)
1090 if(
k != la_cons_row)
pLP->
LiPM[
k][cols] = 0.0;
1093 for(
k=1;
k<=
n;
k++)
1098 for(
i= 0;
i <
dim;
i++ )
1109 Print(
"\nThats the matrix for maxR, dim= %d\n",
dim);
1110 print_mat(
pLP->
LiPM, cons+1, cols);
1123 WerrorS(
" mn_mx_MinkowskiSum: LinearProgram: maxR: infeasible");
1125 WerrorS(
" mn_mx_MinkowskiSum: LinearProgram: maxR: unbounded");
1131 Print(
" Range for dim=%d: [%d,%d]\n",
dim, *minR, *maxR);
1173 Print(
":: [%d,%d]\n", minR, maxR);
1222 for (
i= 0;
i <= nn;
i++ )
1224 if ( (loffset < indx) && (indx <= pQ[
i]->
num + loffset) )
1230 else loffset+= pQ[
i]->
num;
1251 for (
i= 0;
i <=
n;
i++ )
1262 for (
j = 0;
j <=
n;
j++ )
1271 for (
j = 1;
j <=
n;
j++ )
1278 for (
j = 0;
j <=
n;
j++ )
LP->
LiPM[
j+2][1] = 1.0;
1289 Print(
" n= %d, LP->m=M= %d, LP->n=N= %d\n",
n,
LP->
m,
LP->
n);
1317 for (
i= 1;
i <
LP->
m;
i++ )
1338 PrintS(
" now split into sets\n");
1343 for (
i= 0;
i <=
E->dim;
i++ ) bucket[
i]= 0;
1347 for (
i= 0;
i <
LP->
m;
i++ )
1350 if (
LP->
LiPM[
i+2][1] > 1e-12 )
1354 Werror(
" resMatrixSparse::RC: Found bad solution in LP: %d!",
LP->
iposv[
i+1]);
1355 WerrorS(
" resMatrixSparse::RC: remapXiToPoint failed!");
1358 bucket[optSum[c].
set]++;
1366 for (
i= 1;
i <
E->dim;
i++ )
1368 if ( bucket[c] >= bucket[
i] )
1374 for (
i= onum - 1;
i >= 0;
i-- )
1376 if ( optSum[
i].set == c )
1380 (*E)[vert]->rc.set= c;
1381 (*E)[vert]->rc.pnt= optSum[
i].
pnt;
1382 (*E)[vert]->rcPnt= (*pQ[c])[optSum[
i].pnt];
1387 Print(
"\n Point E[%d] was <",vert);print_exp((*
E)[vert],
E->dim-1);
Print(
">, bucket={");
1388 for (
j= 0;
j <
E->dim;
j++ )
1392 PrintS(
" }\n optimal Sum: Qi ");
1393 for (
j= 0;
j <
LP->
m;
j++ )
1395 Print(
" [ %d, %d ]",optSum[
j].set,optSum[
j].pnt);
1397 Print(
" -> i= %d, j = %d\n",(*
E)[vert]->rc.set,optSum[
i].
pnt);
1420 int *epp_mon, *eexp;
1422 epp_mon= (
int *)
omAlloc( (
n+2) *
sizeof(int) );
1440 for (
i= 1;
i <=
E->num;
i++ )
1442 E->getRowMP(
i, epp_mon );
1451 while ( iterp!=
NULL )
1453 epos=
E->getExpPos( iterp );
1458 Werror(
"resMatrixSparse::createMatrix: Found exponent not in E, id %d, set [%d, %d]!",
1459 i,(*
E)[
i]->rc.set,(*
E)[
i]->rc.pnt);
1477 (
rmat->m)[
i-1]= rowp;
1481 omFreeSize( (
void *) epp_mon, (
n+2) *
sizeof(
int) );
1494 PrintS(
" Sparse Matrix done\n");
1510 for (
j= 1;
j <
i-1;
j++ )
1531 for (
j= 1;
j <= Q1->
num;
j++ )
1533 for (
k= 1;
k <= Q2->
num;
k++ )
1535 for (
l= 1;
l <=
dim;
l++ )
1537 vert.
point[
l]= (*Q1)[
j]->point[
l] + (*Q2)[
k]->point[
l];
1558 for (
j= 1;
j < numq;
j++ )
1583 WerrorS(
"resMatrixSparse::resMatrixSparse: Too many variables!");
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;
1612 PrintS(
" shift vector: ");
1633 PrintS(
"\n E = (Q_0 + ... + Q_n) \\cap \\N :\n");
1634 for ( pnt= 1; pnt <=
E->num; pnt++ )
1636 Print(
"%d: <",pnt);print_exp( (*
E)[pnt],
E->dim );
PrintS(
">\n");
1652 for (
i= 0;
i <=
n;
i++ ) Qi[
i]->
lift();
1657 for ( pnt= 1; pnt <=
E->num; pnt++ )
1659 RC( Qi,
E, pnt, shift );
1664 for ( pnt=
k; pnt > 0; pnt-- )
1666 if ( (*
E)[pnt]->rcPnt ==
NULL )
1668 E->removePoint(pnt);
1675 PrintS(
" points which lie in a cell:\n");
1676 for ( pnt= 1; pnt <=
E->num; pnt++ )
1678 Print(
"%d: <",pnt);print_exp( (*
E)[pnt],
E->dim );
PrintS(
">\n");
1684 for (
i= 0;
i <=
n;
i++ ) Qi[
i]->unlift();
1689 Print(
" points with a[ij] (%d):\n",
E->num);
1690 for ( pnt= 1; pnt <=
E->num; pnt++ )
1692 Print(
"Punkt p \\in E[%d]: <",pnt);print_exp( (*
E)[pnt],
E->dim );
1693 Print(
">, RC(p) = (i:%d, j:%d), a[i,j] = <",(*
E)[pnt]->rc.set,(*
E)[pnt]->rc.pnt);
1695 print_exp( (*
E)[pnt]->rcPnt,
E->dim );
PrintS(
">\n");
1702 WerrorS(
"could not handle a degenerate situation: no inner points found");
1709 WerrorS(
"resMatrixSparse::resMatrixSparse: Error in resMatrixSparse::createMatrix!");
1811 for ( cp= 2; cp <=
idelem; cp++ )
1813 if ( !
nIsZero(evpoint[cp-1]) )
1869 for ( cp= 2; cp <=
idelem; cp++ )
1871 if ( !
nIsZero(evpoint[cp-1]) )
1954 number
getDetAt(
const number* evpoint );
2191 poly mon =
pCopy( mm );
2212 if ( var == (
currRing->N)+1 )
return;
2213 poly newm =
pCopy( mm );
2250 ideal pDegDiv=
idInit( polyDegs->
rows(), 1 );
2251 for (
k= 0;
k < polyDegs->
rows();
k++ )
2277 for (
k= 0;
k < iVO->
rows();
k++)
2290 for (
i= 0;
i <
k;
i++ )
2315 for (
i= 0;
i < polyDegs->
rows();
i++ )
2318 for (
k= 0;
k < polyDegs->
rows();
k++ )
2319 if (
i !=
k ) sub*= (*polyDegs)[
k];
2332 Print(
"// %s, S(%d), db ",
2380 for (
k= 0;
k < polyDegs.
rows();
k++ )
2381 sumDeg+= polyDegs[
k];
2382 sumDeg-= polyDegs.
rows() - 1;
2653#define MAXEVPOINT 1000000
2659unsigned long over(
const unsigned long n ,
const unsigned long d )
2664 mpz_init(
m);mpz_set_ui(
m,1);
2665 mpz_init(md);mpz_set_ui(md,1);
2666 mpz_init(mn);mpz_set_ui(mn,1);
2675 mpz_clear(
m);mpz_clear(md);mpz_clear(mn);
2706 WerrorS(
"uResultant::uResultant: Unknown chosen resultant matrix type!");
2717 ideal newGls=
idCopy( igls );
2720 (
IDELEMS(igls) + 1) *
sizeof(poly) );
2731 newGls->m[
i]= newGls->m[
i-1];
2733 newGls->m[0]= linPoly;
2737 WerrorS(
"uResultant::extendIdeal: Unknown chosen resultant matrix type!");
2748 poly actlp, rootlp= newlp;
2780 long mdg=
over(
n-1, tdg );
2783 long l=(long)
pow( (
double)(tdg+1),
n );
2786 Print(
"// total deg of D: tdg %ld\n",tdg);
2787 Print(
"// maximum number of terms in D: mdg: %ld\n",mdg);
2788 Print(
"// maximum number of terms in polynom of deg tdg: l %ld\n",
l);
2793 presults= (number *)
omAlloc( mdg *
sizeof( number ) );
2794 for (
i=0;
i < mdg;
i++) presults[
i]=
nInit(0);
2796 number *pevpoint= (number *)
omAlloc(
n *
sizeof( number ) );
2797 number *pev= (number *)
omAlloc(
n *
sizeof( number ) );
2800 mprPROTnl(
"// initial evaluation point: ");
2803 for (
i=0;
i <
n;
i++)
2814 for (
i=0;
i < mdg;
i++ )
2816 for (
j=0;
j <
n;
j++)
2839 if ( subDetVal !=
NULL )
2842 for (
i= 0;
i <= mdg;
i++ )
2844 detdiv=
nDiv( ncpoly[
i], subDetVal );
2853 for (
i=0;
i < mdg;
i++ )
2862 for (
i=0;
i < mdg;
i++ )
2881 for (
i=0;
i <
l;
i++ )
2905 for (
j= 0;
j <
n - 1;
j++ )
2926 int loops= (matchUp?
n-2:
n-1);
2928 mprPROTnl(
"uResultant::interpolateDenseSP");
2936 presults= (number *)
omAlloc( (tdg + 1) *
sizeof( number ) );
2937 for (
i=0;
i <= tdg;
i++ ) presults[
i]=
nInit(0);
2943 number *pevpoint= (number *)
omAlloc(
n *
sizeof( number ) );
2946 number *pev= (number *)
omAlloc(
n *
sizeof( number ) );
2953 for ( uvar= 0; uvar < loops; uvar++ )
2958 for (
i=0;
i <
n;
i++)
2967 else if (
i <= uvar + 2 )
2979 for (
i=0;
i <
n;
i++)
2990 if (
i == (uvar + 1) ) pevpoint[
i]=
nInit(-1);
2991 else pevpoint[
i]=
nInit(0);
2998 for (
i=0;
i <
n;
i++)
3004 for (
i=0;
i <= tdg;
i++ )
3007 nPower(pevpoint[0],
i,&pev[0]);
3023 if ( subDetVal !=
NULL )
3026 for (
i= 0;
i <= tdg;
i++ )
3028 detdiv=
nDiv( ncpoly[
i], subDetVal );
3037 for (
i=0;
i <= tdg;
i++ )
3055 omFreeSize( (
void *)presults, (tdg + 1) *
sizeof( number ) );
3065 int loops=(matchUp?
n-2:
n-1);
3067 if (loops==0) { loops=1;nn++;}
3077 number *pevpoint= (number *)
omAlloc( nn *
sizeof( number ) );
3078 for (
i=0;
i < nn;
i++) pevpoint[
i]=
nInit(0);
3083 for ( uvar= 0; uvar < loops; uvar++ )
3088 for (
i=0;
i <
n;
i++)
3092 if (
i <= uvar + 2 )
3097 else pevpoint[
i]=
nInit(0);
3103 for (
i=0;
i <
n;
i++)
3107 if (
i == (uvar + 1) ) pevpoint[
i]=
nInit(-1);
3108 else pevpoint[
i]=
nInit(0);
3115 number *ncpoly= (number *)
omAlloc( (tdg+1) *
sizeof(number) );
3122 for (
i= tdg;
i >= 0;
i-- )
3144 if ( subDetVal !=
NULL )
3147 for (
i= 0;
i <= tdg;
i++ )
3149 detdiv=
nDiv( ncpoly[
i], subDetVal );
3168 omFreeSize( (
void *)pevpoint,
n *
sizeof( number ) );
3195 int totverts,idelem;
3202 for(
i=0;
i < idelem;
i++) totverts +=
pLength( (id->m)[
i] );
3204 LP =
new simplex( idelem+totverts*2+5, totverts+5 );
Rational pow(const Rational &a, int e)
const CanonicalForm CFMap CFMap & N
CanonicalForm cd(bCommonDen(FF))
poly singclap_det(const matrix m, const ring s)
pointSet ** newtonPolytopesP(const ideal gls)
Computes the point sets of the convex hulls of the supports given by the polynoms in gls.
ideal newtonPolytopesI(const ideal gls)
bool inHull(poly p, poly pointPoly, int m, int site)
Returns true iff the support of poly pointPoly is inside the convex hull of all points given by the s...
convexHull(simplex *_pLP)
pointSet * getInnerPoints(pointSet **_q_i, mprfloat _shift[])
Drive Mayan Pyramid Algorithm.
bool storeMinkowskiSumPoint()
Stores point in E->points[pt], iff v-distance != 0 Returns true iff point was stored,...
void runMayanPyramid(int dim)
Recursive Mayan Pyramid algorithm for directly computing MinkowskiSum lattice points for (n+1)-fold M...
mayanPyramidAlg(simplex *_pLP)
mprfloat vDistance(Coord_t *acoords, int dim)
Compute v-distance via Linear Programming Linear Program finds the v-distance of the point in accords...
void mn_mx_MinkowskiSum(int dim, Coord_t *minR, Coord_t *maxR)
LP for finding min/max coord in MinkowskiSum, given previous coors.
Coord_t acoords[MAXVARS+2]
bool addPoint(const onePointP vert)
Adds a point to pointSet, copy vert[0,...,dim] to point[num+1][0,...,dim].
onePointP operator[](const int index)
void mergeWithPoly(const poly p)
bool larger(int, int)
points[a] > points[b] ?
void lift(int *l=NULL)
Lifts the point set using sufficiently generic linear lifting homogeneous forms l[1]....
pointSet(const pointSet &)
int getExpPos(const poly p)
bool mergeWithExp(const onePointP vert)
Adds point to pointSet, iff pointSet \cap point = \emptyset.
void getRowMP(const int indx, int *vert)
bool removePoint(const int indx)
bool smaller(int, int)
points[a] < points[b] ?
pointSet(const int _dim, const int _index=0, const int count=MAXINITELEMS)
bool checkMem()
Checks, if more mem is needed ( i.e.
Base class for sparse and dense u-Resultant computation.
virtual poly getUDet(const number *)
virtual number getDetAt(const number *)
number getSubDet()
Evaluates the determinant of the submatrix M'.
void generateBaseData()
Generate the "matrix" M.
ideal getSubMatrix()
Returns the submatrix M' of M in an usable presentation.
void generateMonoms(poly m, int var, int deg)
Recursively generate all homogeneous monoms of (currRing->N) variables of degree deg.
resMatrixDense(const ideal _gls, const int special=SNONE)
_gls: system of multivariate polynoms special: -1 -> resMatrixDense is a symbolic matrix 0,...
number getDetAt(const number *evpoint)
Evaluate the determinant of the matrix M at the point evpoint where the ui's are replaced by the comp...
resVector * getMVector(const int i)
column vector of matrix, index von 0 ... numVectors-1
void createMatrix()
Creates quadratic matrix M of size numVectors for later use.
ideal getMatrix()
Returns the matrix M in an usable presentation.
resMatrixDense(const resMatrixDense &)
deactivated copy constructor
void generateMonomData(int deg, intvec *polyDegs, intvec *iVO)
Generates needed set of monoms, split them into sets S0, ... Sn and check if reduced/nonreduced and c...
resVector * resVectorList
bool remapXiToPoint(const int indx, pointSet **pQ, int *set, int *vtx)
int RC(pointSet **pQ, pointSet *E, int vert, mprfloat shift[])
Row Content Function Finds the largest i such that F[i] is a point, F[i]= a[ij] in A[i] for some j.
resMatrixSparse(const ideal _gls, const int special=SNONE)
void randomVector(const int dim, mprfloat shift[])
pointSet * minkSumTwo(pointSet *Q1, pointSet *Q2, int dim)
int createMatrix(pointSet *E)
create coeff matrix uRPos[i][1]: row of matrix uRPos[i][idelem+1]: col of u(0) uRPos[i][2....
resMatrixSparse(const resMatrixSparse &)
poly getUDet(const number *evpoint)
pointSet * minkSumAll(pointSet **pQ, int numq, int dim)
number getDetAt(const number *evpoint)
Fills in resMat[][] with evpoint[] and gets determinant uRPos[i][1]: row of matrix uRPos[i][idelem+1]...
complex root finder for univariate polynomials based on laguers algorithm
void fillContainer(number *_coeffs, number *_ievpoint, const int _var, const int _tdg, const rootType _rt, const int _anz)
Linear Programming / Linear Optimization using Simplex - Algorithm.
poly linearPoly(const resMatType rmt)
rootContainer ** specializeInU(BOOLEAN matchUp=false, const number subDetVal=NULL)
uResultant(const ideal _gls, const resMatType _rmt=sparseResMat, BOOLEAN extIdeal=true)
ideal extendIdeal(const ideal gls, poly linPoly, const resMatType rmt)
rootContainer ** interpolateDenseSP(BOOLEAN matchUp=false, const number subDetVal=NULL)
poly interpolateDense(const number subDetVal=NULL)
int nextPrime(const int p)
vandermonde system solver for interpolating polynomials from their values
number * interpolateDense(const number *q)
Solves the Vandermode linear system \sum_{i=1}^{n} x_i^k-1 w_i = q_k, k=1,..,n.
static FORCE_INLINE number n_Param(const int iParameter, const coeffs r)
return the (iParameter^th) parameter as a NEW number NOTE: parameter numbering: 1....
static FORCE_INLINE long n_Int(number &n, const coeffs r)
conversion of n to an int; 0 if not possible in Z/pZ: the representing int lying in (-p/2 ....
REvaluation E(1, terms.length(), IntRandom(25))
long isReduced(const mat_zz_p &M)
for(j=0;j< factors.length();j++)
static int max(int a, int b)
void WerrorS(const char *s)
#define idDelete(H)
delete an ideal
#define IMATELEM(M, I, J)
ideal lift(const ideal J, const ring r, const ideal inI, const ring s)
matrix mpNew(int r, int c)
create a r x c zero-matrix
#define MATELEM(mat, i, j)
1-based access to matrix
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
poly monomAt(poly p, int i)
unsigned long over(const unsigned long n, const unsigned long d)
ideal loNewtonPolytope(const ideal id)
gmp_float exp(const gmp_float &a)
#define mprSTICKYPROT(msg)
#define mprSTICKYPROT2(msg, arg)
#define mprPROTL(msg, intval)
#define mprPROTN(msg, nval)
#define mprPROTNnl(msg, nval)
#define nPrint(a)
only for debug, over any initalized currRing
#define nPower(a, b, res)
#define omFreeSize(addr, size)
#define omReallocSize(addr, o_size, size)
#define omfreeSize(addr, size)
static int index(p_Length length, p_Ord ord)
poly pp_DivideM(poly a, poly b, const ring r)
static int pLength(poly a)
static void p_GetExpV(poly p, int *ev, const ring r)
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Compatibility layer for legacy polynomial operations (over currRing)
static long pTotaldegree(poly p)
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL
#define pSetCoeff(p, n)
deletes old coeff before setting the new one
#define pLmInit(p)
like pInit, except that expvector is initialized to that of p, p must be != NULL
#define pGetExp(p, i)
Exponent.
#define pSetmComp(p)
TODO:
#define pInit()
allocates a new monomial and initializes everything to 0
#define pCopy(p)
return a copy of the poly
#define pLmDivisibleByNoComp(a, b)
like pLmDivisibleBy, does not check components
void PrintS(const char *s)
void Werror(const char *fmt,...)
int status int void size_t count
ideal idInit(int idsize, int rank)
initialise an ideal / module
ideal id_Matrix2Module(matrix mat, const ring R)
converts mat to module, destroys mat
poly sm_CallDet(ideal I, const ring R)
poly getElem(const int i)
index von 0 ... numVectors-1
int numColVectorSize
size of numColVector
int elementOfS
number of the set S mon is element of
number getElemNum(const int i)
index von 0 ... numVectors-1
int * numColParNr
holds the index of u0, u1, ..., un, if (elementOfS == linPolyS) the size is given by (currRing->N)
number * numColVector
holds the column vector if (elementOfS != linPolyS)