Changeset 239c77 in git
- Timestamp:
- Apr 1, 2003, 2:48:31 PM (21 years ago)
- Branches:
- (u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
- Children:
- 87d26115a86e30ac46b6a98bcf3476387cd6dac3
- Parents:
- bc91a65484e480a5becfb1d7732d074f37e61ac4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/fglmzero.cc
rbc91a6 r239c77 1 1 // emacs edit mode for this file is -*- C++ -*- 2 // $Id: fglmzero.cc,v 1.3 4 2001-10-09 16:36:00Singular Exp $2 // $Id: fglmzero.cc,v 1.35 2003-04-01 12:48:31 Singular Exp $ 3 3 4 4 /**************************************** … … 32 32 #include "omalloc.h" 33 33 #include "kstd1.h" // for kNF (see fglmquot) 34 #include "intvec.h" 34 35 #include "fglm.h" 35 36 #include "fglmvec.h" … … 331 332 ideal theIdeal; 332 333 int idelems; 334 int* varpermutation; 333 335 334 336 int basisBS; … … 367 369 theIdeal= thisIdeal; 368 370 idelems= IDELEMS( theIdeal ); 371 varpermutation = (int*)omAlloc( (pVariables+1)*sizeof(int) ); 372 // Sort ring variables by increasing values (because of weighted orderings) 373 ideal perm = idMaxIdeal(1); 374 intvec *iv = idSort(perm,TRUE); 375 idDelete(&perm); 376 for(int i = pVariables; i > 0; i--) varpermutation[pVariables+1-i] = (*iv)[i-1]; 377 delete iv; 369 378 370 379 basisBS= 100; … … 387 396 fglmSdata::~fglmSdata() 388 397 { 398 omFreeSize( (ADDRESS)varpermutation, (pVariables+1)*sizeof(int) ); 389 399 for ( int k = basisSize; k > 0; k-- ) 390 400 pDeleteLm( basis + k ); //. rem: basis runs from basis[1]..basis[basisSize] … … 458 468 // into the list of candidates, according to the given order. If a monomial already 459 469 // exists, then "insertions" and "divisors" are updated. 460 // Assumes that ringvar( k) < ringvar(l) for k > l470 // Assumes that ringvar(varperm[k]) < ringvar(varperm[l]) for k > l 461 471 void 462 472 fglmSdata::updateCandidates() … … 471 481 while ( k >= 1 ) { 472 482 newmonom = pCopy( m ); 473 pIncrExp( newmonom, k);483 pIncrExp( newmonom, varpermutation[k] ); 474 484 pSetm( newmonom ); 475 485 done= FALSE; … … 494 504 while ( --k >= 1 ) { 495 505 newmonom= pCopy( m ); // HIER 496 pIncrExp( newmonom, k);506 pIncrExp( newmonom, varpermutation[k] ); 497 507 pSetm( newmonom ); 498 508 nlist.append( fglmSelem( newmonom, k ) ); … … 661 671 // STICKYPROT("Calculating vector rep\n"); 662 672 v = data.getVectorRep( p ); 663 // if ( v.isZero() ) 673 // if ( v.isZero() ) 664 674 // STICKYPROT("vectorrep is 0\n"); 665 675 return ( data.state() ); … … 739 749 int basisSize; //. the CURRENT basisSize, i.e. basisSize <= dimen 740 750 polyset basis; // [1]..[dimen]. The monoms of the new Vectorspace-basis 751 752 int* varpermutation; 741 753 742 754 int groebnerBS; … … 778 790 perm= (int *)omAlloc( (dimen+1)*sizeof( int ) ); 779 791 basis= (polyset)omAlloc( (dimen+1)*sizeof( poly ) ); 792 varpermutation = (int*)omAlloc( (pVariables+1)*sizeof(int) ); 793 // Sort ring variables by increasing values (because of weighted orderings) 794 ideal perm = idMaxIdeal(1); 795 intvec *iv = idSort(perm,TRUE); 796 idDelete(&perm); 797 for(int i = pVariables; i > 0; i--) varpermutation[pVariables+1-i] = (*iv)[i-1]; 798 delete iv; 799 780 800 groebnerBS= 16; 781 801 groebnerSize= 0; … … 804 824 pLmDelete( basis[k]); 805 825 omFreeSize( (ADDRESS)basis, (dimen+1)*sizeof( poly ) ); 826 omFreeSize( (ADDRESS)varpermutation, (pVariables+1)*sizeof(int) ); 806 827 } 807 828 … … 861 882 while ( k >= 1 ) { 862 883 newmonom = pCopy( m ); 863 pIncrExp( newmonom, k);884 pIncrExp( newmonom, varpermutation[k] ); 864 885 pSetm( newmonom ); 865 886 done= FALSE; … … 884 905 while ( --k >= 1 ) { 885 906 newmonom= pCopy( m ); 886 pIncrExp( newmonom, k);907 pIncrExp( newmonom, varpermutation[k] ); 887 908 pSetm( newmonom ); 888 909 nlist.append( fglmDelem( newmonom, v, k ) ); … … 1020 1041 initv = iv; 1021 1042 } 1022 1043 1023 1044 poly one = pOne(); 1024 1045 data.updateCandidates( one, initv );
Note: See TracChangeset
for help on using the changeset viewer.