Changeset 7f06cca in git for kernel/kstd2.cc
- Timestamp:
- Jan 20, 2006, 2:15:07 AM (18 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- a725daea0d4b710813033cd5906ef1c1f3437cd3
- Parents:
- 3a123804ad0304c10b9c827a9fd2fa92a12fcd36
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/kstd2.cc
r3a1238 r7f06cca 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kstd2.cc,v 1. 7 2006-01-16 14:02:51 SingularExp $ */4 /* $Id: kstd2.cc,v 1.8 2006-01-20 01:15:07 wienand Exp $ */ 5 5 /* 6 6 * ABSTRACT - Kernel: alg. of Buchberger … … 164 164 */ 165 165 166 long twoPow(long arg) { 167 long t = arg; 168 long result = 1; 169 while (t > 0) { 170 result = 2 * result; 171 t--; 172 } 173 return result; 174 } 175 166 176 long factorial(long arg) 167 177 { … … 194 204 } 195 205 196 for (int i = 1; i <= leadRing->N; i++) 197 { 198 a = factorial(p GetExp(p, i));206 for (int i = 1; i <= leadRing->N; i++) 207 { 208 a = factorial(p_GetExp(p, i, leadRing)); 199 209 k = k * a; 200 210 while (a%2 == 0) … … 213 223 for (int i = 1; i <= leadRing->N; i++) 214 224 { 215 for (long j = 1; j <= p GetExp(p, i); j++)225 for (long j = 1; j <= p_GetExp(p, i,leadRing); j++) 216 226 { 217 227 tmp1 = nInit(j); … … 230 240 } 231 241 } 242 tmp2 = p_ISet((long) pGetCoeff(zeroPoly), leadRing); 243 for (int i = 1; i <= leadRing->N; i++) { 244 pSetExp(tmp2, i, p_GetExp(zeroPoly, i, leadRing)); 245 } 246 p_Setm(tmp2, leadRing); 232 247 zeroPoly = p_LmDeleteAndNext(zeroPoly, tailRing); 233 tmp2 = pISet(a);234 for (int i = 1; i <= leadRing->N; i++)235 {236 pSetExp(tmp2, i, pGetExp(p, i));237 }238 pSetm(tmp2);239 248 pNext(tmp2) = zeroPoly; 240 249 return tmp2; 241 250 } 242 if (leadRing->ch - k_ind2 <= a_ind2) 243 { 244 PrintS("Case not implented yet !!!\n"); 245 PrintS("But it should not mae any difference.\n"); 246 return zeroPoly; 251 long alpha_k = twoPow(leadRing->ch - k_ind2); 252 if (alpha_k <= a) { 253 zeroPoly = p_ISet((a / alpha_k)*alpha_k, tailRing); 254 for (int i = 1; i <= leadRing->N; i++) { 255 for (long j = 1; j <= p_GetExp(p, i, leadRing); j++) { 256 tmp1 = nInit(j); 257 tmp2 = p_ISet(1, tailRing); 258 p_SetExp(tmp2, i, 1, tailRing); 259 p_Setm(tmp2, tailRing); 260 if (nIsZero(tmp1)) { 261 zeroPoly = p_Mult_q(zeroPoly, tmp2, tailRing); 262 } 263 else { 264 tmp3 = p_ISet((long) tmp1, tailRing); 265 zeroPoly = p_Mult_q(zeroPoly, p_Add_q(tmp2, tmp3, tailRing), tailRing); 266 } 267 } 268 } 269 tmp2 = p_ISet((long) pGetCoeff(zeroPoly), leadRing); 270 for (int i = 1; i <= leadRing->N; i++) { 271 pSetExp(tmp2, i, p_GetExp(zeroPoly, i, leadRing)); 272 } 273 p_Setm(tmp2, leadRing); 274 zeroPoly = p_LmDeleteAndNext(zeroPoly, tailRing); 275 pNext(tmp2) = zeroPoly; 276 return tmp2; 247 277 } 248 278 return NULL; … … 284 314 loop 285 315 { 286 zeroPoly = kFindDivisibleByZeroPoly(h);316 zeroPoly = NULL;// kFindDivisibleByZeroPoly(h); 287 317 if (zeroPoly != NULL) 288 318 {
Note: See TracChangeset
for help on using the changeset viewer.