Changeset 8627ad in git
- Timestamp:
- Jun 26, 2008, 6:05:21 PM (16 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- cf4f984ee6d7c9c1a66934b0144d4e0d64c11b01
- Parents:
- 4bf7611fbd40e148feb7eae45c84e0cfe66f2ad0
- Location:
- kernel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/f5gb.cc
r4bf7611 r8627ad 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: f5gb.cc,v 1. 6 2008-06-01 15:14:37 ederc Exp $ */4 /* $Id: f5gb.cc,v 1.7 2008-06-26 16:05:07 ederc Exp $ */ 5 5 /* 6 6 * ABSTRACT: f5gb interface 7 7 */ 8 9 8 #include "mod2.h" 10 9 #include "kutil.h" … … 24 23 #ifdef HAVE_F5 25 24 25 /*2 26 * all functions working on the class lpoly for labeled polynomials 27 */ 26 28 27 28 void lpoly::setPoly(poly* p){ 29 p_ptr = p; 29 void lpoly::setPoly(poly p){ 30 polynomial = p; 30 31 } 31 32 32 void lpoly::setTerm(poly *t){33 t _ptr= t;33 void lpoly::setTerm(poly t){ 34 term = t; 34 35 } 35 36 36 void lpoly::setIndex(long *i){37 i _ptr= i;37 void lpoly::setIndex(long i){ 38 index = i; 38 39 } 39 40 40 poly *lpoly::getPoly(){41 return p _ptr;41 poly lpoly::getPoly(){ 42 return polynomial; 42 43 } 43 44 44 poly *lpoly::getTerm(){45 return t _ptr;45 poly lpoly::getTerm(){ 46 return term; 46 47 } 47 48 48 long *lpoly::getIndex(){49 return i _ptr;49 long lpoly::getIndex(){ 50 return index; 50 51 } 51 52 … … 63 64 poly* ptr2 = right; 64 65 poly p1,p2; 65 66 66 p2 = *(left + (right - left >> 1)); 67 67 do{ … … 90 90 91 91 /*2 92 * computes incrementally gbs of subsets of the input 93 * gb{f_m} -> gb{f_m,f_(m-1)} -> gb{f_m,...,f_1} 94 */ 95 lpoly* f5_inc(lpoly* lp, lpoly* g_prev) 96 { 97 98 99 return lp; 100 } 101 102 103 /*2 92 104 * computes a gb of the ideal i in the ring r with our f5 93 105 * implementation … … 95 107 ideal F5main(ideal i, ring r) 96 108 { 97 ideal iTmp, g; 98 int j; 99 lpoly* lp; 109 ideal iTmp, g_basis; 110 long j, k; 111 poly one = pInit(); 112 pSetCoeff(one, nInit(1)); 113 pWrite(one); 114 lpoly *lp, *gb; 100 115 intvec* sort; 101 116 iTmp = idInit(IDELEMS(i),i->rank); … … 114 129 115 130 lp = new lpoly[IDELEMS(iTmp)]; 131 116 132 for(j=0; j <IDELEMS(iTmp); j++){ 117 lp[j].setPoly(&iTmp->m[j]); 133 lp[j].setPoly(iTmp->m[j]); 134 135 if(pComparePolys(lp[j].getPoly(), one)){ 136 Print("1 in GB"); 137 return(NULL); 138 } 139 140 lp[j].setIndex(j+1); 141 lp[j].setTerm(one); 118 142 Print("Labeled Polynomial %d: ",j+1); 119 pWrite(*(lp[j].getPoly())); 143 Print("Signature Term: "); 144 pWrite(lp[j].getTerm()); 145 Print("Signature Index: %d\n", lp[j].getIndex()); 146 pWrite(lp[j].getPoly()); 147 Print("\n\n"); 148 149 } 150 151 // PROBLEM: muss signatur mitliefern, daher datentyp 152 // ideal nicht zu gebrauchen? 153 gb = new lpoly; 154 gb = &lp[IDELEMS(iTmp)-1]; 155 pWrite((*gb).getPoly()); 156 157 for(j=IDELEMS(iTmp)-2; j>0; j--){ 158 //PROBLEM: muss dynamisch Speicher allozieren 159 gb = f5_inc(&lp[j], gb); 160 for(k=0; k< IDELEMS(iTmp); k++){ 161 if(gb[k].getPoly()){ 162 } 163 } 164 165 166 167 120 168 } 121 169 122 123 170 124 171 125 172 -
kernel/f5gb.h
r4bf7611 r8627ad 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: f5gb.h,v 1. 5 2008-06-01 15:15:00ederc Exp $ */4 /* $Id: f5gb.h,v 1.6 2008-06-26 16:05:21 ederc Exp $ */ 5 5 /* 6 6 * ABSTRACT: f5gb interface … … 13 13 14 14 15 // structure of the rules, i.e. index and term 16 struct rule{ 17 long index; 18 poly term; 19 }; 20 21 22 // class of a labeled polynomial 15 23 class lpoly { 16 24 private: 17 poly * t_ptr;18 long * i_ptr;19 poly * p_ptr;25 poly term; 26 long index; 27 poly polynomial; 20 28 21 29 public: 22 void setPoly(poly *p);23 poly *getPoly();24 void setTerm(poly *t);25 poly *getTerm();26 void setIndex(long *i);27 long *getIndex();30 void setPoly(poly p); 31 poly getPoly(); 32 void setTerm(poly t); 33 poly getTerm(); 34 void setIndex(long i); 35 long getIndex(); 28 36 }; 29 37 … … 34 42 void qsort_degree(poly* left, poly* right); 35 43 44 45 // computes incrementally gbs of subsets of the input 46 // gb{f_m} -> gb{f_m,f_(m-1)} -> gb{f_m,...,f_1} 47 lpoly* f5_inc(lpoly* lp, lpoly* g_prev); 48 49 36 50 // main function of our f5 implementation 37 51 ideal F5main(ideal i, ring r);
Note: See TracChangeset
for help on using the changeset viewer.