Changeset c5d8dd in git
- Timestamp:
- Feb 11, 2009, 3:57:55 PM (14 years ago)
- Branches:
- (u'spielwiese', 'f6c3dc58b0df4bd712574325fe76d0626174ad97')
- Children:
- 87beab79ada79bca10d045490906c1eb82902d37
- Parents:
- 8fc55e2c9b6b4b308c8d558497c631cf418a0d0f
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/extra.cc
r8fc55e2 rc5d8dd 2 2 * Computer Algebra System SINGULAR * 3 3 *****************************************/ 4 /* $Id: extra.cc,v 1.29 1 2009-02-06 15:16:16monerjan Exp $ */4 /* $Id: extra.cc,v 1.292 2009-02-11 14:57:54 monerjan Exp $ */ 5 5 /* 6 6 * ABSTRACT: general interface to internals of Singular ("system" command) … … 58 58 #ifdef HAVE_RINGS 59 59 #include "ringgb.h" 60 #endif 61 62 #ifdef HAVE_GFAN 60 63 #include "gfan.h" 61 64 #endif 62 63 65 64 66 #ifdef HAVE_F5 … … 3065 3067 #endif 3066 3068 3069 #ifdef HAVE_GFAN 3067 3070 /*======== GFAN ==============*/ 3068 3071 if (strcmp(sys_cmd,"gfan")==0) … … 3080 3083 } 3081 3084 else 3082 3085 #endif 3083 3086 3084 3087 /*==================== Error =================*/ -
kernel/gfan.cc
r8fc55e2 rc5d8dd 2 2 Compute the Groebner fan of an ideal 3 3 Author: $Author: monerjan $ 4 Date: $Date: 2009-02-1 0 17:04:17$5 Header: $Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1. 9 2009-02-10 17:04:17monerjan Exp $6 Id: $Id: gfan.cc,v 1. 9 2009-02-10 17:04:17monerjan Exp $4 Date: $Date: 2009-02-11 14:57:55 $ 5 Header: $Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.10 2009-02-11 14:57:55 monerjan Exp $ 6 Id: $Id: gfan.cc,v 1.10 2009-02-11 14:57:55 monerjan Exp $ 7 7 */ 8 8 … … 13 13 #include "ideals.h" 14 14 #include "kmatrix.h" 15 #include "/users/urmel/alggeom/monerjan/cddlib/include/setoper.h" //Support for cddlib. Dirty hack 16 #include "/users/urmel/alggeom/monerjan/cddlib/include/cdd.h" 15 17 16 18 #ifndef gfan_DEBUG … … 41 43 #endif 42 44 43 //All variables go here - except ineq matrix 45 //All variables go here - except ineq matrix and *v, see below 44 46 int lengthGB=IDELEMS(I); // # of polys in the groebner basis 45 47 int pCompCount; // # of terms in a poly … … 48 50 int leadexp[numvar]; // dirty hack of exp.vects 49 51 int aktexp[numvar]; 50 int cols,rows; // will contain the dimensions of the ineq matrix 52 int cols,rows; // will contain the dimensions of the ineq matrix - deprecated by 53 dd_rowrange ddrows; 54 dd_colrange ddcols; 55 dd_rowset ddredrows; // # of redundant rows in ddineq 56 dd_NumberType ddnumb=dd_Real; //Number type 57 dd_ErrorType dderr=dd_NoError; // 51 58 // End of var declaration 52 59 … … 64 71 printf("rows=%i\n",rows); 65 72 printf("Will create a %i x %i - matrix to store inequalities\n",rows,cols); 66 int ineq[rows][cols]; // array of int vs matrix vs KMatrix ??? What's to use?67 int aktmatrixrow=0; // needed to store the diffs of the expvects in the rows of ineq68 73 69 // We loop through each g\in GB 74 dd_rowrange aktmatrixrow=0; // needed to store the diffs of the expvects in the rows of ddineq 75 dd_set_global_constants(); 76 ddrows=rows; 77 ddcols=cols; 78 dd_MatrixPtr ddineq; //Matrix to store the inequalities 79 ddineq=dd_CreateMatrix(ddrows,ddcols); 80 81 // We loop through each g\in GB and compute the resulting inequalities 70 82 for (int i=0; i<IDELEMS(I); i++) 71 83 { … … 81 93 { 82 94 leadexp[kk]=v[kk+1]; 83 printf("Leadexpcomp=%i\n",leadexp[kk]);95 //printf("Leadexpcomp=%i\n",leadexp[kk]); 84 96 //Since we need to know the difference of leadexp with the other expvects we do nothing here 85 97 //but compute the diff below … … 96 108 //The ordering somehow gets lost here but this is acceptable, since we are only interested in the inequalities 97 109 aktexp[kk]=v[kk+1]; 98 printf("aktexpcomp=%i\n",aktexp[kk]); 99 ineq[aktmatrixrow][kk]=leadexp[kk]-aktexp[kk]; //dito 110 //printf("aktexpcomp=%i\n",aktexp[kk]); 111 //ineq[aktmatrixrow][kk]=leadexp[kk]-aktexp[kk]; //dito 112 dd_set_si(ddineq->matrix[(dd_rowrange)aktmatrixrow][kk],leadexp[kk]-aktexp[kk]); 100 113 } 101 114 aktmatrixrow=aktmatrixrow+1; 102 115 }//while 116 103 117 } //for 104 #ifdef gfan_DEBUG 118 119 // The inequalities are now stored in ddineq 120 // Next we check for superflous rows 121 ddredrows = dd_RedundantRows(ddineq, &dderr); 122 if (dderr!=dd_NoError) // did an error occur? 123 { 124 dd_WriteErrorMessages(stderr,dderr); //if so tell us 125 } else 126 { 127 printf("Redundant rows: "); 128 set_fwrite(stdout, ddredrows); //otherwise print the redundant rows 129 }//if dd_Error 130 131 #ifdef gfan_DEBUGs 105 132 printf("Inequalitiy matrix\n"); 106 133 for (int i=0;i<rows;i++)
Note: See TracChangeset
for help on using the changeset viewer.