Changeset 03de21 in git
- Timestamp:
- Feb 10, 2009, 1:03:50 PM (14 years ago)
- Branches:
- (u'spielwiese', 'f6c3dc58b0df4bd712574325fe76d0626174ad97')
- Children:
- 198a3392c9c3fdba4fd627b0d5f123a0bde019f3
- Parents:
- ddc52f476994f64e5e45e74617b4caac7a4162bc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/gfan.cc
rddc52f r03de21 2 2 Compute the Groebner fan of an ideal 3 3 Author: $Author: monerjan $ 4 Date: $Date: 2009-02- 09 20:51:48$5 Header: $Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1. 7 2009-02-09 20:51:48monerjan Exp $6 Id: $Id: gfan.cc,v 1. 7 2009-02-09 20:51:48monerjan Exp $4 Date: $Date: 2009-02-10 12:03:50 $ 5 Header: $Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.8 2009-02-10 12:03:50 monerjan Exp $ 6 Id: $Id: gfan.cc,v 1.8 2009-02-10 12:03:50 monerjan Exp $ 7 7 */ 8 8 … … 37 37 { 38 38 #ifdef gfan_DEBUG 39 printf(" Computing Inequalities...\n");39 printf("*** Computing Inequalities... ***\n"); 40 40 #endif 41 41 42 // Exponentenvektor 43 Exponent_t leadexp,aktexp,diffexp; 42 //All variables go here - except ineq matrix 43 int lengthGB=IDELEMS(I); // # of polys in the groebner basis 44 int pCompCount; // # of terms in a poly 44 45 poly aktpoly; 46 int numvar = pVariables; // # of variables in a polynomial (or ring?) 47 int leadexp[numvar]; // dirty hack of exp.vects 48 int aktexp[numvar]; 49 int cols,rows; // will contain the dimensions of the ineq matrix 50 // End of var declaration 45 51 46 int lengthGB=IDELEMS(I);47 52 printf("The Gröbner basis has %i elements\n",lengthGB); 53 printf("The current ring has %i variables\n",numvar); 54 cols = numvar; 55 56 //Compute the # inequalities i.e. rows of the matrix 57 rows=0; //Initialization 58 for (int ii=0;ii<IDELEMS(I);ii++) 59 { 60 aktpoly=(poly)I->m[ii]; 61 rows=rows+pLength(aktpoly)-1; 62 } 63 printf("rows=%i\n",rows); 64 printf("Will create a %i x %i - matrix to store inequalities\n",rows,cols); 65 matrix ineq[rows][cols]; 66 48 67 49 68 // We loop through each g\in GB … … 51 70 { 52 71 aktpoly=(poly)I->m[i]; 53 leadexp = pGetExp(aktpoly,1); //get the exp.vect of leading monomial54 for (int j=2;j<=pLength(aktpoly);j++)55 {56 aktexp=pGetExp(aktpoly,j);57 //diffexp=pSubExp(aktpoly, leadexp,aktexp); //Dang! => runtime error58 //printf("Exponentenvektor=%i\n",expmark);59 //printf("Diff=%i\n",expmark-pGetExp(aktpoly,j));60 }61 int pCompCount;62 72 pCompCount=pLength(aktpoly); 63 73 printf("Poly No. %i has %i components\n",i,pCompCount); 74 75 int *v=(int *)omAlloc((numvar+1)*sizeof(int)); 76 pGetExpV(aktpoly,v); //find the exp.vect in v[1],...,v[n], use pNext(p) 77 78 //Store leadexp for aktpoly 79 for (int kk=0;kk<numvar;kk++) 80 { 81 leadexp[kk]=v[kk+1]; 82 printf("Leadexpcomp=%i\n",leadexp[kk]); 83 } 84 85 while (pNext(aktpoly)!=NULL) 86 { 87 aktpoly=pNext(aktpoly); 88 pSetm(aktpoly); 89 pGetExpV(aktpoly,v); 90 for (int kk=0;kk<numvar;kk++) 91 { 92 //The ordering somehow gets lost here but this is acceptable, since we are only interested in the inequalities 93 aktexp[kk]=v[kk+1]; 94 printf("aktexpcomp=%i\n",aktexp[kk]); 95 } 96 }//while 97 64 98 } //for 65 99 //res=(ideal)aktpoly;
Note: See TracChangeset
for help on using the changeset viewer.