Changeset c985c5 in git
- Timestamp:
- Sep 17, 2007, 10:33:17 AM (17 years ago)
- Branches:
- (u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'fc741b6502fd8a97288eaa3eba6e5220f3c3df87')
- Children:
- cff7ceca60f37e140376ee20d9be20dfdd968d7d
- Parents:
- 37a003af153acc2b6945be5b60d23ec814d47ae9
- Files:
-
- 3 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/ipshell.cc
r37a003 rc985c5 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ipshell.cc,v 1.16 8 2007-08-07 11:41:00Singular Exp $ */4 /* $Id: ipshell.cc,v 1.169 2007-09-17 08:33:16 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: … … 716 716 } 717 717 tmpW.data=IDDATA(w); 718 #if 0 718 719 if (((tmpW.rtyp==IDEAL_CMD)||(tmpW.rtyp==MODUL_CMD)) && idIs0(IDIDEAL(w))) 719 720 { … … 722 723 } 723 724 else 725 #endif 724 726 { 725 727 #ifdef FAST_MAP -
Tst/Short/ok_s.lst
r37a003 rc985c5 43 43 bug_46 44 44 bug_47 45 bug_48 45 46 bug_5 46 47 bug_6 -
kernel/Makefile.in
r37a003 rc985c5 380 380 381 381 tags: 382 ctags *. y *.l *.c *.h *.cc *.inc382 ctags *.c *.h *.cc *.inc 383 383 384 384 echoLIBS: -
kernel/fast_maps.cc
r37a003 rc985c5 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 02/01 9 * Version: $Id: fast_maps.cc,v 1. 5 2006-05-02 14:15:46Singular Exp $9 * Version: $Id: fast_maps.cc,v 1.6 2007-09-17 08:33:17 Singular Exp $ 10 10 *******************************************************************/ 11 11 #include "mod2.h" … … 36 36 int n = si_min(pi_r->N, n_max_map_monomials); 37 37 int i, j; 38 Exponent_te_i, e_j;38 unsigned long e_i, e_j; 39 39 poly m_i, map_j = p_Init(map_r); 40 40 … … 42 42 { 43 43 e_i = p_GetExp(pi_m, i, pi_r); 44 if (e_i==0) e_i=1; 44 45 m_i = max_map_monomials[i-1]; 45 if ( e_i > 0 &&m_i != NULL && ! p_IsConstantComp(m_i, map_r))46 if (m_i != NULL && ! p_IsConstantComp(m_i, map_r)) 46 47 { 47 48 for (j = 1; j<= map_r->N; j++) 48 49 { 49 50 e_j = p_GetExp(m_i, j, map_r); 50 if (e_j > 0) 51 { 52 p_AddExp(map_j, j, e_j*e_i, map_r); 53 } 51 if (e_j == 0) e_j=1; 52 p_AddExp(map_j, j, e_j*e_i, map_r); 54 53 } 55 54 } … … 59 58 60 59 // returns maximal exponent if map_id is applied to pi_id 61 static Exponent_tmaGetMaxExp(ideal pi_id, ring pi_r, ideal map_id, ring map_r)62 { 63 Exponent_tmax=0;60 static unsigned long maGetMaxExp(ideal pi_id, ring pi_r, ideal map_id, ring map_r) 61 { 62 unsigned long max=0; 64 63 poly* max_map_monomials = (poly*) omAlloc(IDELEMS(map_id)*sizeof(poly)); 65 64 poly max_pi_i, max_map_i; … … 76 75 max_map_i = maGetMaxExpP(max_map_monomials, IDELEMS(map_id), map_r, 77 76 max_pi_i, pi_r); 78 Exponent_t temp = p_GetMaxExp(max_map_i, map_r); 79 if (temp > max){ 80 max=temp; 81 } 77 unsigned long temp = p_GetMaxExp(max_map_i, map_r); 78 if (temp > max){ max=temp; } 82 79 83 80 p_LmFree(max_pi_i, pi_r); … … 292 289 293 290 #if HAVE_DEST_R > 0 294 Exponent_tmaxExp = maGetMaxExp(map_id, map_r, image_id, image_r);291 unsigned long maxExp = maGetMaxExp(map_id, map_r, image_id, image_r); 295 292 if (maxExp <= 1) maxExp = 2; 296 else if (maxExp > ( Exponent_t) image_r->bitmask)297 maxExp = ( Exponent_t) image_r->bitmask;293 else if (maxExp > (unsigned long) image_r->bitmask) 294 maxExp = (unsigned long) image_r->bitmask; 298 295 dest_r = rModifyRing_Simple(image_r, TRUE, TRUE, maxExp, simple); 299 296 #else … … 583 580 584 581 for (i=1;i<=r->N;i++) { 585 Exponent_t e1 = p_GetExp(m1, i, r); 586 Exponent_t e2 = p_GetExp(m2, i, r); 587 if (e1 > 0 && e2 > 0){ 588 Exponent_t em = (e1 > e2 ? e2 : e1); 582 unsigned long e1 = p_GetExp(m1, i, r); 583 unsigned long e2 = p_GetExp(m2, i, r); 584 if (e1 > 0 && e2 > 0) 585 { 586 unsigned long em = (e1 > e2 ? e2 : e1); 589 587 dg += em; 590 588 p_SetExp(ggt, i, em, r); … … 592 590 p_SetExp(q2, i, e2 - em, r); 593 591 } 594 else { 592 else 593 { 595 594 p_SetExp(q1, i, e1, r); 596 595 p_SetExp(q2, i, e2, r); … … 602 601 p_Setm(q1, r); 603 602 p_Setm(q2, r); 604 605 606 } 607 else { 603 } 604 else 605 { 608 606 p_LmFree(ggt, r); 609 607 p_LmFree(q1, r); … … 664 662 iter=iter->next; 665 663 } 666 if(ggT!=NULL) {667 664 if(ggT!=NULL) 665 { 668 666 int dq =pTotaldegree(fq_p,r); 669 if (dq!=0){ 667 if (dq!=0) 668 { 670 669 fq=maPoly_InsertMonomial(mp, fq_p, r, NULL); 671 670 fp=maPoly_InsertMonomial(mp, fp_p, r, NULL); 672 671 return maPoly_InsertMonomial(mp, ggT, r, NULL); 673 672 } 674 else { 673 else 674 { 675 675 fq=NULL; 676 676 p_LmFree(fq_p, r); … … 681 681 } 682 682 } 683 else { 683 else 684 { 684 685 return NULL; 685 686 } 686 687 688 687 } 689 688 … … 701 700 mapoly fp=NULL; 702 701 mapoly fq=NULL; 703 while (iter->next!=NULL){ 702 while (iter->next!=NULL) 703 { 704 704 choice=iter->next; 705 if ((iter->f1==NULL)){ 705 if ((iter->f1==NULL)) 706 { 706 707 ggT=maFindBestggT(iter, choice, fp, fq,src_r); 707 if (choice!=NULL){ 708 if (choice!=NULL) 709 { 708 710 iter->f1=fp; 709 711 iter->f2=ggT; 710 if (fq!=NULL){ 712 if (fq!=NULL) 713 { 711 714 ggT->ref++; 712 715 choice->f1=fq; … … 714 717 } 715 718 } 716 717 719 } 718 720 iter=iter->next; -
kernel/prCopy.cc
r37a003 rc985c5 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: prCopy.cc,v 1. 2 2005-04-25 18:15:25Singular Exp $ */4 /* $Id: prCopy.cc,v 1.3 2007-09-17 08:33:17 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT - implementation of functions for Copy/Move/Delete for Polys … … 19 19 prCopyEvector(poly dest, ring dest_r, poly src, ring src_r,int max) 20 20 { 21 number n = pGetCoeff(dest);21 //memset(dest->exp,0,dest_r->ExpL_Size*sizeof(long)); 22 22 int i; 23 23 for (i=max; i>0; i--) 24 24 { 25 25 p_SetExp(dest, i, p_GetExp( src, i,src_r), dest_r); 26 assume(n == pGetCoeff(dest));27 26 } 28 27 if (rRing_has_Comp(dest_r) && rRing_has_Comp(src_r)) 29 28 p_SetComp(dest, p_GetComp( src,src_r), dest_r); 30 assume(n == pGetCoeff(dest));31 29 p_Setm(dest, dest_r); 32 assume(n == pGetCoeff(dest));33 30 } 34 31 -
kernel/ring.cc
r37a003 rc985c5 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ring.cc,v 1.6 7 2007-07-27 14:09:52Singular Exp $ */4 /* $Id: ring.cc,v 1.68 2007-09-17 08:33:17 Singular Exp $ */ 5 5 6 6 /* … … 1604 1604 case ringorder_unspec: 1605 1605 if (r->order[1] == ringorder_C 1606 1606 || r->order[0] == ringorder_unspec) 1607 1607 return rOrderType_ExpComp; 1608 1608 return rOrderType_Exp; … … 2992 2992 tmp_typ[typ_i], r->wvhdl[i]); 2993 2993 typ_i++; 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 2994 { // check for weights <=0 2995 int jj; 2996 BOOLEAN have_bad_weights=FALSE; 2997 for(jj=r->block1[i]-r->block0[i];jj>=0; jj--) 2998 { 2999 if (r->wvhdl[i][jj]<=0) have_bad_weights=TRUE; 3000 } 3001 if (have_bad_weights) 3002 { 3003 rO_TDegree(j,j_bits,r->block0[i],r->block1[i],tmp_ordsgn, 3004 tmp_typ[typ_i]); 3005 3005 typ_i++; 3006 3007 3006 } 3007 } 3008 3008 if (r->block1[i]!=r->block0[i]) 3009 3009 { … … 3017 3017 tmp_typ[typ_i], r->wvhdl[i]); 3018 3018 typ_i++; 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3019 { // check for weights <=0 3020 int j; 3021 BOOLEAN have_bad_weights=FALSE; 3022 for(j=r->block1[i]-r->block0[i];j>=0; j--) 3023 { 3024 if (r->wvhdl[i][j]<=0) have_bad_weights=TRUE; 3025 } 3026 if (have_bad_weights) 3027 { 3028 rO_TDegree(j,j_bits,r->block0[i],r->block1[i],tmp_ordsgn, 3029 tmp_typ[typ_i]); 3030 3030 typ_i++; 3031 3032 3031 } 3032 } 3033 3033 if (r->block1[i]!=r->block0[i]) 3034 3034 { … … 3104 3104 } 3105 3105 // the variables 3106 for(i=1 ; i< r->N+1; i++)3106 for(i=1 ; i<=r->N ; i++) 3107 3107 { 3108 3108 if(v[i]==(-1)) … … 3297 3297 shifts[i] = BIT_SIZEOF_LONG; 3298 3298 3299 // find minimal bit in each long var3299 // find minimal bit shift in each long exp entry 3300 3300 for (i=1;i<=r->N;i++) 3301 3301 { … … 3303 3303 shifts[r->VarOffset[i] & 0xffffff] = r->VarOffset[i] >> 24; 3304 3304 } 3305 // reset r->VarOffset 3305 // reset r->VarOffset: set the minimal shift to 0 3306 3306 for (i=1;i<=r->N;i++) 3307 3307 {
Note: See TracChangeset
for help on using the changeset viewer.