Changeset b8ad3a in git
- Timestamp:
- Jan 4, 2024, 4:39:13 PM (4 months ago)
- Branches:
- (u'spielwiese', 'c5facdfddea2addfd91babd8b9019161dea4b695')
- Children:
- 4b0877fd8b06e461f8c2450538a142d631260806
- Parents:
- dff47b7996ab7bb15ce9bd372c7fc531a02308f7
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/primdec.lib
rdff47b rb8ad3a 6460 6460 list qr = simplifyIdeal(i); 6461 6461 map phi = @P, qr[2]; // map from the same ring, to simplify the ideal 6462 6463 6462 6463 6464 6464 option(redSB); 6465 i = groebner(qr[1]); // We use the transformed variables, and we 6465 i = groebner(qr[1]); // We use the transformed variables, and we 6466 6466 // will use map phi to go back to the original 6467 6467 // variables … … 6538 6538 } 6539 6539 } 6540 6540 6541 6541 rad=interred(phi(rad)); // Eliminate redundant polynomials 6542 6542 setring(P0); -
Singular/LIB/puiseuxexpansions.lib
rdff47b rb8ad3a 479 479 @c = puiseuxStep(fTemp, slN, 1); 480 480 fc = factorize(@c); 481 481 482 482 for(j = 2; j <= size(fc[1]); j++) 483 483 { … … 505 505 { 506 506 sizeErg = size(erg); 507 } else 507 } else 508 508 { 509 509 sizeErg = 1; … … 538 538 { 539 539 cs[size(cs) + 1] = list((csT[k][1] + c1)*(var(1)^(csT[k][2]*slN)), csT[k][2]*slD); 540 } else 540 } else 541 541 { 542 542 cs[size(cs) + 1] = list(csT[k][1] + c1, csT[k][2]*slD); … … 547 547 // NEW CODING FOR CONJUGATED EXPANSIONS 548 548 cs[size(cs)][6] = insert(csT[k][6], cod); 549 549 550 550 if(newExt == 1) 551 551 { … … 565 565 } 566 566 } 567 } else 567 } else 568 568 { 569 569 def RT = csT[k]; … … 928 928 929 929 fNew1 = subst(f, var(1), var(1)^slD); 930 930 931 931 for(ii = 2; ii <= size(fJe[1]); ii++) 932 932 { … … 948 948 @c = puiseuxStep(fTemp, slN, 1); 949 949 fc = factorize(@c); 950 950 951 951 // Stopping criterium 952 952 stop = 0; … … 957 957 stop = 1; 958 958 } 959 } else 959 } else 960 960 { 961 961 if(slN >= slD * maxDeg) … … 968 968 { 969 969 //minP = fc[1][j]; 970 970 971 971 // The minpoly of Y^5-1 is Y-1 and the minpoly of Y^5-2 is Y^5-2. 972 972 minPBefore = subst(fJe[1][ii],var(1),1); … … 981 981 { 982 982 sizeErg = size(erg); 983 } else 983 } else 984 984 { 985 985 sizeErg = 1; … … 1014 1014 { 1015 1015 cs[size(cs) + 1] = list((csT[k][1] + c1)*(var(1)^(csT[k][2]*slN)), csT[k][2]*slD); 1016 } else 1016 } else 1017 1017 { 1018 1018 cs[size(cs) + 1] = list(csT[k][1] + c1, csT[k][2]*slD); … … 1023 1023 // NEW CODING FOR CONJUGATED EXPANSIONS 1024 1024 cs[size(cs)][6] = insert(csT[k][6], cod); 1025 1025 1026 1026 if(newExt == 1) 1027 1027 { … … 1039 1039 } 1040 1040 } 1041 } else 1041 } else 1042 1042 { 1043 1043 def RT = csT[k]; -
Singular/extra.cc
rdff47b rb8ad3a 4147 4147 } 4148 4148 else 4149 #endif 4149 #endif 4150 4150 /*==================== Error =================*/ 4151 4151 Werror( "(extended) system(\"%s\",...) %s", sys_cmd, feNotImplemented ); -
Singular/fehelp.cc
rdff47b rb8ad3a 1028 1028 } 1029 1029 Print("running `%s`\n",sys); 1030 if (!FE_OPT_NO_SHELL_FLAG) 1030 if (!FE_OPT_NO_SHELL_FLAG) 1031 1031 { 1032 1032 int err=system(sys); -
Singular/iplib.cc
rdff47b rb8ad3a 206 206 } 207 207 208 fseek(fp, pi->data.s.proc_start, SEEK_SET); 208 int res=fseek(fp, pi->data.s.proc_start, SEEK_SET); 209 if (res==1) return NULL; 209 210 if(part==0) 210 211 { // load help string … … 220 221 // pi->data.s.proc_start, procbuflen); 221 222 s = (char *)omAlloc(procbuflen+head+3); 222 myfread(s, head, 1, fp); 223 res=myfread(s, head, 1, fp); 224 if (res<=0) /* error*/ { omFree(s); return NULL; } 223 225 s[head] = '\n'; 224 fseek(fp, pi->data.s.help_start, SEEK_SET); 225 myfread(s+head+1, procbuflen, 1, fp); 226 int res=fseek(fp, pi->data.s.help_start, SEEK_SET); 227 if (res==-1) /*error*/ { omFree(s); return NULL; } 228 res=myfread(s+head+1, procbuflen, 1, fp); 229 if (res<=0) /* error*/ { omFree(s); return NULL; } 226 230 fclose(fp); 227 231 s[procbuflen+head+1] = '\n'; … … 281 285 // load example 282 286 fseek(fp, pi->data.s.example_start, SEEK_SET); 283 /*char *dummy=*/ (void) fgets(buf, sizeof(buf), fp); // skip line with "example" 287 char* res=fgets(buf, sizeof(buf), fp); // skip line with "example" 288 if (res==NULL) /*error or eof*/ 289 { 290 return omStrDup(""); 291 } 284 292 procbuflen = pi->data.s.proc_end - pi->data.s.example_start - strlen(buf); 285 293 //Print("Example=%ld-%ld=%d\n", pi->data.s.proc_end, -
Singular/links/ssiLink.cc
rdff47b rb8ad3a 1024 1024 if (strcmp(mode,"fork")==0) 1025 1025 { 1026 int pc[2]; 1027 int cp[2]; 1028 int err1=pipe(pc); 1029 int err2=pipe(cp); 1030 if (err1 || err2) 1031 { 1032 Werror("pipe failed with %d\n",errno); 1033 return TRUE; 1034 } 1026 1035 link_list n=(link_list)omAlloc(sizeof(link_struct)); 1027 1036 n->u=u; … … 1030 1039 ssiToBeClosed=n; 1031 1040 1032 int pc[2];1033 int cp[2];1034 pipe(pc);1035 pipe(cp);1036 1041 pid_t pid = fork(); 1037 1042 if (pid == -1 && errno == EAGAIN) // RLIMIT_NPROC too low? … … 1257 1262 omFree(cli_host); 1258 1263 if (TEST_OPT_PROT) { Print("running >>%s<<\n",ssh_command); } 1259 system(ssh_command); 1264 int re=system(ssh_command); 1265 if (re<0) 1266 { 1267 Werror("ERROR running `%s` (%d)",ssh_command,re); 1268 l->data=NULL; 1269 l->flags=0; 1270 omFree(d); 1271 return TRUE; 1272 } 1260 1273 omFree(ssh_command); 1261 1274 omFree(ser_host); -
Singular/sdb.cc
rdff47b rb8ad3a 144 144 } 145 145 146 write(f,pi->data.s.body,strlen(pi->data.s.body));146 size_t res=write(f,pi->data.s.body,strlen(pi->data.s.body)); 147 147 close(f); 148 if (res==-1) 149 { 150 PrintS("cannot write the procedure body\n"); 151 si_unlink(filename); 152 omFree(filename); 153 return; 154 } 148 155 149 156 int pid=fork(); … … 164 171 char *p=(char *)omAlloc(len); 165 172 snprintf(p,len,"%s %s",editor,filename); 166 system(p); 173 int res=system(p); 174 if (res<0) 175 { 176 Print("cannot call `%s`\n",editor); 177 } 167 178 } 168 179 exit(0); -
libpolys/coeffs/flintcf_Qrat.cc
rdff47b rb8ad3a 70 70 } 71 71 72 static void fmpq_rat_canonicalise(fmpq_rat_ptr a, const coeffs r)72 static void fmpq_rat_canonicalise(fmpq_rat_ptr a, const coeffs /*r*/) 73 73 { 74 74 fmpz_t n, d; … … 99 99 if (c->type == n) 100 100 { 101 const fmpq_ctx_ptr ctx = (fmpq_ctx_ptr) ((data_ptr)c->data)->ctx;102 101 const QaInfo *par=(QaInfo*)parameter; 103 102 if (par->N != c->iNumberOfParameters) return FALSE; … … 630 629 if (fmpq_mpoly_is_fmpq(x->den, ctx) && fmpq_mpoly_is_fmpq(x->num, ctx)) 631 630 { 632 long nl = 0;633 631 fmpq_t r; 634 632 fmpq_init(r); … … 1184 1182 } 1185 1183 1186 static number ExtGcd(number a, number b, number *s, number *t, const coeffs c)1184 static number ExtGcd(number /*a*/, number /*b*/, number* /*s*/, number* /*t*/, const coeffs /*c*/) 1187 1185 { 1188 1186 WerrorS("not a Euclidean ring: ExtGcd"); … … 1190 1188 } 1191 1189 1192 static number Lcm(number a, number b, const coeffs c)1190 static number Lcm(number /*a*/, number /*b*/, const coeffs /*c*/) 1193 1191 { 1194 1192 WerrorS("not yet: Lcm"); … … 1196 1194 } 1197 1195 1198 static number Q2Frac(number a, const coeffs src, const coeffs dst)1196 static number Q2Frac(number a, const coeffs /*src*/, const coeffs dst) 1199 1197 { 1200 1198 number res; … … 1222 1220 } 1223 1221 1224 static number Z2Frac(number a, const coeffs src, const coeffs dst)1222 static number Z2Frac(number a, const coeffs /*src*/, const coeffs dst) 1225 1223 { 1226 1224 return InitMPZ((mpz_ptr)a,dst); … … 1508 1506 { 1509 1507 const fmpq_rat_ptr x = (fmpq_rat_ptr) c; 1510 if ((x!=NULL) 1511 && ((x->num==NULL)||(x->den==NULL))) 1512 { 1513 dReportError("NULL num., or den.\n"); 1514 return FALSE; 1515 } 1516 const fmpq_ctx_ptr ctx = (fmpq_ctx_ptr) ((data_ptr)cf->data)->ctx; 1517 fmpq_mpoly_assert_canonical(x->num,ctx); 1518 fmpq_mpoly_assert_canonical(x->den,ctx); 1519 if (fmpq_mpoly_is_zero(x->den, ctx)) 1520 { 1521 dReportError("den.==0\n"); 1522 return FALSE; 1523 } 1524 fmpz_t n, d; 1525 fmpz_init(n); 1526 fmpz_init(d); 1527 fmpz_gcd(n, fmpq_numref(x->num->content), fmpq_numref(x->den->content)); 1528 fmpz_lcm(d, fmpq_denref(x->num->content), fmpq_denref(x->den->content)); 1529 if (!fmpz_is_one(d)) 1530 { 1531 dReportError("canon needed (1)"); 1532 return TRUE; 1533 } 1534 if (!fmpz_is_one(n)) 1535 { 1536 dReportError("canon needed (2)"); 1537 return TRUE; 1538 } 1539 fmpz_clear(n); 1540 fmpz_clear(d); 1541 #ifdef QA_DEBUG 1542 poly pp=convFlintMPSingP(x->num,ctx,((data_ptr)cf->data)->C->extRing); 1543 fraction f=(fraction)x->p; 1544 if (f==NULL) 1545 { 1546 dReportError("x->p==NULL\n"); 1547 return FALSE; 1548 } 1549 else 1550 { 1551 if (!p_EqualPolys(pp,NUM(f),((data_ptr)cf->data)->C->extRing)) 1552 { 1553 p_Write(pp,((data_ptr)cf->data)->C->extRing); 1554 PrintS("num, p="); 1555 p_Write(NUM(f),((data_ptr)cf->data)->C->extRing); 1556 dReportError("num wrong.\n"); 1508 if (x!=NULL) 1509 { 1510 const fmpq_ctx_ptr ctx = (fmpq_ctx_ptr) ((data_ptr)cf->data)->ctx; 1511 fmpq_mpoly_assert_canonical(x->num,ctx); 1512 fmpq_mpoly_assert_canonical(x->den,ctx); 1513 if (fmpq_mpoly_is_zero(x->den, ctx)) 1514 { 1515 dReportError("den.==0\n"); 1557 1516 return FALSE; 1558 1517 } 1559 if (DEN(f)!=NULL) 1560 { 1561 pp=convFlintMPSingP(x->den,ctx,((data_ptr)cf->data)->C->extRing); 1562 if (!p_EqualPolys(pp,DEN(f),((data_ptr)cf->data)->C->extRing)) 1518 fmpz_t n, d; 1519 fmpz_init(n); 1520 fmpz_init(d); 1521 fmpz_gcd(n, fmpq_numref(x->num->content), fmpq_numref(x->den->content)); 1522 fmpz_lcm(d, fmpq_denref(x->num->content), fmpq_denref(x->den->content)); 1523 if (!fmpz_is_one(d)) 1524 { 1525 dReportError("canon needed (1)"); 1526 return TRUE; 1527 } 1528 if (!fmpz_is_one(n)) 1529 { 1530 dReportError("canon needed (2)"); 1531 return TRUE; 1532 } 1533 fmpz_clear(n); 1534 fmpz_clear(d); 1535 #ifdef QA_DEBUG 1536 poly pp=convFlintMPSingP(x->num,ctx,((data_ptr)cf->data)->C->extRing); 1537 fraction f=(fraction)x->p; 1538 if (f==NULL) 1539 { 1540 dReportError("x->p==NULL\n"); 1541 return FALSE; 1542 } 1543 else 1544 { 1545 if (!p_EqualPolys(pp,NUM(f),((data_ptr)cf->data)->C->extRing)) 1563 1546 { 1564 1547 p_Write(pp,((data_ptr)cf->data)->C->extRing); 1565 PrintS(" den, p=");1548 PrintS("num, p="); 1566 1549 p_Write(NUM(f),((data_ptr)cf->data)->C->extRing); 1567 dReportError(" denwrong.\n");1550 dReportError("num wrong.\n"); 1568 1551 return FALSE; 1569 1552 } 1570 } 1571 } 1572 #endif 1553 if (DEN(f)!=NULL) 1554 { 1555 pp=convFlintMPSingP(x->den,ctx,((data_ptr)cf->data)->C->extRing); 1556 if (!p_EqualPolys(pp,DEN(f),((data_ptr)cf->data)->C->extRing)) 1557 { 1558 p_Write(pp,((data_ptr)cf->data)->C->extRing); 1559 PrintS("den, p="); 1560 p_Write(NUM(f),((data_ptr)cf->data)->C->extRing); 1561 dReportError("den wrong.\n"); 1562 return FALSE; 1563 } 1564 } 1565 } 1566 #endif 1567 } 1573 1568 return TRUE; 1574 1569 } -
libpolys/coeffs/gnumpc.cc
rdff47b rb8ad3a 603 603 // cfSize = ndSize; 604 604 #ifdef LDEBUG 605 //n->cfDBTest = ndDBTest; // not yet implemented: ngcDBTest605 n->cfDBTest = ngcDBTest; // not yet implemented: ngcDBTest 606 606 #endif 607 607 -
libpolys/coeffs/longrat.cc
rdff47b rb8ad3a 1758 1758 case 1: 1759 1759 mpz_init_set(b->n,a->n); 1760 /*no break*/ 1760 1761 case 3: 1761 1762 mpz_init_set(b->z,a->z); … … 1774 1775 case 1: 1775 1776 mpz_clear((*a)->n); 1777 /*no break*/ 1776 1778 case 3: 1777 1779 mpz_clear((*a)->z); -
libpolys/coeffs/rmodulon.cc
rdff47b rb8ad3a 72 72 nrnCoeffName_buff=(char*)omAlloc(l); 73 73 s= mpz_get_str (s, 10, r->modBase); 74 int ll ;74 int ll=0; 75 75 if (nCoeff_is_Zn(r)) 76 76 { -
m4/ccluster-check.m4
rdff47b rb8ad3a 46 46 if test "x$HAVE_CCLUSTER" != "xyes"; then 47 47 AC_MSG_RESULT(not found) 48 fi 48 fi 49 49 AM_CONDITIONAL(SING_HAVE_CCLUSTER, test "x$HAVE_CCLUSTER" = "xyes") 50 50 ]) -
m4/options.m4
rdff47b rb8ad3a 173 173 AC_SUBST(RESOURCES_LIBS) 174 174 175 if test "x$htmldir" = "x\${docdir}"; then 175 if test "x$htmldir" = "x\${docdir}"; then 176 176 DEFAULT_HTMLDIR="--htmldir=$datarootdir/doc/singular" 177 177 fi
Note: See TracChangeset
for help on using the changeset viewer.