 |
My Project
UNKNOWN_GIT_VERSION
|
Go to the documentation of this file.
12 #include "factory/factory.h"
112 case LE:
return "<=";
113 case GE:
return ">=";
122 if (
s[1]==
'\0')
return s[0];
123 else if (
s[2]!=
'\0')
return 0;
126 case '.':
if (
s[1]==
'.')
return DOTDOT;
132 case '+':
if (
s[1]==
'+')
return PLUSPLUS;
136 case '<':
if (
s[1]==
'=')
return LE;
139 case '>':
if (
s[1]==
'=')
return GE;
141 case '!':
if (
s[1]==
'=')
return NOTEQUAL;
153 if(fullname) sprintf(
buf2,
"%s::%s",
"",
IDID(
h));
197 && (strlen(
IDPROC(
h)->libname)>0))
210 if ((
s=strchr(buffer,
'\n'))!=
NULL)
218 Print(
"..., %d char(s)",
l);
234 { number2 n=(number2)
IDDATA(
h);
240 Print(
" %d x %d (%s)",
266 ((
intvec*)(
v->Data()))->cols());
break;
270 case MODUL_CMD:
Print(
", rk %d\n", (
int)(((ideal)(
v->Data()))->rank));
break;
373 && (((ring)d)->idroot!=
NULL))
399 if (((ring)
h->data)->idroot!=
NULL)
424 package savePack=currPack;
431 if (strcmp(what,
"all")==0)
466 Werror(
"%s is undefined",what);
500 package save_p=currPack;
534 WarnS(
"Gerhard, use the option command");
564 rc += ((
intvec *)(
v->Data()))->length();
575 rc+=((
lists)
v->Data())->nr+1;
596 WerrorS(
"write: need at least two arguments");
606 Werror(
"cannot write to %s",
s);
633 Werror(
"can not map from ground field of %s to current ground field",
637 if (
IDELEMS(theMap)<src_ring->N)
641 (src_ring->N)*
sizeof(poly));
648 WerrorS(
"argument of a map must have a name");
655 memset(&tmpW,0,
sizeof(
sleftv));
660 save_r=
IDMAP(
w)->preimage;
670 ideal
id=(ideal)tmpW.
data;
678 for(
int j=
IDELEMS(theMap)-1;
j>=0 && !overflow;
j--)
680 if (theMap->m[
j]!=
NULL)
687 if ((
p!=
NULL) && (degs[
i]!=0) &&
688 ((
unsigned long)deg_monexp > (
currRing->bitmask / ((
unsigned long)degs[
i])/2)))
700 for(
int j=
IDELEMS(theMap)-1;
j>=0 && !overflow;
j--)
702 if (theMap->m[
j]!=
NULL)
705 poly
p=(poly)tmpW.
data;
708 ((
unsigned long)deg_monexp > (
currRing->bitmask / ((
unsigned long)deg)/2)))
717 Warn(
"possible OVERFLOW in map, max exponent is %ld",
currRing->bitmask/2);
733 char *tmp = theMap->preimage;
734 theMap->preimage=(
char*)1L;
737 theMap->preimage=tmp;
752 IDMAP(
w)->preimage=save_r;
760 Werror(
"%s undefined in %s",what,theMap->preimage);
765 Werror(
"cannot find preimage %s",theMap->preimage);
781 sprintf(
s,
"%s(%d)",
name,
i+1);
788 h->data.uideal=(ideal)L->
m[
i].
data;
791 Print(
"//defining: %s as %d-th syzygy module\n",
s,
i+1);
796 Warn(
"cannot define %s",
s);
876 int add_row_shift = 0;
879 if (weights!=
NULL) add_row_shift=weights->
min_in();
894 memset(&tmp,0,
sizeof(tmp));
908 l->m[0].rtyp=u->
Typ();
909 l->m[0].data=u->
Data();
912 l->m[0].attribute=*a;
919 l->m[0].attribute=
NULL;
939 add_row_shift = ww->
min_in();
940 (*weights) -= add_row_shift;
947 res->data=(
void*)res_im;
950 for(
int i=1;
i<=res_im->
rows();
i++)
952 if (
IMATELEM(*res_im,1,
i)==0) { add_row_shift--; }
957 if (weights!=
NULL)
delete weights;
975 add_row_shift = ww->
min_in();
976 (*weights) -= add_row_shift;
981 if (weights!=
NULL)
delete weights;
984 return reg+1+add_row_shift;
988 #define BREAK_LINE_LENGTH 80
1015 else if(strncmp(
s,
"cont;",5)==0)
1022 strcat(
s,
"\n;~\n");
1093 res->m[
i].data = (
void *)save->set;
1105 res->m[
i].data = (
void *)save->set;
1130 const char *
id =
name->name;
1132 memset(sy,0,
sizeof(
sleftv));
1135 WerrorS(
"object to declare is not a name");
1179 memset(&tmp,0,
sizeof(
sleftv));
1189 WerrorS(
"branchTo can only occur in a proc");
1197 if (ll!=(
l-1))
return FALSE;
1200 short *t=(
short*)
omAlloc(
l*
sizeof(
short));
1204 for(
i=1;
i<
l;
i++,
h=
h->next)
1209 Werror(
"arg %d is not a string",
i);
1213 b=
IsCmd((
char *)
h->Data(),tt);
1218 Werror(
"arg %d is not a type name",
i);
1225 Werror(
"last(%d.) arg.(%s) is not a proc(but %s(%d)), nesting=%d",
1237 if(
pi->data.s.body==
NULL )
1289 if (strcmp(
p->name,
"#")==0)
1298 if (strcmp(
p->name,
"#")==0)
1300 is_default_list=
TRUE;
1308 if (is_default_list)
1366 if (keepring)
IDRING(
h)->ref--;
1378 Warn(
"'%s': no such identifier\n",
v->
name);
1381 package frompack=v->req_packhdl;
1395 v->req_packhdl=rootpack;
1396 if (
h==frompack->idroot)
1398 frompack->idroot=
h->next;
1402 idhdl hh=frompack->idroot;
1409 Werror(
"`%s` not found",
v->Name());
1413 h->next=rootpack->idroot;
1427 Werror(
"cannot export:%s of internal type %d",
v->
name,
v->rtyp);
1456 Werror(
"cannot export:%s of internal type %d",
v->
name,
v->rtyp);
1469 else if (
IDTYP(old)==
v->Typ())
1549 WarnS(
"package not found\n");
1571 #ifndef TEST_ZN_AS_ZP
1575 mpz_init_set_ui(modBase, (
long)32003);
1582 r->cf->has_simple_Inverse=1;
1595 r->block0 = (
int *)
omAlloc0(3 *
sizeof(
int *));
1596 r->block1 = (
int *)
omAlloc0(3 *
sizeof(
int *));
1651 L->
m[0].
data=(
void *)(
long)r->cf->ch;
1657 for(
i=0;
i<r->N;
i++)
1663 L->
m[1].
data=(
void *)LL;
1680 if (r->block1[
i]-r->block0[
i] >=0 )
1682 j=r->block1[
i]-r->block0[
i];
1685 if ((r->wvhdl!=
NULL) && (r->wvhdl[
i]!=
NULL))
1687 for(;
j>=0;
j--) (*iv)[
j]=r->wvhdl[
i][
j];
1689 else switch (r->order[
i])
1696 for(;
j>=0;
j--) (*iv)[
j]=1;
1706 LLL->
m[1].
data=(
void *)iv;
1707 LL->
m[
i].
data=(
void *)LLL;
1710 L->
m[2].
data=(
void *)LL;
1720 pSetCoeff0(q->m[0],(number)(r->qideal->m[0]));
1721 L->
m[3].
data=(
void *)q;
1740 L->
m[0].
data=(
void *)0;
1750 L->
m[1].
data=(
void *)LL;
1774 L->
m[0].
data=(
void *)0;
1784 L->
m[1].
data=(
void *)LL;
1818 LL->
m[1].
data=(
void *) C->modExponent;
1820 L->
m[1].
data=(
void *)LL;
1847 LL->
m[1].
data=(
void *)
R->cf->modExponent;
1849 L->
m[1].
data=(
void *)LL;
1863 WerrorS(
"ring with polynomial data must be the base ring or compatible");
1876 else if ( C->extRing!=
NULL )
1886 Lc->m[0].data=(
void*)(
long)C->m_nfCharQ;
1893 Lc->m[1].data=(
void*)Lv;
1904 Loo->
m[1].
data=(
void *)iv;
1907 Lo->
m[0].
data=(
void*)Loo;
1910 Lc->m[2].data=(
void*)Lo;
1916 res->data=(
void*)
Lc;
1921 res->data=(
void *)(
long)C->ch;
1942 WerrorS(
"ring with polynomial data must be the base ring or compatible");
1960 L->
m[0].
data=(
char*)r->cf; r->cf->ref++;
1966 for(
i=0;
i<r->N;
i++)
1972 L->
m[1].
data=(
void *)LL;
1992 assume( r->block0[
i] == r->block1[
i] );
1993 const int s = r->block0[
i];
1999 else if (r->block1[
i]-r->block0[
i] >=0 )
2001 int bl=
j=r->block1[
i]-r->block0[
i];
2009 j+=r->wvhdl[
i][bl+1];
2012 if ((r->wvhdl!=
NULL) && (r->wvhdl[
i]!=
NULL))
2014 for(;
j>=0;
j--) (*iv)[
j]=r->wvhdl[
i][
j+(
j>bl)];
2016 else switch (r->order[
i])
2023 for(;
j>=0;
j--) (*iv)[
j]=1;
2033 LLL->
m[1].
data=(
void *)iv;
2034 LL->m[
i].data=(
void *)LLL;
2037 L->
m[2].
data=(
void *)LL;
2041 if (r->qideal==
NULL)
2046 #ifdef HAVE_PLURAL // NC! in rDecompose
2067 || (r->qideal !=
NULL)
2074 WerrorS(
"ring with polynomial data must be the base ring or compatible");
2099 else if ( r->cf->extRing!=
NULL )
2109 Lc->m[0].data=(
void*)(
long)r->cf->m_nfCharQ;
2116 Lc->m[1].data=(
void*)Lv;
2127 Loo->
m[1].
data=(
void *)iv;
2130 Lo->
m[0].
data=(
void*)Loo;
2133 Lc->m[2].data=(
void*)Lo;
2144 L->
m[0].
data=(
void *)(
long)r->cf->ch;
2151 for(
i=0;
i<r->N;
i++)
2157 L->
m[1].
data=(
void *)LL;
2178 assume( r->block0[
i] == r->block1[
i] );
2179 const int s = r->block0[
i];
2185 else if (r->block1[
i]-r->block0[
i] >=0 )
2187 int bl=
j=r->block1[
i]-r->block0[
i];
2195 j+=r->wvhdl[
i][bl+1];
2198 if ((r->wvhdl!=
NULL) && (r->wvhdl[
i]!=
NULL))
2200 for(;
j>=0;
j--) (*iv)[
j]=r->wvhdl[
i][
j+(
j>bl)];
2202 else switch (r->order[
i])
2209 for(;
j>=0;
j--) (*iv)[
j]=1;
2219 LLL->
m[1].
data=(
void *)iv;
2220 LL->
m[
i].
data=(
void *)LLL;
2223 L->
m[2].
data=(
void *)LL;
2227 if (r->qideal==
NULL)
2232 #ifdef HAVE_PLURAL // NC! in rDecompose
2251 WerrorS(
"invalid coeff. field description, expecting 0");
2259 WerrorS(
"invalid coeff. field description, expecting precision list");
2269 WerrorS(
"invalid coeff. field description list");
2272 int r1=(int)(
long)LL->
m[0].
data;
2273 int r2=(int)(
long)LL->
m[1].
data;
2295 R->cf->float_len=
si_min(r1,32767);
2296 R->cf->float_len2=
si_min(r2,32767);
2305 WerrorS(
"invalid coeff. field description, expecting parameter name");
2322 unsigned int modExponent = 1;
2326 mpz_init_set_ui(modBase,0);
2337 number tmp= (number) LL->
m[0].
data;
2344 mpz_init_set_ui(modBase,(
unsigned long) LL->
m[0].
data);
2348 mpz_init_set_ui(modBase,0);
2352 modExponent = (
unsigned long) LL->
m[1].
data;
2360 if ((mpz_cmp_ui(modBase, 1) == 0) && (
mpz_sgn1(modBase) < 0))
2362 WerrorS(
"Wrong ground ring specification (module is 1)");
2365 if (modExponent < 1)
2367 WerrorS(
"Wrong ground ring specification (exponent smaller than 1)");
2376 else if (modExponent > 1)
2379 if ((mpz_cmp_ui(modBase, 2) == 0) && (modExponent <= 8*
sizeof(
unsigned long)))
2390 info.exp= modExponent;
2401 info.exp= modExponent;
2415 for(
i=0;
i<
R->N-1;
i++)
2417 for(
j=
i+1;
j<
R->N;
j++)
2419 if (strcmp(
R->names[
i],
R->names[
j])==0)
2422 Warn(
"name conflict var(%d) and var(%d): `%s`, rename to `@%s`",
i+1,
j+1,
R->names[
i],
R->names[
i]);
2424 R->names[
j]=(
char *)
omAlloc(2+strlen(
R->names[
i]));
2425 sprintf(
R->names[
j],
"@%s",
R->names[
i]);
2437 Warn(
"name conflict par(%d) and var(%d): `%s`, renaming the VARIABLE to `@@(%d)`",
i+1,
j+1,
R->names[
j],
i+1);
2443 sprintf(
R->names[
j],
"@@(%d)",
i+1);
2469 poly
p=(poly)
v->m[
i].Data();
2475 Werror(
"var name %d must be a string or a ring variable",
i+1);
2481 Werror(
"var name %d must be `string`",
i+1);
2488 WerrorS(
"variable must be given as `list`");
2504 for (
int j=0;
j < n-1;
j++)
2511 &&(strcmp((
char*)vv->
m[0].
Data(),
"L")==0))
2513 number nn=(number)vv->
m[1].
Data();
2520 Werror(
"illegal argument for pseudo ordering L: %d",vv->
m[1].
Typ());
2527 if (bitmask!=0) n--;
2531 R->block0=(
int *)
omAlloc0(n*
sizeof(
int));
2532 R->block1=(
int *)
omAlloc0(n*
sizeof(
int));
2535 for (j_in_R= n-2; j_in_R>=0; j_in_R--)
2538 for(j_in_R=0,j_in_L=0;j_in_R<n-1;j_in_R++,j_in_L++)
2543 WerrorS(
"ordering must be list of lists");
2550 if (strcmp((
char*)vv->
m[0].
Data(),
"L")==0)
2558 WerrorS(
"ordering name must be a (string,intvec)(1)");
2563 if (j_in_R==0)
R->block0[0]=1;
2580 if (jj<0)
R->block0[j_in_R]=1;
2581 else R->block0[j_in_R]=
R->block1[jj]+1;
2593 R->block1[j_in_R]=
si_max(
R->block0[j_in_R],
R->block0[j_in_R]+iv_len-1);
2594 if (
R->block1[j_in_R]>
R->N)
2596 if (
R->block0[j_in_R]>
R->N)
2601 R->block1[j_in_R]=
R->N;
2602 iv_len=
R->block1[j_in_R]-
R->block0[j_in_R]+1;
2607 switch (
R->order[j_in_R])
2616 R->wvhdl[j_in_R] =(
int *)
omAlloc(iv_len*
sizeof(
int));
2617 for (
i=0;
i<iv_len;
i++)
2619 R->wvhdl[j_in_R][
i]=(*iv)[
i];
2624 for (
i=0;
i<iv_len;
i++)
2626 R->wvhdl[j_in_R][
i]=(*iv)[
i];
2628 R->wvhdl[j_in_R][
i]=iv->
length() - iv_len;
2632 R->wvhdl[j_in_R][
i+1]=(*iv)[
i];
2637 for (
i=0;
i<iv->
length();
i++)
R->wvhdl[j_in_R][
i]=(*iv)[
i];
2638 R->block1[j_in_R]=
si_max(
R->block0[j_in_R],
R->block0[j_in_R]+(
int)
sqrt((
double)(iv->
length()-1)));
2639 if (
R->block1[j_in_R]>
R->N)
2641 WerrorS(
"ordering matrix too big");
2659 R->block1[j_in_R]=
R->block0[j_in_R]=0;
2663 R->block1[j_in_R]=
R->block0[j_in_R]=(*iv)[0];
2669 R->block1[j_in_R] =
R->block0[j_in_R] = 0;
2672 const int s = (*iv)[0];
2674 R->block1[j_in_R] =
R->block0[j_in_R] =
s;
2683 WerrorS(
"ring order not implemented");
2691 WerrorS(
"ordering name must be a (string,intvec)");
2700 if (
R->block1[j_in_R] !=
R->N)
2711 R->block0[j_in_R] <=
R->N)
2713 R->block1[j_in_R] =
R->N;
2717 Werror(
"ordering incomplete: size (%d) should be %d",
R->block1[j_in_R],
R->N);
2721 if (
R->block0[j_in_R]>
R->N)
2723 Werror(
"not enough variables (%d) for ordering block %d, scanned so far:",
R->N,j_in_R+1);
2724 for(
int ii=0;ii<=j_in_R;ii++)
2753 WerrorS(
"ordering must be given as `list`");
2756 if (bitmask!=0)
R->bitmask=bitmask*2;
2788 int ch = (int)(
long)L->
m[0].
Data();
2798 Warn(
"%d is invalid characteristic of ground field. %d is used.", ch,
l);
2801 #ifndef TEST_ZN_AS_ZP
2805 mpz_init_set_ui(modBase,(
long) ch);
2812 R->cf->has_simple_Inverse=1;
2833 int ch = (int)(
long)LL->
m[0].
Data();
2834 while ((ch!=
fftable[is_gf_char]) && (
fftable[is_gf_char])) is_gf_char++;
2835 if (
fftable[is_gf_char]==0) is_gf_char=-1;
2856 WerrorS(
"could not create the specified coefficient field");
2860 if( extRing->qideal !=
NULL )
2864 extParam.
r = extRing;
2871 extParam.
r = extRing;
2881 WerrorS(
"coefficient field must be described by `int` or `list`");
2887 WerrorS(
"could not create coefficient field described by the input!");
2899 else R->isLPring=isLetterplace;
2900 if (bitmask!=0x7fff)
R->bitmask=bitmask*2;
2907 ideal q=(ideal)L->
m[3].
Data();
2913 WerrorS(
"coefficient fields must be equal if q-ideal !=0");
2920 int par_perm_size=0;
2940 par_perm_size=
rPar(orig_ring);
2950 WerrorS(
"coefficient fields must be equal if q-ideal !=0");
2954 perm=(
int *)
omAlloc0((orig_ring->N+1)*
sizeof(int));
2955 if (par_perm_size!=0)
2956 par_perm=(
int *)
omAlloc0(par_perm_size*
sizeof(
int));
2960 maFindPerm(orig_ring->names,orig_ring->N,orig_ring->parameter,orig_ring->P,
2969 else if (par_perm_size!=0)
2977 par_perm,par_perm_size);
2995 WerrorS(
"q-ideal must be given as `ideal`");
3044 ideal
id=(ideal)a->
Data();
3064 int n=(int)(
long)
b->Data();
3065 int d=(int)(
long)c->
Data();
3072 if ((d>n) || (d<1) || (n<1))
3077 int *choise = (
int*)
omAlloc(d*
sizeof(
int));
3081 temp=(ideal)id->
Data();
3096 p =
pCopy(temp->m[choise[
l-1]-1]);
3122 BOOLEAN minim=(int)(
long)
w->Data();
3124 int add_row_shift=0;
3130 add_row_shift = ww->
min_in();
3131 (*weights) -= add_row_shift;
3144 memset(&tmp,0,
sizeof(tmp));
3160 if ((fullres==
NULL) && (minres==
NULL))
3272 ideal F=(ideal)id->
Data();
3278 res->data=(
char *)iv;
3282 double wNsqr = (double)2.0 / (
double)n;
3284 x = (
int * )
omAlloc(2 * (n + 1) *
sizeof(int));
3286 for (
i = n;
i!=0;
i--)
3287 (*iv)[
i-1] =
x[
i + n + 1];
3305 res->data=(
void *)
b;
3323 #ifdef HAVE_SPECTRUM
3331 spec.
mu = (int)(
long)(
l->m[0].Data( ));
3332 spec.
pg = (int)(
long)(
l->m[1].Data( ));
3333 spec.
n = (int)(
long)(
l->m[2].Data( ));
3341 for(
int i=0;
i<spec.
n;
i++ )
3344 spec.
w[
i] = (*mul)[
i];
3375 for(
int i=0;
i<spec.
n;
i++ )
3379 (*mult)[
i] = spec.
w[
i];
3389 L->
m[0].
data = (
void*)(
long)spec.
mu;
3390 L->
m[1].
data = (
void*)(
long)spec.
pg;
3391 L->
m[2].
data = (
void*)(
long)spec.
n;
3442 WerrorS(
"the list is too short" );
3445 WerrorS(
"the list is too long" );
3449 WerrorS(
"first element of the list should be int" );
3452 WerrorS(
"second element of the list should be int" );
3455 WerrorS(
"third element of the list should be int" );
3458 WerrorS(
"fourth element of the list should be intvec" );
3461 WerrorS(
"fifth element of the list should be intvec" );
3464 WerrorS(
"sixth element of the list should be intvec" );
3468 WerrorS(
"first element of the list should be positive" );
3471 WerrorS(
"wrong number of numerators" );
3474 WerrorS(
"wrong number of denominators" );
3477 WerrorS(
"wrong number of multiplicities" );
3481 WerrorS(
"the Milnor number should be positive" );
3484 WerrorS(
"the geometrical genus should be nonnegative" );
3487 WerrorS(
"all numerators should be positive" );
3490 WerrorS(
"all denominators should be positive" );
3493 WerrorS(
"all multiplicities should be positive" );
3497 WerrorS(
"it is not symmetric" );
3500 WerrorS(
"it is not monotonous" );
3504 WerrorS(
"the Milnor number is wrong" );
3507 WerrorS(
"the geometrical genus is wrong" );
3511 WerrorS(
"unspecific error" );
3547 ( fast==2 ? 2 : 1 ) );
3557 ( fast==0 || (*node)->weight<=smax ) )
3579 cmp =
pCmp( (*node)->mon,
f );
3602 (*node)->nf =
search->nf;
3606 while( cmp<0 &&
f!=(poly)
NULL );
3619 if( (*node)->weight<=(
Rational)1 ) pg++;
3620 if( (*node)->weight==smax ) z++;
3621 if( (*node)->weight>weight_prev ) n++;
3623 weight_prev = (*node)->weight;
3624 node = &((*node)->next);
3646 cmp =
pCmp( (*node)->mon,
f );
3659 while( cmp<0 &&
f!=(poly)
NULL );
3675 n = ( z > 0 ? 2*n - 1 : 2*n );
3690 ( fast==0 ||
search->weight<=smax );
3716 for( n1=0, n2=n-1; n1<n2; n1++, n2-- )
3719 (*den) [n2] = (*den)[n1];
3720 (*mult)[n2] = (*mult)[n1];
3728 if( fast==0 || fast==1 )
3732 for(
int n1=0, n2=n-1 ; n1<n2 && symmetric==
TRUE; n1++, n2-- )
3735 (*
den) [n1]!= (*
den)[n2] ||
3742 if( symmetric==
FALSE )
3752 (*L)->m[0].data = (
void*)(
long)
mu;
3769 (*L)->m[0].data = (
void*)(
long)
mu;
3770 (*L)->m[1].data = (
void*)(
long)pg;
3771 (*L)->m[2].data = (
void*)(
long)n;
3772 (*L)->m[3].data = (
void*)nom;
3773 (*L)->m[4].data = (
void*)
den;
3774 (*L)->m[5].data = (
void*)
mult;
3783 #ifdef SPECTRUM_DEBUG
3784 #ifdef SPECTRUM_PRINT
3785 #ifdef SPECTRUM_IOSTREAM
3786 cout <<
"spectrumCompute\n";
3787 if( fast==0 ) cout <<
" no optimization" << endl;
3788 if( fast==1 ) cout <<
" weight optimization" << endl;
3789 if( fast==2 ) cout <<
" symmetry optimization" << endl;
3791 fputs(
"spectrumCompute\n",stdout );
3792 if( fast==0 ) fputs(
" no optimization\n", stdout );
3793 if( fast==1 ) fputs(
" weight optimization\n", stdout );
3794 if( fast==2 ) fputs(
" symmetry optimization\n", stdout );
3838 #ifdef SPECTRUM_DEBUG
3839 #ifdef SPECTRUM_PRINT
3840 #ifdef SPECTRUM_IOSTREAM
3841 cout <<
"\n computing the Jacobi ideal...\n";
3843 fputs(
"\n computing the Jacobi ideal...\n",stdout );
3852 #ifdef SPECTRUM_DEBUG
3853 #ifdef SPECTRUM_PRINT
3854 #ifdef SPECTRUM_IOSTREAM
3857 fputs(
" ", stdout );
3868 #ifdef SPECTRUM_DEBUG
3869 #ifdef SPECTRUM_PRINT
3870 #ifdef SPECTRUM_IOSTREAM
3872 cout <<
" computing a standard basis..." << endl;
3874 fputs(
"\n", stdout );
3875 fputs(
" computing a standard basis...\n", stdout );
3883 #ifdef SPECTRUM_DEBUG
3884 #ifdef SPECTRUM_PRINT
3887 #ifdef SPECTRUM_IOSTREAM
3890 fputs(
" ",stdout );
3935 #ifdef SPECTRUM_DEBUG
3936 #ifdef SPECTRUM_PRINT
3937 #ifdef SPECTRUM_IOSTREAM
3938 cout <<
"\n computing the highest corner...\n";
3940 fputs(
"\n computing the highest corner...\n", stdout );
3945 poly hc = (poly)
NULL;
3949 if( hc!=(poly)
NULL )
3964 #ifdef SPECTRUM_DEBUG
3965 #ifdef SPECTRUM_PRINT
3966 #ifdef SPECTRUM_IOSTREAM
3969 fputs(
" ", stdout );
3979 #ifdef SPECTRUM_DEBUG
3980 #ifdef SPECTRUM_PRINT
3981 #ifdef SPECTRUM_IOSTREAM
3982 cout <<
"\n computing the newton polygon...\n";
3984 fputs(
"\n computing the newton polygon...\n", stdout );
3991 #ifdef SPECTRUM_DEBUG
3992 #ifdef SPECTRUM_PRINT
4001 #ifdef SPECTRUM_DEBUG
4002 #ifdef SPECTRUM_PRINT
4003 #ifdef SPECTRUM_IOSTREAM
4004 cout <<
"\n computing the weight corner...\n";
4006 fputs(
"\n computing the weight corner...\n", stdout );
4011 poly wc = ( fast==0 ?
pCopy( hc ) :
4016 #ifdef SPECTRUM_DEBUG
4017 #ifdef SPECTRUM_PRINT
4018 #ifdef SPECTRUM_IOSTREAM
4021 fputs(
" ", stdout );
4031 #ifdef SPECTRUM_DEBUG
4032 #ifdef SPECTRUM_PRINT
4033 #ifdef SPECTRUM_IOSTREAM
4034 cout <<
"\n computing NF...\n" << endl;
4036 fputs(
"\n computing NF...\n", stdout );
4045 #ifdef SPECTRUM_DEBUG
4046 #ifdef SPECTRUM_PRINT
4048 #ifdef SPECTRUM_IOSTREAM
4051 fputs(
"\n", stdout );
4076 WerrorS(
"polynomial is zero" );
4079 WerrorS(
"polynomial has constant term" );
4082 WerrorS(
"not a singularity" );
4085 WerrorS(
"the singularity is not isolated" );
4088 WerrorS(
"highest corner cannot be computed" );
4091 WerrorS(
"principal part is degenerate" );
4097 WerrorS(
"unknown error occurred" );
4114 WerrorS(
"only works for local orderings" );
4122 WerrorS(
"does not work in quotient rings" );
4168 WerrorS(
"only works for local orderings" );
4173 WerrorS(
"does not work in quotient rings" );
4232 else if(
l->nr > 5 )
4270 int mu = (int)(
long)(
l->m[0].Data( ));
4271 int pg = (int)(
long)(
l->m[1].Data( ));
4272 int n = (int)(
long)(
l->m[2].Data( ));
4283 if( n !=
num->length( ) )
4287 else if( n !=
den->length( ) )
4291 else if( n != mul->
length( ) )
4311 for(
i=0;
i<n;
i++ )
4313 if( (*
num)[
i] <= 0 )
4317 if( (*
den)[
i] <= 0 )
4321 if( (*mul)[
i] <= 0 )
4333 for(
i=0,
j=n-1;
i<=
j;
i++,
j-- )
4336 (*den)[
i] != (*den)[
j] ||
4337 (*mul)[
i] != (*mul)[
j] )
4347 for(
i=0,
j=1;
i<n/2;
i++,
j++ )
4349 if( (*
num)[
i]*(*den)[
j] >= (*num)[
j]*(*den)[
i] )
4359 for(
mu=0,
i=0;
i<n;
i++ )
4364 if(
mu != (
int)(long)(
l->m[0].Data( )) )
4373 for( pg=0,
i=0;
i<n;
i++ )
4375 if( (*
num)[
i]<=(*den)[
i] )
4381 if( pg != (
int)(long)(
l->m[1].Data( )) )
4410 WerrorS(
"first argument is not a spectrum:" );
4415 WerrorS(
"second argument is not a spectrum:" );
4448 int k = (int)(
long)second->
Data( );
4452 WerrorS(
"first argument is not a spectrum" );
4457 WerrorS(
"second argument should be positive" );
4483 BOOLEAN qh=(((int)(
long)
w->Data())==1);
4494 WerrorS(
"first argument is not a spectrum" );
4499 WerrorS(
"second argument is not a spectrum" );
4523 memset(&tmp,0,
sizeof(tmp));
4542 WerrorS(
"Ground field not implemented!");
4562 LP->
m= (int)(
long)(
v->Data());
4568 LP->
n= (int)(
long)(
v->Data());
4574 LP->
m1= (int)(
long)(
v->Data());
4580 LP->
m2= (int)(
long)(
v->Data());
4586 LP->
m3= (int)(
long)(
v->Data());
4588 #ifdef mprDEBUG_PROT
4589 Print(
"m (constraints) %d\n",LP->
m);
4590 Print(
"n (columns) %d\n",LP->
n);
4614 lres->
m[4].
data=(
void*)(
long)LP->
m;
4617 lres->
m[5].
data=(
void*)(
long)LP->
n;
4619 res->data= (
void*)lres;
4626 ideal gls = (ideal)(arg1->
Data());
4627 int imtype= (int)(
long)arg2->
Data();
4651 gls= (poly)(arg1->
Data());
4652 int howclean= (int)(
long)arg3->
Data();
4659 WerrorS(
"Ground field not implemented!");
4666 unsigned long int ii = (
unsigned long int)arg2->
Data();
4672 WerrorS(
"Input polynomial is constant!");
4698 if ( (vpos !=
i) && (
pGetExp( piter,
i ) != 0) )
4700 WerrorS(
"The input polynomial must be univariate!");
4708 number * pcoeffs= (number *)
omAlloc( (deg+1) *
sizeof( number ) );
4710 for (
i= deg;
i >= 0;
i-- )
4724 #ifdef mprDEBUG_PROT
4725 for (
i=deg;
i >= 0;
i--)
4733 roots->
solver( howclean );
4740 rlist->
Init( elem );
4744 for (
j= 0;
j < elem;
j++ )
4753 for (
j= 0;
j < elem;
j++ )
4757 rlist->
m[
j].
data=(
void *)dummy;
4771 res->data= (
void*)rlist;
4780 p= (ideal)arg1->
Data();
4781 w= (ideal)arg2->
Data();
4792 int tdg= (int)(
long)arg3->
Data();
4799 WerrorS(
"Last input parameter must be > 0!");
4807 if (
m != (
int)
pow((
double)tdg+1,(
double)n) )
4809 Werror(
"Size of second input ideal must be equal to %d!",
4810 (
int)
pow((
double)tdg+1,(
double)n));
4817 WerrorS(
"Ground field not implemented!");
4822 number *pevpoint= (number *)
omAlloc( n *
sizeof( number ) );
4823 for (
i= 0;
i < n;
i++ )
4832 WerrorS(
"Elements of first input ideal must not be equal to -1, 0, 1!");
4841 WerrorS(
"Elements of first input ideal must be numbers!");
4844 pevpoint[
i]=
nCopy( tmp );
4848 number *wresults= (number *)
omAlloc(
m *
sizeof( number ) );
4849 for (
i= 0;
i <
m;
i++ )
4858 WerrorS(
"Elements of second input ideal must be numbers!");
4873 res->data= (
void*)rpoly;
4888 else gls= (ideal)(
v->Data());
4894 else imtype= (int)(
long)
v->Data();
4899 ideal test_id=
idInit(1,1);
4903 if (gls->m[
j]!=
NULL)
4905 test_id->m[0]=gls->m[
j];
4909 WerrorS(
"Newton polytope not of expected dimension");
4923 unsigned long int ii=(
unsigned long int)
v->Data();
4931 else howclean= (int)(
long)
v->Data();
4960 WerrorS(
"Error occurred during matrix setup!");
4968 #ifdef mprDEBUG_PROT
4973 WerrorS(
"Unsuitable input ideal: Minor of resultant matrix is singular!");
4979 if ( interpolate_det )
4985 if ( interpolate_det )
4990 #ifdef mprDEBUG_PROT
4992 for (
i=0;
i < c;
i++)
pWrite(iproots[
i]->getPoly());
4994 for (
i=0;
i < c;
i++)
pWrite(muiproots[
i]->getPoly());
4998 arranger=
new rootArranger( iproots, muiproots, howclean );
5009 WerrorS(
"Solver was unable to find any roots!");
5015 for (
i=0;
i <
count;
i++)
delete iproots[
i];
5018 for (
i=0;
i <
count;
i++)
delete muiproots[
i];
5025 res->data= (
void *)listofroots;
5037 int count=
self->roots[0]->getAnzRoots();
5038 int elem=
self->roots[0]->getAnzElems();
5042 if ( self->found_roots )
5049 onepoint->
Init(elem);
5050 for (
j= 0;
j < elem;
j++ )
5066 listofroots->
m[
i].
data=(
void *)onepoint;
5074 listofroots->
Init( 0 );
5088 if (rg==
NULL)
return;
5113 Warn(
"deleting denom_list for ring change to %s",
IDID(
h));
5127 if ((rg!=
NULL) && (rg->idroot==
NULL))
5155 if((*iv)[
i]>=0) { neg=
FALSE;
break; }
5160 (*iv)[
i]= - (*iv)[
i];
5169 if((*iv)[
i]>=0) { neg=
FALSE;
break; }
5174 (*iv)[
i]= -(*iv)[
i];
5183 if((*iv)[
i]!=1) { all_one=
FALSE;
break; }
5189 (*iv2)[2]=iv->
length()-2;
5201 if((*iv)[
i]!=1) { all_one=
FALSE;
break; }
5207 (*iv2)[2]=iv->
length()-2;
5241 (*iv)[2] += (*iv2)[2];
5248 if (!change)
h=
h->next;
5256 int last = 0, o=0, n = 1,
i=0, typ = 1,
j;
5268 R->bitmask=(*iv)[2]*2+1;
5281 WerrorS(
"invalid combination of orderings");
5289 WerrorS(
"more than one ordering c/C specified");
5295 R->block0=(
int *)
omAlloc0(n*
sizeof(
int));
5296 R->block1=(
int *)
omAlloc0(n*
sizeof(
int));
5299 int *weights=(
int*)
omAlloc0((
R->N+1)*
sizeof(int));
5302 for (
j=0;
j < n-1;
j++)
5333 R->block0[n] =
last+1;
5336 R->wvhdl[n][
i-2] = (*iv)[
i];
5338 if (weights[
last]==0) weights[
last]=(*iv)[
i]*typ;
5351 R->block0[n] =
last+1;
5353 else last += (*iv)[0];
5358 if (weights[
i]==0) weights[
i]=typ;
5370 const int s = (*iv)[2];
5380 const int s = (*iv)[2];
5382 if( 1 <
s ||
s < -1 )
return TRUE;
5398 R->block0[n] =
last+1;
5403 R->wvhdl[n][
i-2]=(*iv)[
i];
5405 if (weights[
last]==0) weights[
last]=(*iv)[
i]*typ;
5407 last=
R->block0[n]-1;
5412 R->block0[n] =
last+1;
5415 if (
R->block1[n]-
R->block0[n]+2>=iv->
length())
5416 WarnS(
"missing module weights");
5417 for (
i=2;
i<=(
R->block1[n]-
R->block0[n]+2);
i++)
5419 R->wvhdl[n][
i-2]=(*iv)[
i];
5421 if (weights[
last]==0) weights[
last]=(*iv)[
i]*typ;
5423 R->wvhdl[n][
i-2]=iv->
length() -3 -(
R->block1[n]-
R->block0[n]);
5426 R->wvhdl[n][
i-1]=(*iv)[
i];
5428 last=
R->block0[n]-1;
5433 R->block0[n] =
last+1;
5441 if (weights[
last]==0) weights[
last]=(*iv)[
i]*typ;
5443 last=
R->block0[n]-1;
5449 if (Mtyp==0)
return TRUE;
5450 if (Mtyp==-1) typ = -1;
5454 R->wvhdl[n][
i-2]=(*iv)[
i];
5456 R->block0[n] =
last+1;
5459 for(
i=
R->block1[n];
i>=
R->block0[n];
i--)
5461 if (weights[
i]==0) weights[
i]=typ;
5471 Werror(
"Internal Error: Unknown ordering %d", (*iv)[1]);
5478 Werror(
"mismatch of number of vars (%d) and ordering (>=%d vars)",
5486 for(
i=1;
i<=
R->N;
i++)
5487 {
if (weights[
i]<0) {
R->OrdSgn=-1;
break; }}
5501 if (
R->block1[n] !=
R->N)
5512 R->block0[n] <=
R->N)
5514 R->block1[n] =
R->N;
5518 Werror(
"mismatch of number of vars (%d) and ordering (%d vars)",
5537 *
p = (
char*)sl->
name;
5605 WerrorS(
"parameter expected");
5612 for(
int i=pars-1;
i>=0;
i--)
5624 int ch = (int)(
long)pn->
Data();
5635 if ((ch<2)||(ch!=ch2))
5637 Warn(
"%d is invalid as characteristic of the ground field. 32003 is used.", ch);
5640 #ifndef TEST_ZN_AS_ZP
5644 mpz_init_set_ui(modBase, (
long)ch);
5651 cf->has_simple_Inverse=1;
5664 if ((ch!=0) && (ch!=
IsPrime(ch)) && (pars == 1))
5676 if ((ch!=0) && (ch!=
IsPrime(ch)))
5678 WerrorS(
"too many parameters");
5686 WerrorS(
"parameter expected");
5692 extParam.
r =
rDefault( ch, pars, names);
5693 for(
int i=pars-1;
i>=0;
i--)
5706 && ((strcmp(pn->
name,
"real")==0) || (strcmp(pn->
name,
"complex")==0)))
5709 BOOLEAN complex_flag=(strcmp(pn->
name,
"complex")==0);
5712 float_len=(int)(
long)pnn->
Data();
5713 float_len2=float_len;
5717 float_len2=(int)(
long)pnn->
Data();
5752 else if ((pn->
name !=
NULL) && (strcmp(pn->
name,
"integer") == 0))
5756 unsigned int modExponent = 1;
5757 mpz_init_set_si(modBase, 0);
5764 mpz_set_ui(modBase, (
long) pnn->
Data());
5768 modExponent = (long) pnn->
Data();
5773 mpz_mul_ui(modBase, modBase, (
int)(
long) pnn->
Data());
5786 if ((mpz_cmp_ui(modBase, 1) == 0) && (
mpz_sgn1(modBase) < 0))
5788 WerrorS(
"Wrong ground ring specification (module is 1)");
5791 if (modExponent < 1)
5793 WerrorS(
"Wrong ground ring specification (exponent smaller than 1");
5798 if (modExponent > 1 &&
cf ==
NULL)
5800 if ((mpz_cmp_ui(modBase, 2) == 0) && (modExponent <= 8*
sizeof(
unsigned long)))
5811 WerrorS(
"modulus must not be 0 or parameter not allowed");
5817 info.exp= modExponent;
5826 WerrorS(
"modulus must not be 0 or parameter not allowed");
5832 info.exp= modExponent;
5843 extParam.
r = (ring)pn->
Data();
5855 WerrorS(
"Wrong or unknown ground field specification");
5861 Print(
"pn[%p]: type: %d [%s]: %p, name: %s", (
void*)
p,
p->Typ(),
Tok2Cmdname(
p->Typ()),
p->Data(), (
p->name ==
NULL?
"NULL" :
p->name) );
5883 WerrorS(
"Invalid ground field specification");
5907 WerrorS(
"name of ring variable expected");
5960 int *perm=(
int *)
omAlloc0((org_ring->N+1)*
sizeof(int));
5977 WerrorS(
"name of ring variable expected");
5987 for(;
i<org_ring->N;
i++)
5989 if (strcmp(org_ring->names[
i],
R->names[
j])==0)
5997 Werror(
"variable %d (%s) not in basering",
j+1,
R->names[
j]);
6010 for(
j=
R->block0[
i];j<=R->block1[
i];
j++)
6014 if (min_var==-1) min_var=perm[
j];
6022 R->block0[
i]=min_var;
6023 R->block1[
i]=max_var;
6027 R->wvhdl[
i]=(
int*)
omAlloc0((max_var-min_var+1)*
sizeof(int));
6028 for(
j=org_ring->block0[
i];j<=org_ring->block1[
i];
j++)
6032 R->wvhdl[
i][perm[
j]-
R->block0[
i]]=
6033 org_ring->wvhdl[
i][
j-org_ring->block0[
i]];
6059 R->order[
j-1]=
R->order[
j];
6060 R->block0[
j-1]=
R->block0[
j];
6061 R->block1[
j-1]=
R->block1[
j];
6063 R->wvhdl[
j-1]=
R->wvhdl[
j];
6071 while (
R->order[n]==0) n--;
6074 if (
R->block1[n] !=
R->N)
6085 R->block0[n] <=
R->N)
6087 R->block1[n] =
R->N;
6091 Werror(
"mismatch of number of vars (%d) and ordering (%d vars) in block %d",
6092 R->N,
R->block1[n],n);
6098 R->OrdSgn = org_ring->OrdSgn;
6121 if ((r->ref<=0)&&(r->order!=
NULL))
6131 if (
j==0)
WarnS(
"killing the basering for level 0");
6136 while (r->idroot!=
NULL)
6139 killhdl2(r->idroot,&(r->idroot),r);
6186 Warn(
"deleting denom_list for ring change from %s",
IDID(
h));
6251 resid=(ideal)(
res.data);
6260 while ((
h!=
NULL) &&(
h->next!=new_ring))
h=
h->next;
6261 if (
h!=
NULL)
h->next=
h->next->next;
6304 ideal I=(ideal)u->
Data();
6307 for(
i=I->nrows*I->ncols-1;
i>=0;
i--)
6319 switch (
p->language)
6328 if(
p->libname!=
NULL)
6329 Print(
",%s",
p->libname);
6342 memset(&tmp_in,0,
sizeof(tmp_in));
6344 tmp_in.
data=(
void*)(
long)(*aa)[
i];
6352 Werror(
"apply fails at index %d",
i+1);
6355 if (
i==0) { memcpy(
res,&tmp_out,
sizeof(tmp_out)); }
6360 memcpy(curr,&tmp_out,
sizeof(tmp_out));
6382 for(
int i=0;
i<=aa->
nr;
i++)
6384 memset(&tmp_in,0,
sizeof(tmp_in));
6385 tmp_in.
Copy(&(aa->
m[
i]));
6394 Werror(
"apply fails at index %d",
i+1);
6397 if (
i==0) { memcpy(
res,&tmp_out,
sizeof(tmp_out)); }
6402 memcpy(curr,&tmp_out,
sizeof(tmp_out));
6425 WerrorS(
"first argument to `apply` must allow an index");
6435 char assume_yylinebuf[80];
6437 int lev=(long)a->
Data();
6444 if (bo) {
WerrorS(
"syntax error in ASSUME");
return TRUE;}
6446 if (
b->Data()==
NULL) {
Werror(
"ASSUME failed:%s",assume_yylinebuf);
return TRUE;}
6458 char *ss=(
char*)
omAlloc(strlen(a)+strlen(
s)+30);
6460 int end_s=strlen(
s);
6461 while ((end_s>0) && ((
s[end_s]<=
' ')||(
s[end_s]==
';'))) end_s--;
6464 sprintf(
name,
"%s->%s",a,
s);
6466 int start_s=end_s-1;
6467 while ((start_s>=0) && (
s[start_s]!=
';')) start_s--;
6470 sprintf(ss,
"parameter def %s;return(%s);\n",a,
s);
6475 sprintf(ss,
"parameter def %s;%s;return(%s);\n",a,
s,
s+start_s+1);
6477 memset(r,0,
sizeof(*r));
6497 memset(&tmp,0,
sizeof(tmp));
6515 memset(&n,0,
sizeof(n));
6533 sprintf(
buf,
"wrong length of parameters(%d), expected ",t);
6535 sprintf(
buf,
"par. %d is of type `%s`, expected ",nr,
Tok2Cmdname(t));
6536 for(
int i=1;
i<=
T[0];
i++)
6541 if (
i<
T[0]) strcat(
buf,
",");
6551 if (type_list[0]==0)
return TRUE;
6554 if (
l!=(
int)type_list[0])
6559 for(
int i=1;
i<=
l;
i++,args=args->
next)
6561 short t=type_list[
i];
6565 || (t!=args->Typ()))
BOOLEAN iiConvert(int inputType, int outputType, int index, leftv input, leftv output, const struct sConvertTypes *dConvertTypes)
static int si_min(const int a, const int b)
static void rDecomposeC(leftv h, const ring R)
void rComposeRing(lists L, ring R)
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.
short float_len2
additional char-flags, rInit
#define omCheckAddrSize(addr, size)
@ n_Zn
only used if HAVE_RINGS is defined
void hIndMult(scmon pure, int Npure, scfmon rad, int Nrad, varset var, int Nvar)
double wFunctionalBuch(int *degw, int *lpol, int npol, double *rel, double wx, double wNsqr)
static BOOLEAN rField_is_Zn(const ring r)
static FORCE_INLINE BOOLEAN nCoeff_is_numeric(const coeffs r)
static BOOLEAN rField_is_long_R(const ring r)
void iiCheckPack(package &p)
BOOLEAN jjBETTI2_ID(leftv res, leftv u, leftv v)
#define pIsConstant(p)
like above, except that Comp might be != 0
BOOLEAN rCheckIV(const intvec *iv)
void copy_deep(spectrum &spec, lists l)
struct for passing initialization parameters to naInitChar
ideal kGroebner(ideal F, ideal Q)
void syMinimizeResolvente(resolvente res, int length, int first)
static FORCE_INLINE void nSetChar(const coeffs r)
initialisations after each ring change
BOOLEAN jjMINRES(leftv res, leftv v)
BOOLEAN spectrumfProc(leftv result, leftv first)
void pNorm(poly p, const ring R=currRing)
virtual IStateType initState() const
int iiRegularity(lists L)
#define idDelete(H)
delete an ideal
void scComputeHC(ideal S, ideal Q, int ak, poly &hEdge, ring tailRing)
static FORCE_INLINE BOOLEAN nCoeff_is_Z(const coeffs r)
BOOLEAN iiApplyLIST(leftv res, leftv a, int op, leftv proc)
BOOLEAN nuVanderSys(leftv res, leftv arg1, leftv arg2, leftv arg3)
COMPUTE: polynomial p with values given by v at points p1,..,pN derived from p; more precisely: consi...
#define MATELEM(mat, i, j)
const char * lastreserved
void rChangeCurrRing(ring r)
BOOLEAN syBetti1(leftv res, leftv u)
#define SHORT_REAL_LENGTH
Creation data needed for finite fields.
@ n_long_C
complex floating point (GMP) numbers
BOOLEAN iiExprArith1(leftv res, leftv a, int op)
BOOLEAN syBetti2(leftv res, leftv u, leftv w)
#define pGetExp(p, i)
Exponent.
idhdl enterid(const char *s, int lev, int t, idhdl *root, BOOLEAN init, BOOLEAN search)
void hRadical(scfmon rad, int *Nrad, int Nvar)
@ semicListThirdElementWrongType
BOOLEAN iiAssignCR(leftv r, leftv arg)
virtual number getSubDet()
BOOLEAN jjBETTI2(leftv res, leftv u, leftv v)
void paPrint(const char *n, package p)
bool solver(const int polishmode=PM_NONE)
CanonicalForm map(const CanonicalForm &primElem, const Variable &alpha, const CanonicalForm &F, const Variable &beta)
map from to such that is mapped onto
int search(const CFArray &A, const CanonicalForm &F, int i, int j)
search for F in A between index i and j
@ n_Z2m
only used if HAVE_RINGS is defined
ideal singclap_factorize(poly f, intvec **v, int with_exps, const ring r)
rootContainer ** interpolateDenseSP(BOOLEAN matchUp=false, const number subDetVal=NULL)
@ semicListWrongNumberOfMultiplicities
intvec * syBetti(resolvente res, int length, int *regularity, intvec *weights, BOOLEAN tomin, int *row_shift)
ideal loNewtonPolytope(const ideal id)
#define BREAK_LINE_LENGTH
intvec * id_QHomWeight(ideal id, const ring r)
void idGetNextChoise(int r, int end, BOOLEAN *endch, int *choise)
int iiDeclCommand(leftv sy, leftv name, int lev, int t, idhdl *root, BOOLEAN isring, BOOLEAN init_b)
static BOOLEAN rComposeVar(const lists L, ring R)
vandermonde system solver for interpolating polynomials from their values
static BOOLEAN length(leftv result, leftv arg)
idhdl rDefault(const char *s)
idhdl get(const char *s, int lev)
lists liMakeResolv(resolvente r, int length, int reallen, int typ0, intvec **weights, int add_row_shift)
BOOLEAN spmulProc(leftv result, leftv first, leftv second)
static void list1(const char *s, idhdl h, BOOLEAN c, BOOLEAN fullname)
BOOLEAN mpKoszul(leftv res, leftv c, leftv b, leftv id)
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
@ n_Q
rational (GMP) numbers
static resolvente iiCopyRes(resolvente r, int l)
gmp_float sqrt(const gmp_float &a)
semicState list_is_spectrum(lists l)
BOOLEAN semicProc3(leftv res, leftv u, leftv v, leftv w)
@ n_Znm
only used if HAVE_RINGS is defined
void hDimSolve(scmon pure, int Npure, scfmon rad, int Nrad, varset var, int Nvar)
static BOOLEAN rField_is_Zp_a(const ring r)
static FORCE_INLINE BOOLEAN nCoeff_is_GF(const coeffs r)
resolvente syReorder(resolvente res, int length, syStrategy syzstr, BOOLEAN toCopy=TRUE, resolvente totake=NULL)
char *(* fe_fgets_stdin)(const char *pr, char *s, int size)
@ semicListWrongNumberOfNumerators
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
int iiOpsTwoChar(const char *s)
poly numvec2poly(const number *q)
Class used for (list of) interpreter objects.
BOOLEAN rSleftvOrdering2Ordering(sleftv *ord, ring R)
static FORCE_INLINE BOOLEAN nCoeff_is_long_C(const coeffs r)
#define __p_Mult_nn(p, n, r)
@ semicListSecondElementWrongType
mprState mprIdealCheck(const ideal theIdeal, const char *name, uResultant::resMatType mtype, BOOLEAN rmatrix=false)
BOOLEAN hasAxis(ideal J, int k, const ring r)
const unsigned short fftable[]
BOOLEAN maApplyFetch(int what, map theMap, leftv res, leftv w, ring preimage_r, int *perm, int *par_perm, int P, nMapFunc nMap)
static long pTotaldegree(poly p)
spectrum spectrumFromList(lists l)
@ n_long_R
real floating point (GMP) numbers
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
void mu(int **points, int sizePoints)
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
static unsigned pLength(poly a)
BOOLEAN rEqual(ring r1, ring r2, BOOLEAN qr)
returns TRUE, if r1 equals r2 FALSE, otherwise Equality is determined componentwise,...
poly singclap_resultant(poly f, poly g, poly x, const ring r)
for(int i=0;i<=n;i++) degsf[i]
static BOOLEAN rComposeOrder(const lists L, const BOOLEAN check_comp, ring R)
idhdl packFindHdl(package r)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
static short rVar(const ring r)
#define rVar(r) (r->N)
@ semicListFirstElementWrongType
intvec * ivCopy(const intvec *o)
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
struct for passing initialization parameters to naInitChar
poly p_PermPoly(poly p, const int *perm, const ring oldRing, const ring dst, nMapFunc nMap, const int *par_perm, int OldPar, BOOLEAN use_mult)
BOOLEAN rDecompose_CF(leftv res, const coeffs C)
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
static BOOLEAN idIsZeroDim(ideal i)
static BOOLEAN rField_is_Q_a(const ring r)
BOOLEAN nuUResSolve(leftv res, leftv args)
solve a multipolynomial system using the u-resultant Input ideal must be 0-dimensional and (currRing-...
int status int void * buf
syStrategy syConvList(lists li)
void setGMPFloatDigits(size_t digits, size_t rest)
Set size of mantissa digits - the number of output digits (basis 10) the size of mantissa consists of...
void killlocals_rec(idhdl *root, int v, ring r)
void PrintS(const char *s)
#define omFreeSize(addr, size)
static FORCE_INLINE BOOLEAN nCoeff_is_algExt(const coeffs r)
TRUE iff r represents an algebraic extension field.
void killhdl2(idhdl h, idhdl *ih, ring r)
void rComposeC(lists L, ring R)
BOOLEAN iiApplyIDEAL(leftv, leftv, int, leftv)
gmp_complex * getRoot(const int i)
ideal maMapIdeal(const ideal map_id, const ring preimage_r, const ideal image_id, const ring image_r, const nMapFunc nMap)
polynomial map for ideals/module/matrix map_id: the ideal to map map_r: the base ring for map_id imag...
#define nPrint(a)
only for debug, over any initalized currRing
BOOLEAN kWeight(leftv res, leftv id)
BOOLEAN iiExport(leftv v, int toLev)
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
char * iiGetLibProcBuffer(procinfo *pi, int part)
static BOOLEAN rField_is_Ring(const ring r)
BOOLEAN slWrite(si_link l, leftv v)
syStrategy syForceMin(lists li)
BOOLEAN jjPROC(leftv res, leftv u, leftv v)
@ semicListWrongNumberOfDenominators
static FORCE_INLINE BOOLEAN nCoeff_is_Ring(const coeffs r)
void iiMakeResolv(resolvente r, int length, int rlen, char *name, int typ0, intvec **weights)
spectrumState spectrumStateFromList(spectrumPolyList &speclist, lists *L, int fast)
BOOLEAN lRingDependend(lists L)
BOOLEAN semicProc(leftv res, leftv u, leftv v)
lists rDecompose(const ring r)
void hKill(monf xmem, int Nvar)
BOOLEAN jjBETTI(leftv res, leftv u)
BOOLEAN iiTestAssume(leftv a, leftv b)
void atSet(idhdl root, char *name, void *data, int typ)
matrix singclap_irrCharSeries(ideal I, const ring r)
@ n_Z
only used if HAVE_RINGS is defined
void list_cmd(int typ, const char *what, const char *prefix, BOOLEAN iterate, BOOLEAN fullname)
static void rRenameVars(ring R)
BOOLEAN spaddProc(leftv result, leftv first, leftv second)
static int rPar(const ring r)
(r->cf->P)
void hDelete(scfmon ev, int ev_length)
static BOOLEAN iiNoKeepRing
resMatrixBase * accessResMat()
short float_len
additional char-flags, rInit
intvec * syBettiOfComputation(syStrategy syzstr, BOOLEAN minim=TRUE, int *row_shift=NULL, intvec *weights=NULL)
static poly p_Init(const ring r, omBin bin)
static BOOLEAN rField_is_R(const ring r)
double(* wFunctional)(int *degw, int *lpol, int npol, double *rel, double wx, double wNsqr)
lists scIndIndset(ideal S, BOOLEAN all, ideal Q)
poly computeWC(const newtonPolygon &np, Rational max_weight, const ring r)
static int rBlocks(ring r)
#define __pp_Mult_nn(p, n, r)
int iiTestConvert(int inputType, int outputType)
ring rCompose(const lists L, const BOOLEAN check_comp, const long bitmask, const int isLetterplace)
BOOLEAN nuMPResMat(leftv res, leftv arg1, leftv arg2)
returns module representing the multipolynomial resultant matrix Arguments 2: ideal i,...
void CleanUp(ring r=currRing)
idhdl rSimpleFindHdl(ring r, idhdl root, idhdl n)
void wCall(poly *s, int sl, int *x, double wNsqr, const ring R)
int idGetNumberOfChoise(int t, int d, int begin, int end, int *choise)
void hIndAllMult(scmon pure, int Npure, scfmon rad, int Nrad, varset var, int Nvar)
static FORCE_INLINE BOOLEAN nCoeff_is_transExt(const coeffs r)
TRUE iff r represents a transcendental extension field.
matrix mpNew(int r, int c)
create a r x c zero-matrix
void fillContainer(number *_coeffs, number *_ievpoint, const int _var, const int _tdg, const rootType _rt, const int _anz)
char * complexToStr(gmp_complex &c, const unsigned int oprec, const coeffs src)
number nlMapGMP(number from, const coeffs src, const coeffs dst)
BOOLEAN jjVARIABLES_P(leftv res, leftv u)
denominator_list DENOMINATOR_LIST
@ n_transExt
used for all transcendental extensions, i.e., the top-most extension in an extension tower is transce...
BOOLEAN iiDefaultParameter(leftv p)
Linear Programming / Linear Optimization using Simplex - Algorithm.
int exprlist_length(leftv v)
static BOOLEAN iiInternalExport(leftv v, int toLev)
@ n_R
single prescision (6,6) real numbers
static FORCE_INLINE const char ** n_ParameterNames(const coeffs r)
Returns a (const!) pointer to (const char*) names of parameters.
Base class for solving 0-dim poly systems using u-resultant.
void hPure(scfmon stc, int a, int *Nstc, varset var, int Nvar, scmon pure, int *Npure)
BOOLEAN hasConstTerm(poly h, const ring r)
resolvente liFindRes(lists L, int *len, int *typ0, intvec ***weights)
BOOLEAN jjRESULTANT(leftv res, leftv u, leftv v, leftv w)
void rDelete(ring r)
unconditionally deletes fields in r
uResultant::resMatType determineMType(int imtype)
static void iiReportTypes(int nr, int t, const short *T)
idhdl rFindHdl(ring r, idhdl n)
#define IMATELEM(M, I, J)
procinfo * iiInitSingularProcinfo(procinfov pi, const char *libname, const char *procname, int, long pos, BOOLEAN pstatic)
scfmon hInit(ideal S, ideal Q, int *Nexist, ring tailRing)
int IsCmd(const char *n, int &tok)
static BOOLEAN rField_is_numeric(const ring r)
static BOOLEAN rField_is_GF(const ring r)
ring rInit(leftv pn, leftv rv, leftv ord)
BOOLEAN nc_CallPlural(matrix cc, matrix dd, poly cn, poly dn, ring r, bool bSetupQuotient, bool bCopyInput, bool bBeQuiet, ring curr, bool dummy_ring=false)
returns TRUE if there were errors analyze inputs, check them for consistency detects nc_type,...
void rDecomposeCF(leftv h, const ring r, const ring R)
BOOLEAN iiWRITE(leftv, leftv v)
BOOLEAN spectrumProc(leftv result, leftv first)
static int si_max(const int a, const int b)
BOOLEAN jjVARIABLES_ID(leftv res, leftv u)
void mult(unsigned long *result, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
void list_error(semicState state)
leftv iiMap(map theMap, const char *what)
int mult_spectrum(spectrum &)
BOOLEAN ringIsLocal(const ring r)
@ semicListFifthElementWrongType
void spectrumPrintError(spectrumState state)
const char * iiTwoOps(int t)
void delete_node(spectrumPolyNode **)
BOOLEAN iiApplyINTVEC(leftv res, leftv a, int op, leftv proc)
void hSupp(scfmon stc, int Nstc, varset var, int *Nvar)
void rSetSyzComp(int k, const ring r)
@ ringorder_IS
Induced (Schreyer) ordering.
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
void Werror(const char *fmt,...)
void idInitChoise(int r, int beg, int end, BOOLEAN *endch, int *choise)
static leftv rOptimizeOrdAsSleftv(leftv ord)
ideal idInit(int idsize, int rank)
initialise an ideal / module
int hasOne(ideal J, const ring r)
const char * rSimpleOrdStr(int ord)
char name(const Variable &v)
char * lString(lists l, BOOLEAN typed, int dim)
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
Rational pow(const Rational &a, int e)
void WerrorS(const char *s)
poly iiHighCorner(ideal I, int ak)
virtual ideal getMatrix()
static FORCE_INLINE char * nCoeffName(const coeffs cf)
BOOLEAN iiARROW(leftv r, char *a, char *s)
@ semicListSixthElementWrongType
static BOOLEAN rSleftvList2StringArray(leftv sl, char **p)
void computeNF(ideal stdJ, poly hc, poly wc, spectrumPolyList *NF, const ring r)
void maFindPerm(char const *const *const preim_names, int preim_n, char const *const *const preim_par, int preim_p, char const *const *const names, int n, char const *const *const par, int nop, int *perm, int *par_perm, n_coeffType ch)
static void jjINT_S_TO_ID(int n, int *e, leftv res)
static void killlocals0(int v, idhdl *localhdl, const ring r)
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 ....
#define omRealloc0Size(addr, o_size, size)
BOOLEAN iiCheckRing(int i)
ring rAssure_HasComp(const ring r)
lists listOfRoots(rootArranger *self, const unsigned int oprec)
const Variable & v
< [in] a sqrfree bivariate poly
#define omCheckAddr(addr)
INLINE_THIS void Init(int l=0)
BOOLEAN mapFromMatrix(matrix m)
static long p_Totaldegree(poly p, const ring r)
BOOLEAN jjCHARSERIES(leftv res, leftv u)
const char * par_name
parameter name
BOOLEAN iiApplyBIGINTMAT(leftv, leftv, int, leftv)
int mult_spectrumh(spectrum &)
@ ringorder_aa
for idElimination, like a, except pFDeg, pWeigths ignore it
idhdl ggetid(const char *n)
const CanonicalForm int s
BOOLEAN iiCheckTypes(leftv args, const short *type_list, int report)
check a list of arguemys against a given field of types return TRUE if the types match return FALSE (...
int rTypeOfMatrixOrder(const intvec *order)
int status int void size_t count
const char * Tok2Cmdname(int tok)
lists rDecompose_list_cf(const ring r)
#define pCopy(p)
return a copy of the poly
spectrumState spectrumCompute(poly h, lists *L, int fast)
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
BOOLEAN mpJacobi(leftv res, leftv a)
BOOLEAN iiParameter(leftv p)
static int * multiplicity
ideal kStd(ideal F, ideal Q, tHomog h, intvec **w, intvec *hilb, int syzComp, int newIdeal, intvec *vw, s_poly_proc_t sp)
void rDecomposeRing_41(leftv h, const coeffs C)
@ ringorder_rs
opposite of ls
@ ringorder_a64
for int64 weights
complex root finder for univariate polynomials based on laguers algorithm
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
lists getList(spectrum &spec)
static const char ** rParameter(const ring r)
(r->cf->parameter)
lists syConvRes(syStrategy syzstr, BOOLEAN toDel, int add_row_shift)
matrix mp_Copy(matrix a, const ring r)
copies matrix a (from ring r to r)
static BOOLEAN rField_is_Z(const ring r)
static BOOLEAN rField_is_long_C(const ring r)
unsigned char * proc[NUM_PROC]
#define omFreeBin(addr, bin)
static BOOLEAN rField_is_Zp(const ring r)
void newBuffer(char *s, feBufferTypes t, procinfo *pi, int lineno)
BOOLEAN loNewtonP(leftv res, leftv arg1)
compute Newton Polytopes of input polynomials
#define pGetVariables(p, e)
void hLexR(scfmon rad, int Nrad, varset var, int Nvar)
static FORCE_INLINE void n_MPZ(mpz_t result, number &n, const coeffs r)
conversion of n to a GMP integer; 0 if not possible
rRingOrder_t rOrderName(char *ordername)
BOOLEAN loSimplex(leftv res, leftv args)
Implementation of the Simplex Algorithm.
BOOLEAN iiAssign(leftv l, leftv r, BOOLEAN toplevel)
const ExtensionInfo & info
< [in] sqrfree poly
@ semicListFourthElementWrongType
BOOLEAN kQHWeight(leftv res, leftv v)
matrix mapToMatrix(matrix m)
BOOLEAN nuLagSolve(leftv res, leftv arg1, leftv arg2, leftv arg3)
find the (complex) roots an univariate polynomial Determines the roots of an univariate polynomial us...
static void rDecomposeC_41(leftv h, const coeffs C)
#define pCmp(p1, p2)
pCmp: args may be NULL returns: (p2==NULL ? 1 : (p1 == NULL ? -1 : p_LmCmp(p1, p2)))
void syKillComputation(syStrategy syzstr, ring r=currRing)
ring rSubring(ring org_ring, sleftv *rv)
void syKillEmptyEntres(resolvente res, int length)
BOOLEAN killlocals_list(int v, lists L)
rootContainer ** specializeInU(BOOLEAN matchUp=false, const number subDetVal=NULL)
ideal idrCopyR(ideal id, ring src_r, ring dest_r)
void rDecomposeRing(leftv h, const ring R)
@ n_algExt
used for all algebraic extensions, i.e., the top-most extension in an extension tower is algebraic
static BOOLEAN rField_is_Q(const ring r)
BOOLEAN iiApply(leftv res, leftv a, int op, leftv proc)
static int rInternalChar(const ring r)
BOOLEAN iiBranchTo(leftv, leftv args)
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...
#define omReallocSize(addr, o_size, size)
void nlGMP(number &i, mpz_t n, const coeffs r)
BOOLEAN hasLinearTerm(poly h, const ring r)
void Clean(ring r=currRing)
#define idMaxIdeal(D)
initialise the maximal ideal (at 0)