Changeset 3693cf in git
- Timestamp:
- Feb 19, 2013, 9:45:45 PM (10 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- 5e42ec33c5a0d777cb71dc36d36924181f7d88b3
- Parents:
- fd60be56d6b370a06c2d461f568680391606dbc1236a4c0b334deb5ef1062f5eeac7f6bcaf807f35
- Files:
-
- 4 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
.gitignore
r236a4c r3693cf 10 10 .libs 11 11 doc/ 12 AUTOGEN_generated_stuff 12 13 MOD 13 14 libsingular-config … … 110 111 stamp-h1 111 112 stamp-h2 112 113 test-driver 113 114 singular.png -
Makefile.am
r236a4c r3693cf 15 15 16 16 emacsdir=$(datadir)/emacs 17 dist_emacs_DATA =emacs/BUGS \17 EMACS = emacs/BUGS \ 18 18 emacs/ChangeLog \ 19 19 emacs/cmpl.pl \ … … 27 27 emacs/singular.xpm 28 28 29 dist_emacs_DATA = $(EMACS) 30 29 31 # emacs/test.sing 30 32 # TODO: remove this! … … 33 35 34 36 35 EXTRA_DIST = autogen.sh emacs37 EXTRA_DIST = autogen.sh $(EMACS) 36 38 37 39 -
Singular/MinorInterface.cc
r236a4c r3693cf 190 190 /* before we return the result, let's omit zero generators 191 191 in iii which come after the computed minors */ 192 ideal jjj; 193 if (collectedMinors == 0) jjj = idInit(1); 194 else jjj = idCopyFirstK(iii, collectedMinors); 195 idDelete(&iii); 192 idKeepFirstK(iii, collectedMinors); 196 193 delete[] myColumnIndices; 197 194 delete[] myRowIndices; 198 return jjj;195 return(iii); 199 196 } 200 197 … … 542 539 else 543 540 { /* k == 0, i.e., all minors are requested */ 544 int minorCount = 1; 545 for (int i = rowCount - minorSize + 1; i <= rowCount; i++) 546 minorCount = minorCount * i; 547 for (int i = 2; i <= minorSize; i++) minorCount = minorCount / i; 548 for (int i = columnCount - minorSize + 1; i <= columnCount; i++) 549 minorCount = minorCount * i; 550 for (int i = 2; i <= minorSize; i++) minorCount = minorCount / i; 551 /* now: minorCount = (rowCount over minorSize) 552 * (columnCount over minorSize) */ 541 int minorCount = binom(rowCount, minorSize); 542 minorCount *= binom(columnCount, minorSize); 553 543 if ((minorSize >= 3) && (vars <= 4) 554 544 && (minorCount >= 100)) c = true; -
Tst/New/bigints.res.gz.uu
rfd60be r3693cf 1 1 begin 664 bigints.res.gz 2 M'XL(" )$X(E$``V)I9VEN=',N<F5S`.V8VV[:0!"&[WF*">T%),1A;6-S4*C43 M 5JJ0FEXDZ6TJ@S=T%6,;>Z&MJKY[Q]CL#F='*9608B&PUS/_C'<^>Q;?W7\<4 M ?`$`UH?/@_=0E:DT`C&L]@#WOHE0R%J]5\E^H=^'H1B+4*9&R'\8J?1DY:YP5 M -_N@]BT#XB0:P3U/T5D-VP;\5@<M`ZKG^[=J3UF[:)V(<-P%S&OHI3P[T*<[6 M A@K.F%$D"1Y<0V?GIKR91;Q;9!^#AK/)D"<0HI*G'3"<UX#JY65_:5!M0"JS7 M G&IA7=F9F$H<!;\@7G$W+>V^.*V=8^*,F<SY2$8)S%?=7>U>&&B!.1$@DV)A8 M )L+G7@"#%2V+I)*?UU(#+6616;$P_"3R9P&'FU4M,BN%@1:[T6(VTV(VF7H;9 M @UQ=058XL1!6B>&(5A+U7F861A+261Q'B>3^F=)PB1[F4]4(M4C8%H;]HPYL10 M 36X+<\BBP"UF4&O6&[+AQ[T<X]Z3"`*X[54.4%O).:U@D@"C[U[BC23BFDHQ11 M @BXT\_$"F^@1YEZ2XCC+QQ?;,(A&3]D=B>-1XB]8!S\F%GKK0NA->)KMRBT212 M )I7X4-E]-P"!><]-<TAAP?,+_`N@]RB<CWE88_5#0CG-+\BD0+A$)@H>AX#D13 M 4I#,(X!DG@)(K!PO!\V66#RK]@=5ER5>KV.[3VIG-Z8OK]X;&"?1+/3A4?#`14 M QZFT\_$X$1,AQ9P##_B$XX.N"]/\U$2$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20*,O_NI/Q:(:R;X 11 M&/J@%^,E-O$#+/PTPW&C&%]NHS`>/^9W)([':;!D'8*$6*BM#Y$_95F^*W9( 12 MF%3B0Z/Z;@`"\YZ;YI#"DN=G^)=`[U$XG;"H9;0/"14T/R.3$N$:F4AX'`*2 13 M2T$R7P`D\QA`,NKQ<M!LA<63:G]0=57BS3KV!J1V=F?V_.J]@4D:SZ,`'C@+ 14 M`YQ*NQA/4C[E@B\8L)!-&3[H^C`K3DUY5$S.JCS&Z>S>/,N_C>7W43Q)CA.` 15 M2W4C.[IJ&XZQUAW^!1A5_<&`!$],F<@G,:_-#"JP.`H,JLU>&\IV)I(WLJ9V 16 MR$K)L7=S6+)Q-</'Q`:4N&1ZA]M_9K.59])^!72?_U$#VB6`.@10L@QW>F2? 17 M_"5Q=0IQBKF_Q-.T5#X&!`U-UW5V9CHU6V9=\Q5@TN%I/-6.L\)G*XZLN#'8 18 MJ'C'TO'S<G7O6SH$?,)%U@$_"'"E%4=X37+T*+BH-GM]-&UG(F$S*6SC>)J$ 19 M[.?+D%:*]YU=K#GKJ&WU3E[9._G]L31/73/P?G?KX5C3>,5>:?XTT&K&6%&U 20 M$4,B9*GNYMJD<Y&W82[I>B[I>B[I>B[I>CWR=Z)G+%]X*4IY)-B$I3LIS2W? 21 M?_UT<B+?=?7,W>X=NU(`J12Q]"<KRAZYO!Y>7O[F-W^[.\]P0KRWC;_,83;Q 22 $)!8````` 23 23 ` 24 24 end -
Tst/New/bigints.stat
rfd60be r3693cf 1 1 >> tst_memory_0 :: 1361 197201:0- spielwiese :spielwiese:version:mandelbrot:1005682 1 >> tst_memory_1 :: 1361 197201:0- spielwiese :spielwiese:version:mandelbrot:22159363 1 >> tst_memory_2 :: 1361 197201:0- spielwiese :spielwiese:version:mandelbrot:22159364 1 >> tst_timer_1 :: 1361 197201:0- spielwiese :spielwiese:version:mandelbrot:21 1 >> tst_memory_0 :: 1361274590:3.1.3.sw $Id$:spielwiese:version:thinktank:97040 2 1 >> tst_memory_1 :: 1361274590:3.1.3.sw $Id$:spielwiese:version:thinktank:2236416 3 1 >> tst_memory_2 :: 1361274590:3.1.3.sw $Id$:spielwiese:version:thinktank:2236416 4 1 >> tst_timer_1 :: 1361274590:3.1.3.sw $Id$:spielwiese:version:thinktank:4 -
kernel/ideals.cc
r236a4c r3693cf 11 11 12 12 #include <omalloc/omalloc.h> 13 #include <misc/auxiliary.h>14 15 13 16 14 #ifndef NDEBUG … … 2559 2557 */ 2560 2558 2561 2562 2559 /// keeps the first k (>= 1) entries of the given ideal 2560 /// (Note that the kept polynomials may be zero.) 2561 void idKeepFirstK(ideal id, const int k) 2562 { 2563 for (int i = IDELEMS(id)-1; i >= k; i--) 2564 { 2565 if (id->m[i] != NULL) pDelete(&id->m[i]); 2566 } 2567 int kk=k; 2568 if (k==0) kk=1; /* ideals must have at least one element(0)*/ 2569 pEnlargeSet(&(id->m), IDELEMS(id), kk-IDELEMS(id)); 2570 IDELEMS(id) = kk; 2571 } 2572 2573 /* 2574 * compare the leading terms of a and b 2575 */ 2576 static int tCompare(const poly a, const poly b) 2577 { 2578 if (b == NULL) return(a != NULL); 2579 if (a == NULL) return(-1); 2580 2581 /* a != NULL && b != NULL */ 2582 int r = pLmCmp(a, b); 2583 if (r != 0) return(r); 2584 number h = nSub(pGetCoeff(a), pGetCoeff(b)); 2585 r = -1 + nIsZero(h) + 2*nGreaterZero(h); /* -1: <, 0:==, 1: > */ 2586 nDelete(&h); 2587 return(r); 2588 } 2589 2590 /* 2591 * compare a and b (rev-lex on terms) 2592 */ 2593 static int pCompare(const poly a, const poly b) 2594 { 2595 int r = tCompare(a, b); 2596 if (r != 0) return(r); 2597 2598 poly aa = a; 2599 poly bb = b; 2600 while (r == 0 && aa != NULL && bb != NULL) 2601 { 2602 pIter(aa); 2603 pIter(bb); 2604 r = tCompare(aa, bb); 2605 } 2606 return(r); 2607 } 2608 2609 typedef struct 2610 { 2611 poly p; 2612 int index; 2613 } poly_sort; 2614 2615 int pCompare_qsort(const void *a, const void *b) 2616 { 2617 int res = pCompare(((poly_sort *)a)->p, ((poly_sort *)b)->p); 2618 return(res); 2619 } 2620 2621 void idSort_qsort(poly_sort *id_sort, int idsize) 2622 { 2623 qsort(id_sort, idsize, sizeof(poly_sort), pCompare_qsort); 2624 } 2625 2626 /*2 2627 * ideal id = (id[i]) 2628 * if id[i] = id[j] then id[j] is deleted for j > i 2629 */ 2630 void idDelEquals(ideal id) 2631 { 2632 int idsize = IDELEMS(id); 2633 poly_sort *id_sort = (poly_sort *)omAlloc0(idsize*sizeof(poly_sort)); 2634 for (int i = 0; i < idsize; i++) 2635 { 2636 id_sort[i].p = id->m[i]; 2637 id_sort[i].index = i; 2638 } 2639 idSort_qsort(id_sort, idsize); 2640 int index, index_i, index_j; 2641 int i = 0; 2642 for (int j = 1; j < idsize; j++) 2643 { 2644 if (id_sort[i].p != NULL && pEqualPolys(id_sort[i].p, id_sort[j].p)) 2645 { 2646 index_i = id_sort[i].index; 2647 index_j = id_sort[j].index; 2648 if (index_j > index_i) 2649 { 2650 index = index_j; 2651 } 2652 else 2653 { 2654 index = index_i; 2655 i = j; 2656 } 2657 pDelete(&id->m[index]); 2658 } 2659 else 2660 { 2661 i = j; 2662 } 2663 } 2664 omFreeSize((ADDRESS)(id_sort), idsize*sizeof(poly_sort)); 2665 } -
kernel/ideals.h
r236a4c r3693cf 24 24 } 25 25 26 void idKeepFirstK(ideal ide, const int k); 27 void idDelEquals(ideal id); 28 26 29 /// delete an ideal 27 30 inline void idDelete (ideal* h, ring r = currRing) -
libpolys/coeffs/shortfl.cc
rfd60be r3693cf 6 6 * ABSTRACT: 7 7 */ 8 8 #include <iostream> 9 9 #include <coeffs/shortfl.h> 10 10 11 11 #include <string.h> 12 #include <math.h> 12 13 #include <coeffs/coeffs.h> 13 14 #include <coeffs/numbers.h> … … 373 374 assume( getCoeffType(r) == ID ); 374 375 assume( getCoeffType(aRing) == n_Zp ); 375 376 376 377 int i = (int)((long)from); 377 378 float f = (float)i; … … 389 390 390 391 static number nrMapC(number from, const coeffs aRing, const coeffs r) 391 { 392 { 392 393 assume( getCoeffType(r) == ID ); 393 394 assume( getCoeffType(aRing) == n_long_C ); 394 395 395 396 gmp_float h = ((gmp_complex*)from)->real(); 396 397 float t =(float)mpf_get_d((mpf_srcptr)&h); … … 406 407 */ 407 408 #define SR_HDL(A) ((long)(A)) 408 #define mpz_isNeg(A) ((A)->_mp_size<0)409 #define mpz_limb_size(A) ((A)->_mp_size)410 #define mpz_limb_d(A) ((A)->_mp_d)411 #define MPZ_DIV(A,B,C) mpz_tdiv_q((A),(B),(C))412 409 #define IS_INT(A) ((A)->s==3) 413 410 #define IS_IMM(A) (SR_HDL(A)&SR_INT) 414 411 #define GET_NOM(A) ((A)->z) 415 412 #define GET_DENOM(A) ((A)->n) 416 #define MPZ_INIT mpz_init417 #define MPZ_CLEAR mpz_clear418 413 419 414 assume( getCoeffType(r) == ID ); 420 415 assume( getCoeffType(aRing) == n_Q ); 421 422 mpz_t h;423 mpz_ptr g,z,n;424 int i,j,t,s;425 float ba,rr,rn,y;426 416 427 417 if (IS_IMM(from)) 428 418 return nf((float)nlInt(from,NULL /* dummy for nlInt*/)).N(); 429 z=GET_NOM(from); 430 s=0X10000; 431 ba=(float)s; 432 ba*=ba; 433 rr=0.0; 434 i=mpz_size1(z); 419 420 /* read out the enumerator */ 421 mpz_ptr z=GET_NOM(from); 422 if(mpz_size1(z)>4) 423 { 424 WerrorS("float overflow"); 425 return nf(0.0).N(); 426 } 427 mpf_t e; 428 mpf_init(e); 429 mpf_set_z(e,z); 430 431 /* if number was an integer, we are done*/ 435 432 if(IS_INT(from)) 436 433 { 437 if(i>4) 438 { 439 WerrorS("float overflow"); 440 return nf(rr).N(); 441 } 442 i--; 443 rr=(float)mpz_limb_d(z)[i]; 444 while(i>0) 445 { 446 i--; 447 y=(float)mpz_limb_d(z)[i]; 448 rr=rr*ba+y; 449 } 450 if(mpz_isNeg(z)) 451 rr=-rr; 452 return nf(rr).N(); 453 } 454 n=GET_DENOM(from); 455 j=s=mpz_limb_size(n); 456 if(j>i) 457 { 458 g=n; n=z; z=g; 459 t=j; j=i; i=t; 460 } 461 t=i-j; 462 if(t>4) 463 { 464 if(j==s) 465 WerrorS("float overflow"); 466 return nf(rr).N(); 467 } 468 if(t>1) 469 { 470 g=h; 471 MPZ_INIT(g); 472 MPZ_DIV(g,z,n); 473 t=mpz_size1(g); 474 if(t>4) 475 { 476 MPZ_CLEAR(g); 477 if(j==s) 478 WerrorS("float overflow"); 479 return nf(rr).N(); 480 } 481 t--; 482 rr=(float)mpz_limb_d(g)[t]; 483 while(t) 484 { 485 t--; 486 y=(float)mpz_limb_d(g)[t]; 487 rr=rr*ba+y; 488 } 489 MPZ_CLEAR(g); 490 if(j!=s) 491 rr=1.0/rr; 492 if(mpz_isNeg(z)) 493 rr=-rr; 494 return nf(rr).N(); 495 } 496 rn=(float)mpz_limb_d(n)[j-1]; 497 rr=(float)mpz_limb_d(z)[i-1]; 498 if(j>1) 499 { 500 rn=rn*ba+(float)mpz_limb_d(n)[j-2]; 501 rr=rr*ba+(float)mpz_limb_d(z)[i-2]; 502 i--; 503 } 504 if(t!=0) 505 rr=rr*ba+(float)mpz_limb_d(z)[i-2]; 506 if(j==s) 507 rr=rr/rn; 508 else 509 rr=rn/rr; 510 if(mpz_isNeg(z)) 511 rr=-rr; 512 return nf(rr).N(); 513 } 514 434 double basis; 435 signed long int exp; 436 basis = mpf_get_d_2exp(&exp, e); 437 float f = ldexp(basis,exp); 438 mpf_clear(e); 439 return nf(f).N(); 440 } 441 442 /* else read out the denominator */ 443 mpz_ptr n = GET_DENOM(from); 444 if(mpz_size1(n)>4) 445 { 446 WerrorS("float overflow"); 447 mpf_clear(e); 448 return nf(0.0).N(); 449 } 450 mpf_t d; 451 mpf_init(d); 452 mpf_set_z(d,n); 453 454 /* and compute the quotient */ 455 mpf_t q; 456 mpf_init(q); 457 mpf_div(q,e,d); 458 459 double basis; 460 signed long int exp; 461 basis = mpf_get_d_2exp(&exp, q); 462 float f = ldexp(basis,exp); 463 mpf_clear(e); 464 mpf_clear(d); 465 mpf_clear(q); 466 return nf(f).N(); 467 } 515 468 516 469 nMapFunc nrSetMap(const coeffs src, const coeffs dst) … … 544 497 { 545 498 assume( getCoeffType(n) == ID ); 546 499 547 500 assume( p == NULL ); 548 501 549 502 n->cfKillChar = ndKillChar; /* dummy */ 550 503 n->ch = 0; … … 578 531 n->cfDBTest=ndDBTest; // not yet implemented: nrDBTest; 579 532 #endif 580 533 581 534 n->nCoeffIsEqual = ndCoeffIsEqual; 582 535 583 536 n->float_len = SHORT_REAL_LENGTH; 584 537 n->float_len2 = SHORT_REAL_LENGTH; 585 538 586 539 // TODO: Any variables? 587 540 return FALSE; -
libpolys/polys/ext_fields/transext.cc
r236a4c r3693cf 609 609 ntTest(b); 610 610 number aNumCoeff = NULL; int aNumDeg = -1; 611 number aDenCoeff = NULL; int aDenDeg = -1; 611 612 number bNumCoeff = NULL; int bNumDeg = -1; 613 number bDenCoeff = NULL; int bDenDeg = -1; 612 614 if (!IS0(a)) 613 615 { … … 615 617 aNumDeg = p_Totaldegree(NUM(fa), ntRing); 616 618 aNumCoeff = p_GetCoeff(NUM(fa), ntRing); 619 if (DEN(fa)!=NULL) 620 { 621 aDenDeg = p_Totaldegree(DEN(fa), ntRing); 622 aDenCoeff=p_GetCoeff(DEN(fa),ntRing); 623 } 617 624 } 618 625 else return !(ntGreaterZero (b,cf)); … … 622 629 bNumDeg = p_Totaldegree(NUM(fb), ntRing); 623 630 bNumCoeff = p_GetCoeff(NUM(fb), ntRing); 631 if (DEN(fb)!=NULL) 632 { 633 bDenDeg = p_Totaldegree(DEN(fb), ntRing); 634 bDenCoeff=p_GetCoeff(DEN(fb),ntRing); 635 } 624 636 } 625 637 else return ntGreaterZero(a,cf); 626 if (aNumDeg > bNumDeg) return TRUE; 627 if (aNumDeg < bNumDeg) return FALSE; 628 return n_Greater(aNumCoeff, bNumCoeff, ntCoeffs); 638 if (aNumDeg-aDenDeg > bNumDeg-bDenDeg) return TRUE; 639 if (aNumDeg-aDenDeg < bNumDeg-bDenDeg) return FALSE; 640 number aa; 641 number bb; 642 if (bDenCoeff==NULL) aa=n_Copy(aNumCoeff,ntRing->cf); 643 else aa=n_Mult(aNumCoeff,bDenCoeff,ntRing->cf); 644 if (aDenCoeff==NULL) bb=n_Copy(bNumCoeff,ntRing->cf); 645 else bb=n_Mult(bNumCoeff,aDenCoeff,ntRing->cf); 646 BOOLEAN rr= n_Greater(aa, bb, ntCoeffs); 647 n_Delete(&aa,ntRing->cf); 648 n_Delete(&bb,ntRing->cf); 649 return rr; 629 650 } 630 651 -
m4/ax_python_with_version.m4
r236a4c r3693cf 26 26 then 27 27 AC_MSG_CHECKING(for --with-python) 28 AC_ARG_WITH( 28 # @<:@=@<:@embed,@:>@PYTHON@:>@ 29 AC_ARG_WITH( 29 30 python, 30 AS_HELP_STRING([--with-python @<:@=@<:@embed,@:>@PYTHON@:>@],31 AS_HELP_STRING([--with-python], 31 32 [absolute path name of Python executable] 32 33 ),
Note: See TracChangeset
for help on using the changeset viewer.