30 #if __FLINT_RELEASE >= 20503
31 #include <flint/fmpq_mpoly.h>
38#define OVERFLOW_MAX LONG_MAX
39#define OVERFLOW_MIN LONG_MIN
41#define OVERFLOW_MAX (((int64)LONG_MAX)<<30)
42#define OVERFLOW_MIN (-OVERFLOW_MAX)
78 work =
new intvec(hseries1);
81 for (
i =
k-1;
i >= 0;
i--)
85 if ((
s != 0) || (
k == 1))
90 for (
i =
k-1;
i >= 0;
i--)
99 for (
i =
k-1;
i >= 0;
i--)
100 (*hseries2)[
i] = (*work)[
i];
101 (*hseries2)[
k] = (*work)[
l];
118 for(
k=
j-2;
k>=0;
k--)
126 poly o_t=
p_One(Qt);p_SetExp(o_t,1,1,Qt);p_Setm(o_t,Qt);
128 o_t=p_Add_q(
p_One(Qt),o_t,Qt);
129 poly di1=p_Copy(
h,Qt);
131#if defined(HAVE_FLINT) && (__FLINT_RELEASE >= 20503)
133 fmpq_mpoly_ctx_t ctx;
134 convSingRFlintR(ctx,Qt);
137 di2=Flint_Divide_MP(di1,0,o_t,0,ctx,Qt);
138 if (di2==
NULL)
break;
153 if (dummy!=Di1)
break;
166 if ((modul_weight!=
NULL)&&(modul_weight->
compare(0)!=0))
169 Print(
"module weights:%s\n",
s);
176 if (hseries==
NULL) di=0;
182 mu+=n_Int(pGetCoeff(
p),Qt->cf);
188 Print(
"// dimension (proj.) = %d\n// degree (proj.) = %d\n", di-1,
mu);
190 Print(
"// dimension (affine) = 0\n// degree (affine) = %d\n",
mu);
193 Print(
"// dimension (local) = %d\n// multiplicity = %d\n", di,
mu);
205 Qt->block0 = (
int *)
omAlloc0(3 *
sizeof(
int *));
206 Qt->block1 = (
int *)
omAlloc0(3 *
sizeof(
int *));
236 if ((modulweight!=
NULL)&&(modulweight->
compare(0)!=0))
239 Print(
"module weights:%s\n",
s);
266 while ((
j >= 0) && (I->m[
j] ==
NULL))
295 if(JCount != ObCount)
300 for(
i = 0;
i < JCount;
i++)
319 if(p_Totaldegree(I->m[0],
currRing) == 0)
327 if(p_Totaldegree(I->m[
i],
currRing) > tr)
351 if(JCount != ObCount)
361 for(
i = 0;
i< JCount;
i++)
385 int orbCount = idorb.size();
411 for(
i = 1;
i < orbCount;
i++)
413 degp = p_Totaldegree(polist[
i],
currRing);
461 int OrbCount = idorb.size();
468 for(
i = 1;
i < OrbCount;
i++)
493 int OrbCount = idorb.size();
494 int dtr=0;
int IwCount, ObCount;
495 dtr = trunDegHs - 1 - p_Totaldegree(
w,
currRing);
499 for(
i = 1;
i < OrbCount;
i++)
520 if(p_Totaldegree(I->m[0],
currRing)==0)
522 for(
i = 1;
i < OrbCount;
i++)
526 if(p_Totaldegree(idorb[
i]->
m[0],
currRing)==0)
535 for(
i = 1;
i < OrbCount;
i++)
590 for(
k = ICount - 1;
k >=1;
k--)
592 for(
i = 0;
i <
k;
i++)
595 if(p_LmDivisibleBy(I->m[
i], I->m[
k],
currRing))
614 poly smon =
p_One(r);
618 int *e=(
int *)
omAlloc((r->N+1)*
sizeof(
int));
619 int *
s=(
int *)
omAlloc0((r->N+1)*
sizeof(
int));
622 for(
j = 1;
j <= cnt;
j++)
649 int *e = (
int *)
omAlloc((r->N+1)*
sizeof(
int));
650 int *
s=(
int *)
omAlloc0((r->N+1)*
sizeof(
int));
659 for(
j = (cnt+1);
j < (r->N+1);
j++)
674static void TwordMap(poly
p, poly
w,
int lV,
int d, ideal Jwi,
bool &flag)
690 for(
i = 0;
i <= d - 1;
i++)
735static ideal
colonIdeal(ideal S, poly
w,
int lV, ideal Jwi,
int trunDegHs)
750 if(trunDegHs !=0 && d >= trunDegHs)
757 for(
i = 0;
i < SCount;
i++)
793 PrintS(
"Hilbert Series:\n 0\n");
796 int (*POS)(ideal, poly, std::vector<ideal>, std::vector<poly>, int, int);
799 Print(
"\nTruncation degree = %d\n",trunDegHs);
808 WerrorS(
"wrong input: it is not an infinitely gen. case");
817 std::vector<ideal > idorb;
818 std::vector< poly > polist;
820 ideal orb_init =
idInit(1, 1);
821 idorb.push_back(orb_init);
825 std::vector< std::vector<int> > posMat;
826 std::vector<int> posRow(lV,0);
830 unsigned long lpcnt = 0;
835 while(lpcnt < idorb.size())
839 if(lpcnt >= 1 &&
idIs0(idorb[lpcnt]) ==
FALSE)
841 if(p_Totaldegree(idorb[lpcnt]->
m[0],
currRing) != 0)
856 for(is = 1; is <= lV; is++)
866 p_SetExp(wi, (ds*lV)+is, 1,
currRing);
877 ps = (*POS)(Jwi, wi, idorb, polist, trInd, trunDegHs);
881 posRow[is-1] = idorb.size();
883 idorb.push_back(Jwi);
884 polist.push_back(wi);
893 posMat.push_back(posRow);
898 Print(
"maximal length of words = %ld\n", p_Totaldegree(polist[lO-1],
currRing));
899 Print(
"\nlength of the Orbit = %d", lO);
904 Print(
"words description of the Orbit: \n");
905 for(is = 0; is < lO; is++)
911 PrintS(
"\nmaximal degree, #(sum_j R(w,w_j))");
913 for(is = 0; is < lO; is++)
926 for(is = idorb.size()-1; is >= 0; is--)
930 for(is = polist.size()-1; is >= 0; is--)
938 int adjMatrix[lO][lO];
939 memset(adjMatrix, 0, lO*lO*
sizeof(
int));
940 int rowCount, colCount;
944 for(rowCount = 0; rowCount < lO; rowCount++)
946 for(colCount = 0; colCount < lV; colCount++)
948 tm = posMat[rowCount][colCount];
949 adjMatrix[rowCount][tm] = adjMatrix[rowCount][tm] + 1;
960 tt=(
char**)
omAlloc(2*
sizeof(
char*));
966 tt=(
char**)
omalloc(lV*
sizeof(
char*));
967 for(is = 0; is < lV; is++)
969 tt[is] = (
char*)
omAlloc(12*
sizeof(
char));
970 snprintf (tt[is],12,
"t%d", is+1);
977 char** xx = (
char**)
omAlloc(
sizeof(
char*));
990 for(rowCount = 0; rowCount < lO; rowCount++)
992 for(colCount = 0; colCount < lO; colCount++)
994 if(adjMatrix[rowCount][colCount] != 0)
996 MATELEM(mR, rowCount + 1, colCount + 1) =
p_ISet(adjMatrix[rowCount][colCount],
R);
997 p_SetCoeff(
MATELEM(mR, rowCount + 1, colCount + 1), n_Mult(pGetCoeff(mR->
m[lO*rowCount+colCount]),n_Param(1,
R->cf),
R->cf),
R);
1004 for(rowCount = 0; rowCount < lO; rowCount++)
1006 for(colCount = 0; colCount < lV; colCount++)
1010 p_SetCoeff(rc, n_Mult(pGetCoeff(rc), n_Param(colCount+1,
R->cf),
R->cf),
R);
1011 MATELEM(mR, rowCount +1, posMat[rowCount][colCount]+1)=p_Add_q(rc,
MATELEM(mR, rowCount +1, posMat[rowCount][colCount]+1),
R);
1016 for(rowCount = 0; rowCount < lO; rowCount++)
1018 if(C[rowCount] != 0)
1032 PrintS(
"\nlinear system:\n");
1035 for(rowCount = 0; rowCount < lO; rowCount++)
1037 Print(
"H(%d) = ", rowCount+1);
1038 for(colCount = 0; colCount < lV; colCount++)
1043 Print(
"H(%d) + ", posMat[rowCount][colCount] + 1);
1045 Print(
" %d\n", C[rowCount] );
1047 PrintS(
"where H(1) represents the series corresp. to input ideal\n");
1048 PrintS(
"and i^th summand in the rhs of an eqn. is according\n");
1049 PrintS(
"to the right colon map corresp. to the i^th variable\n");
1053 for(rowCount = 0; rowCount < lO; rowCount++)
1055 Print(
"H(%d) = ", rowCount+1);
1056 for(colCount = 0; colCount < lV; colCount++)
1061 Print(
"H(%d) + ", posMat[rowCount][colCount] + 1);
1063 Print(
" %d\n", C[rowCount] );
1065 PrintS(
"where H(1) represents the series corresp. to input ideal\n");
1097 Print(
"Hilbert series:");
1106 for(is = lV-1; is >= 0; is--)
1155 for(
int i=src->N;
i>0;
i--)
1157 int pi=p_GetExp(
p,
i,src)-exp_q[
i];
1163 p_SetExp(
p,
i,
pi,src);
1172#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__CYGWIN__)
1173static int compare_rp(
void *arg,
const void *pp1,
const void *pp2)
1175static int compare_rp(
const void *pp1,
const void *pp2,
void* arg)
1178 poly p1=*(poly*)pp1;
1179 poly p2=*(poly*)pp2;
1181 for(
int i=src->N;
i>0;
i--)
1183 int e1=p_GetExp(p1,
i,src);
1184 int e2=p_GetExp(p2,
i,src);
1185 if(e1<e2)
return -1;
1193 poly p1=*(poly*)pp1;
1194 poly p2=*(poly*)pp2;
1199 if(e1<e2)
return -1;
1208 while(id->m[
k]==
NULL)
k--;
1210 long *sev=(
long*)
omAlloc0(kk*
sizeof(
long));
1211 BOOLEAN only_lm=r->cf->has_simple_Alloc;
1214 for (
int i=
k;
i>=0;
i--)
1222 for (
int i=
k;
i>=0;
i--)
1229 for (
int i=
k;
i>=0;
i--)
1236 for (
int i=0;
i<
k;
i++)
1242 for (
int j=
i+1;
j<=
k;
j++)
1246 if (p_LmShortDivisibleBy(m_i, sev_i, id->m[
j],~sev[
j],r))
1248 p_LmFree(&id->m[
j],r);
1250 else if (p_LmShortDivisibleBy(id->m[
j],sev[
j], m_i,~sev_i,r))
1252 p_LmFree(&id->m[
i],r);
1262 for (
int i=0;
i<
k;
i++)
1268 for (
int j=
i+1;
j<=
k;
j++)
1272 if (p_LmShortDivisibleBy(m_i, sev_i, id->m[
j],~sev[
j],r))
1274 p_Delete(&id->m[
j],r);
1276 else if (p_LmShortDivisibleBy(id->m[
j],sev[
j], m_i,~sev_i,r))
1278 p_Delete(&id->m[
i],r);
1301 int*
exp=(
int*)
omAlloc((src->N+1)*
sizeof(
int));
1306 p_GetExpV(
A->m[
i],
exp,src);
1307 for(
int j=src->N;
j>0;
j--)
1309 int w=(*wdegree)[
j-1];
1312 WerrorS(
"weights must be positive");
1317 p_SetExpV(
A->m[
i],
exp,src);
1319 p_Setm(
A->m[
i],src);
1326 p_SetExp(
h,1,p_Totaldegree(
A->m[0],src),Qt);
1329 int *exp_q=(
int*)
omAlloc((src->N+1)*
sizeof(
int));
1331 for (
int i=1;
i<r;
i++)
1334 for(
int ii=src->N;ii>0;ii--)
1335 exp_q[ii]=p_GetExp(
A->m[
i],ii,src);
1337 for(
int ii=0;ii<
i;ii++)
1345 for (
int ii=
IDELEMS(J)-1;ii>=0;ii--)
1347 if((J->m[ii]!=
NULL) && (
bad[ii]) && (p_Totaldegree(J->m[ii],src)==1))
1350 p_LmDelete(&J->m[ii],src);
1359 tmp=p_Init(Qt);
pSetCoeff0(tmp,n_Init(-1,Qt->cf));
1360 p_SetExp(tmp,1,1,Qt);
1362 tmp=p_Add_q(tmp,
p_One(Qt),Qt);
1367 h_J=p_Mult_q(h_J,tmp,Qt);
1372 tmp=p_Init(Qt);
pSetCoeff0(tmp,n_Init(-1,Qt->cf));
1373 p_SetExp(tmp,1,p_Totaldegree(
A->m[
i],src),Qt);
1375 tmp=p_Mult_q(tmp,h_J,Qt);
1376 h=p_Add_q(
h,tmp,Qt);
1398 if (AA->m[
i]!=
NULL) p_SetComp(AA->m[
i],c,src);
1407 #if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__CYGWIN__)
1408 qsort_r(AA->m,
IDELEMS(AA),
sizeof(poly),src,compare_rp);
1410 qsort_r(AA->m,
IDELEMS(AA),
sizeof(poly),compare_rp,src);
1429 for(
int i=1;
i<=rk;
i++)
1433 for(
int ii=0;ii<
IDELEMS(AA);ii++)
1435 if (AA->m[ii]!=
NULL)
1438 p_Delete(&AA->m[ii],src);
1441 p_SetComp(AA->m[ii],0,src);
1442 p_Setm(AA->m[ii],src);
1463 int sh=(*shifts)[
i-1]-
m;
1466 p_SetExp(
s,1,sh,Qt);
1470 h_i=p_Mult_q(h_i,
s,Qt);
1471 h=p_Add_q(
h,h_i,Qt);
1484 ss=
new intvec(p_Totaldegree(
s,Qt)+2);
1487 int i=p_Totaldegree(
s,Qt);
1488 long l=n_Int(pGetCoeff(
s),Qt->cf);
1489 (*ss)[
i]=n_Int(pGetCoeff(
s),Qt->cf);
1490 if((
l==0)||(
l<=-INT_MAX)||(
l>INT_MAX))
1494 else (*ss)[
i]=(int)
l;
1507 res->m[
i]=p_Head(
A->m[
i],src);
1521 while(
prod<(1<<15) && (a>1))
1527 if (a==1)
b=(1<<15);
1565 int w_max=0,w_min=0;
1568 w_max=module_w->
max_in();
1569 w_min=module_w->
min_in();
1571 for(
int c=1;c<=
A->rank;c++)
1579 if ((module_w==
NULL) || ((*module_w)[c-1]==0)) tmp=
ivAdd(
res,res_c);
1588 (*res)[
res->length()-1]=w_min;
1595 if(modulweight==
NULL)
return 0;
1596 return modulweight->
min_in();
1606 x = (*wdegree)[
i-1];
1622 memcpy(pon, pol,
l *
sizeof(
int64));
1625 for (
i =
x;
i <
l;
i++)
1627 #ifndef __SIZEOF_INT128__
1635 __int128 t2=pol[
i -
x];
1637 if ((t>=LONG_MIN)&&(t<=LONG_MAX)) pon[
i]=t;
1641 for (
i =
l;
i < ln;
i++)
1643 #ifndef __SIZEOF_INT128__
1648 __int128 t= -pol[
i -
x];
1649 if ((t>=LONG_MIN)&&(t<=LONG_MAX)) pon[
i]=t;
1656 for (
i =
l;
i <
x;
i++)
1658 for (
i =
x;
i < ln;
i++)
1659 pon[
i] = -pol[
i -
x];
1666 int l = lp,
x,
i,
j;
1670 for (
i = Nv;
i>0;
i--)
1672 x = pure[var[
i + 1]];
1678 for (
i = 0;
i <
l;
i++)
1680 #ifndef __SIZEOF_INT128__
1690 if ((t>=LONG_MIN)&&(t<=LONG_MAX)) pl[
i+
j]=t;
1698 for (
i = 0;
i <
l;
i++)
1700 #ifndef __SIZEOF_INT128__
1710 if ((t>=LONG_MIN)&&(t<=LONG_MAX)) pl[
i+
j]=t;
1725 for (
i = Nvar;
i>0;
i--)
1728 for (
j = 0;
j < Nstc;
j++)
1740 WerrorS(
"internal arrays too big");
1752 for (
x =
Ql[
j];
x < z;
x++)
1762 int Nvar,
int64 *pol,
int Lpol)
1764 int iv = Nvar -1, ln, a, a0, a1,
b,
i;
1777 hStepS(sn, Nstc, var, Nvar, &a, &
x);
1783 x = pure[var[Nvar]];
1801 hStepS(sn, Nstc, var, Nvar, &a, &
x);
1802 hElimS(sn, &
b, a0, a, var, iv);
1804 hPure(sn, a0, &a1, var, iv, pn, &
i);
1815 x = pure[var[Nvar]];
1832 int i,
j,
k,
l, ii, mw;
1871 if (modulweight !=
NULL)
1872 j = (*modulweight)[mc-1]-mw;
1907 while ((
i > 0) && ((*
Qpol)[
i - 1] == 0))
1915 for (ii=0; ii<
k; ii++)
1916 (*work)[ii] = (*hseries1)[ii];
1917 if (hseries1 !=
NULL)
1924 (*hseries1)[
i +
j - 1] += (*Qpol)[
i - 1];
1943 while ((*hseries1)[
l-2]==0)
l--;
1947 for (ii=
l-2; ii>=0; ii--)
1948 (*work)[ii] = (*hseries1)[ii];
1952 (*hseries1)[
l-1] = mw;
1988 td=p_Totaldegree(
h,Qt);
1990 f=n_SetMap(Qt->cf,biv_cf);
1995 int d=p_Totaldegree(
h,Qt);
1996 n_Delete(&
BIMATELEM(*biv,1,d+1),biv_cf);
1997 BIMATELEM(*biv,1,d+1)=
f(pGetCoeff(
h),Qt->cf,biv_cf);
2007 for(
int d=0;d<
b->rows()-1;d++)
2010 p_SetExp(
h,1,d,Qt);p_Setm(
h,Qt);
2079 for(
int i=0;
i<h1->cols();
i++)
2089 hseries2 = hseries1;
2094 if ((
l == 1) &&(
mu == 0))
#define BIMATELEM(M, I, J)
void mu(int **points, int sizePoints)
CanonicalForm convSingPFactoryP(poly p, const ring r)
poly convFactoryPSingP(const CanonicalForm &f, const ring r)
int compare(const intvec *o) const
char * ivString(int not_mat=1, int spaces=0, int dim=2) const
Coefficient rings, fields and other domains suitable for Singular polynomials.
@ n_Q
rational (GMP) numbers
@ n_transExt
used for all transcendental extensions, i.e., the top-most extension in an extension tower is transce...
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
number(*) nMapFunc(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
const CanonicalForm int s
const CanonicalForm int const CFList const Variable & y
VAR void(*) WerrorS_callback(const char *s)
void WerrorS(const char *s)
This file is work in progress and currently not part of the official Singular.
void scPrintDegree(int co, int mu)
static void idInsertMonomial(ideal I, poly p)
static int comapreMonoIdBases_IG_Case(ideal J, int JCount, ideal Ob, int ObCount)
poly hBIV2Poly(bigintmat *b, const ring Qt, const coeffs biv_cf)
poly hFirstSeries0m(ideal A, ideal Q, intvec *wdegree, intvec *shifts, const ring src, const ring Qt)
static poly hilbert_series(ideal A, const ring src, const intvec *wdegree, const ring Qt)
poly hFirstSeries0p(ideal A, ideal Q, intvec *wdegree, const ring src, const ring Qt)
static int comapreMonoIdBases(ideal J, ideal Ob)
static void TwordMap(poly p, poly w, int lV, int d, ideal Jwi, bool &flag)
static poly deleteInMon(poly w, int i, int lV, const ring r)
intvec * hSecondSeries(intvec *hseries1)
static void hLastHilb(scmon pure, int Nv, varset var, int64 *pol, int lp)
static int CountOnIdUptoTruncationIndex(ideal I, int tr)
static int monCompare(const void *m, const void *n)
static void hHilbEst(scfmon stc, int Nstc, varset var, int Nvar)
static int positionInOrbitTruncationCase(ideal I, poly w, std::vector< ideal > idorb, std::vector< poly > polist, int, int trunDegHs)
static intvec * hSeries(ideal S, intvec *modulweight, intvec *wdegree, ideal Q)
void HilbertSeries_OrbitData(ideal S, int lV, bool IG_CASE, bool mgrad, bool odp, int trunDegHs)
static ideal colonIdeal(ideal S, poly w, int lV, ideal Jwi, int trunDegHs)
intvec * hFirstSeries(ideal A, intvec *module_w, ideal Q, intvec *wdegree)
static int hMinModulweight(intvec *modulweight)
static poly shiftInMon(poly p, int i, int lV, const ring r)
static ideal getModuleComp(ideal A, int c, const ring src)
poly hFirst2Second(poly h, const ring Qt, int &co)
intvec * hFirstSeries0(ideal A, ideal Q, intvec *wdegree, const ring src, const ring Qt)
static void hPrintHilb(poly hseries, const ring Qt, intvec *modul_weight)
static int positionInOrbit_FG_Case(ideal I, poly, std::vector< ideal > idorb, std::vector< poly >, int, int)
static void sortMonoIdeal_pCompare(ideal I)
bigintmat * hPoly2BIV(poly h, const ring Qt, const coeffs biv_cf)
ideal RightColonOperation(ideal S, poly w, int lV)
static void hHilbStep(scmon pure, scfmon stc, int Nstc, varset var, int Nvar, int64 *pol, int Lpol)
bigintmat * hFirstSeries0b(ideal I, ideal Q, intvec *wdegree, intvec *shifts, const ring src, const coeffs biv_cf)
static void hWDegree(intvec *wdegree)
static BOOLEAN p_Div_hi(poly p, const int *exp_q, const ring src)
bigintmat * hSecondSeries0b(ideal I, ideal Q, intvec *wdegree, intvec *shifts, const ring src, const coeffs biv_cf)
static int positionInOrbit_IG_Case(ideal I, poly w, std::vector< ideal > idorb, std::vector< poly > polist, int trInd, int)
void hDegreeSeries(intvec *s1, intvec *s2, int *co, int *mu)
static int64 * hAddHilb(int Nv, int x, int64 *pol, int *lp)
static ideal minimalMonomialGenSet(ideal I)
intvec * hFirstSeries1(ideal S, intvec *modulweight, ideal Q, intvec *wdegree)
void scDegree(ideal S, intvec *modulweight, ideal Q)
void hLookSeries(ideal S, intvec *modulweight, ideal Q, intvec *wdegree)
static void id_DelDiv_hi(ideal id, BOOLEAN *bad, const ring r)
static int compare_rp_currRing(const void *pp1, const void *pp2)
void hComp(scfmon exist, int Nexist, int ak, scfmon stc, int *Nstc)
void hLex2S(scfmon rad, int e1, int a2, int e2, varset var, int Nvar, scfmon w)
void hKill(monf xmem, int Nvar)
void hElimS(scfmon stc, int *e1, int a2, int e2, varset var, int Nvar)
void hLexS(scfmon stc, int Nstc, varset var, int Nvar)
void hDelete(scfmon ev, int ev_length)
scfmon hGetmem(int lm, scfmon old, monp monmem)
void hPure(scfmon stc, int a, int *Nstc, varset var, int Nvar, scmon pure, int *Npure)
void hSupp(scfmon stc, int Nstc, varset var, int *Nvar)
void hStepS(scfmon stc, int Nstc, varset var, int Nvar, int *a, int *x)
void hStaircase(scfmon stc, int *Nstc, varset var, int Nvar)
void hOrdSupp(scfmon stc, int Nstc, varset var, int Nvar)
scfmon hInit(ideal S, ideal Q, int *Nexist)
#define idDelete(H)
delete an ideal
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
intvec * ivAddShift(intvec *a, intvec *b, int s)
intvec * ivAdd(intvec *a, intvec *b)
bool unitMatrix(const int n, matrix &unitMat, const ring R)
Creates a new matrix which is the (nxn) unit matrix, and returns true in case of success.
void luDecomp(const matrix aMat, matrix &pMat, matrix &lMat, matrix &uMat, const ring R)
LU-decomposition of a given (m x n)-matrix.
bool luSolveViaLUDecomp(const matrix pMat, const matrix lMat, const matrix uMat, const matrix bVec, matrix &xVec, matrix &H)
Solves the linear system A * x = b, where A is an (m x n)-matrix which is given by its LU-decompositi...
void mp_Delete(matrix *a, const ring r)
matrix mp_Sub(matrix a, matrix b, const ring R)
matrix mpNew(int r, int c)
create a r x c zero-matrix
#define MATELEM(mat, i, j)
1-based access to matrix
gmp_float max(const gmp_float &a, const gmp_float &b)
gmp_float exp(const gmp_float &a)
The main handler for Singular numbers which are suitable for Singular polynomials.
#define omFreeSize(addr, size)
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
poly p_Power(poly p, int i, const ring r)
unsigned long p_GetShortExpVector0(const poly p, const ring r)
poly p_MDivide(poly a, poly b, const ring r)
int p_Compare(const poly a, const poly b, const ring R)
unsigned long p_GetShortExpVector(const poly p, const ring r)
void pEnlargeSet(poly **p, int l, int increment)
unsigned long p_GetShortExpVector1(const poly p, const ring r)
#define p_LmEqual(p1, p2, r)
void p_Write0(poly p, ring lmRing, ring tailRing)
void rChangeCurrRing(ring r)
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
#define pLmDivisibleBy(a, b)
like pDivisibleBy, except that it is assumed that a!=NULL, b!=NULL
#define pCopy(p)
return a copy of the poly
void StringSetS(const char *st)
void PrintS(const char *s)
void Werror(const char *fmt,...)
BOOLEAN rComplete(ring r, int force)
this needs to be called whenever a new ring is created: new fields in ring are created (like VarOffse...
ring rDefault(const coeffs cf, int N, char **n, int ord_size, rRingOrder_t *ord, int *block0, int *block1, int **wvhdl, unsigned long bitmask)
int status int void size_t count
ideal idInit(int idsize, int rank)
initialise an ideal / module
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
BOOLEAN id_IsModule(ideal A, const ring src)
int idSkipZeroes0(ideal ide)
void id_Delete0(ideal *h, ring r)
ideal id_Head(ideal h, const ring r)
returns the ideals of initial terms
void id_DelDiv(ideal id, const ring r)
delete id[j], if LT(j) == coeff*mon*LT(i) and vice versa, i.e., delete id[i], if LT(i) == coeff*mon*L...
ideal id_CopyFirstK(const ideal ide, const int k, const ring r)
copies the first k (>= 1) entries of the given ideal/module and returns these as a new ideal/module (...
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
ideal id_SimpleMove(ideal h1, ideal h2, const ring R)
concat the lists h1 and h2 without zeros, destroys h1,h2
struct for passing initialization parameters to naInitChar