Changeset a77e2c in git
- Timestamp:
- Nov 24, 2000, 8:30:51 PM (23 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 483a6d073ca6be3178039b976fc900816aaff6b5
- Parents:
- 063298496e87a107e8e451ba9042077435d86b9b
- Location:
- Singular
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/standard.lib
r0632984 ra77e2c 1 // $Id: standard.lib,v 1.4 8 2000-05-12 12:17:18 kruegerExp $1 // $Id: standard.lib,v 1.49 2000-11-24 19:30:51 obachman Exp $ 2 2 ////////////////////////////////////////////////////////////////////////////// 3 3 4 version="$Id: standard.lib,v 1.4 8 2000-05-12 12:17:18 kruegerExp $";4 version="$Id: standard.lib,v 1.49 2000-11-24 19:30:51 obachman Exp $"; 5 5 info=" 6 6 LIBRARY: standard.lib PROCEDURES WHICH ARE ALWAYS LOADED AT START-UP … … 331 331 "std in " + ri[13, size(ri) - 13]; 332 332 } 333 ideal qh1=std(qh); 334 intvec hi=hilb(qh1,1); 333 intvec hi=hilb(std(qh),1); 335 334 336 335 if (add_vars == 0) -
Singular/kbuckets.cc
r0632984 ra77e2c 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kbuckets.cc,v 1.2 0 2000-11-23 17:34:08obachman Exp $ */4 /* $Id: kbuckets.cc,v 1.21 2000-11-24 19:30:46 obachman Exp $ */ 5 5 6 6 #include "mod2.h" … … 483 483 else 484 484 { 485 int shorter = 0;486 485 pSetCoeff0(m, nNeg(pGetCoeff(m))); 487 p1 = bucket->bucket_ring->p_Procs->pp_Mult_mm(p1, m, shorter, spNoether, bucket->bucket_ring, last); 486 if (spNoether != NULL) 487 p1 = bucket->bucket_ring->p_Procs->pp_Mult_mm_Noether(p1, m, spNoether, l1, bucket->bucket_ring, last); 488 else 489 p1 = bucket->bucket_ring->p_Procs->pp_Mult_mm(p1, m, 490 bucket->bucket_ring, 491 last); 488 492 pSetCoeff0(m, nNeg(pGetCoeff(m))); 489 l1 -= shorter;490 493 } 491 494 -
Singular/kspoly.cc
r0632984 ra77e2c 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kspoly.cc,v 1.2 0 2000-11-23 17:34:08obachman Exp $ */4 /* $Id: kspoly.cc,v 1.21 2000-11-24 19:30:47 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT - Routines for Spoly creation and reductions … … 161 161 162 162 // get m2 * a2 163 a2 = tailRing->p_Procs->pp_Mult_mm(a2, m2, shorter,spNoether,tailRing,last); 163 if (spNoether != NULL) 164 a2 = tailRing->p_Procs->pp_Mult_mm_Noether(a2, m2, spNoether, l2, tailRing,last); 165 else 166 a2 = tailRing->p_Procs->pp_Mult_mm(a2, m2, tailRing,last); 164 167 Pair->SetLmTail(m2, a2, l2-shorter, use_buckets, tailRing, last); 165 168 -
Singular/kstd1.cc
r0632984 ra77e2c 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kstd1.cc,v 1.6 6 2000-11-23 17:34:08obachman Exp $ */4 /* $Id: kstd1.cc,v 1.67 2000-11-24 19:30:47 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: 7 7 */ 8 9 // define if LDEG should not be used in inner reduction loops 10 #define NO_LDEG 8 11 9 12 #include "mod2.h" … … 232 235 if (at <= strat->Ll) 233 236 { 234 h->CanonicalizeP();235 237 /*- h will not become the next element to reduce -*/ 236 238 enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at); … … 245 247 } 246 248 247 // now we fi anlly can reduce249 // now we finally can reduce 248 250 doRed(h,&(strat->T[ii]),strat->fromT,strat); 249 251 strat->fromT=FALSE; … … 306 308 return 1; 307 309 } 308 h->CanonicalizeP();309 310 enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at); 310 311 #ifdef KDEBUG … … 346 347 if (j < 0) 347 348 { 348 if (strat->homog) 349 h->SetDegStuffReturnLDeg(strat->LDegLast); 349 if (strat->kNoether) 350 h->pLength = NULL; 351 h->SetDegStuffReturnLDeg(strat->LDegLast); 350 352 return 1; 351 353 } … … 394 396 if (!strat->homog) 395 397 { 398 #ifdef NO_LDEG 399 h->SetpFDeg(); 400 if (strat->T[j].ecart <= h->ecart) 401 h->ecart = d - h->GetpFDeg(); 402 else 403 h->ecart = d - h->GetpFDeg() + strat->T[j].ecart - h->ecart; 404 405 d = h->GetpFDeg() + h->ecart; 406 #else 407 if (strat->kNoether != NULL) 408 h->pLength = 0; 396 409 d = h->SetDegStuffReturnLDeg(strat->LDegLast); 410 #endif 397 411 /*- try to reduce the s-polynomial -*/ 398 412 pass++; … … 406 420 { 407 421 h->SetLmCurrRing(); 422 if (strat->kNoether != NULL) 423 h->pLength = NULL; 424 if (strat->posInLDependsOnLength) 425 h->SetLength(strat->length_pLength); 408 426 at = strat->posInL(strat->L,strat->Ll,h,strat); 409 427 if (at <= strat->Ll) … … 1844 1862 if (strat->red == redFirst) 1845 1863 { 1864 #ifdef NO_LDEG 1865 if (!strat->syzComp) 1866 return TRUE; 1867 #else 1846 1868 if (strat->homog && !strat->syzComp) 1847 1869 return TRUE; 1848 1870 else 1849 1871 return FALSE; 1872 #endif 1850 1873 } 1851 1874 else -
Singular/kstd2.cc
r0632984 ra77e2c 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kstd2.cc,v 1.6 2 2000-11-23 17:34:09obachman Exp $ */4 /* $Id: kstd2.cc,v 1.63 2000-11-24 19:30:48 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT - Kernel: alg. of Buchberger … … 294 294 { 295 295 at = strat->posInL(strat->L,strat->Ll,h,strat); 296 297 296 if(at <= strat->Ll) 298 297 /*- h will not become the next element to reduce -*/ 299 298 { 300 h->CanonicalizeP();301 299 enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at); 302 300 #ifdef KDEBUG … … 363 361 if (kFindDivisibleByInS(strat->S, strat->sevS, strat->sl, h) < 0) 364 362 return 1; 365 h->CanonicalizeP();366 363 enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at); 367 364 #ifdef KDEBUG -
Singular/kutil.cc
r0632984 ra77e2c 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kutil.cc,v 1. 79 2000-11-23 17:34:09obachman Exp $ */4 /* $Id: kutil.cc,v 1.80 2000-11-24 19:30:48 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: kernel: utils for kStd … … 2361 2361 } 2362 2362 } 2363 2364 2363 2365 2364 /*2 -
Singular/pInline2.h
r0632984 ra77e2c 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 8/00 9 * Version: $Id: pInline2.h,v 1.1 8 2000-11-23 17:34:11obachman Exp $9 * Version: $Id: pInline2.h,v 1.19 2000-11-24 19:30:49 obachman Exp $ 10 10 *******************************************************************/ 11 11 #ifndef PINLINE2_H … … 466 466 { 467 467 poly last; 468 int shorter; 469 return r->p_Procs->pp_Mult_mm(p, m, shorter, NULL, r, last); 468 return r->p_Procs->pp_Mult_mm(p, m, r, last); 470 469 } 471 470 … … 543 542 { 544 543 poly last; 545 int shorter;546 544 if (p == NULL || q == NULL) return NULL; 547 545 548 546 if (pNext(p) == NULL) 549 return r->p_Procs->pp_Mult_mm(q, p, shorter, NULL,r, last);547 return r->p_Procs->pp_Mult_mm(q, p, r, last); 550 548 551 549 if (pNext(q) == NULL) 552 return r->p_Procs->pp_Mult_mm(p, q, shorter, NULL,r, last);550 return r->p_Procs->pp_Mult_mm(p, q, r, last); 553 551 554 552 poly qq = q; -
Singular/p_Minus_mm_Mult_qq__Template.cc
r0632984 ra77e2c 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 8/00 9 * Version: $Id: p_Minus_mm_Mult_qq__Template.cc,v 1. 7 2000-11-23 17:34:11obachman Exp $9 * Version: $Id: p_Minus_mm_Mult_qq__Template.cc,v 1.8 2000-11-24 19:30:49 obachman Exp $ 10 10 *******************************************************************/ 11 11 … … 119 119 pSetCoeff0(m, tneg); 120 120 last = a; 121 pNext(a) = r->p_Procs->pp_Mult_mm(q, m, shorter, spNoether, r, last); 121 if (spNoether != NULL) 122 { 123 int ll; 124 pNext(a) = r->p_Procs->pp_Mult_mm_Noether(q, m, spNoether, ll, r, last); 125 } 126 else 127 pNext(a) = r->p_Procs->pp_Mult_mm(q, m, r, last); 122 128 pSetCoeff0(m, tm); 123 129 } -
Singular/p_Procs.cc
r0632984 ra77e2c 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 8/00 9 * Version: $Id: p_Procs.cc,v 1.2 1 2000-11-08 17:12:33obachman Exp $9 * Version: $Id: p_Procs.cc,v 1.22 2000-11-24 19:30:50 obachman Exp $ 10 10 *******************************************************************/ 11 11 #include <string.h> … … 55 55 #endif 56 56 57 #define inline 58 57 59 // Set HAVE_FAST_FIELD to: 58 60 // 0 -- only FieldGeneral … … 68 70 // 3 -- special cases for length <= 4 69 71 // 4 -- special cases for length <= 8 70 const int HAVE_FAST_LENGTH = 4;72 const int HAVE_FAST_LENGTH = 3; 71 73 72 74 // Set HAVE_FAST_ORD to: … … 180 182 pp_Mult_nn_Proc, 181 183 pp_Mult_mm_Proc, 184 pp_Mult_mm_Noether_Proc, 182 185 p_Mult_mm_Proc, 183 186 p_Add_q_Proc, … … 270 273 case pp_Mult_nn_Proc: return "pp_Mult_nn_Proc"; 271 274 case pp_Mult_mm_Proc: return "pp_Mult_mm_Proc"; 275 case pp_Mult_mm_Noether_Proc: return "pp_Mult_mm_Noether_Proc"; 272 276 case p_Mult_mm_Proc: return "p_Mult_mm_Proc"; 273 277 case p_Add_q_Proc: return "p_Add_q_Proc"; … … 419 423 } 420 424 421 static inline void FastProcFilter(p_Proc proc, p_Field &field, p_Length &length, 422 p_Ord &ord) 425 static inline void pp_Mult_mm_Noether_Filter(p_Field &field, 426 p_Length &length, p_Ord &ord) 427 { 428 // filter out all orderings which are not local degree orderings 429 if (! (ord == OrdNomog || // (ds, c) 430 ord == OrdNegPomog || // (Ds, c) 431 ord == OrdPosNomog || // (C, ds) 432 ord == OrdNomogPos || // (ds, C) 433 ord == OrdGeneral 434 #ifdef HAVE_LENGTH_DIFF 435 || ord == OrdNegPomogZero || 436 ord == OrdNomogZero // (ds, c) even vars 437 #endif 438 )) 439 { 440 field = FieldGeneral; 441 ord = OrdGeneral; 442 length = LengthGeneral; 443 } 444 } 445 446 static inline void FastProcFilter(p_Proc proc, p_Field &field, 447 p_Length &length, p_Ord &ord) 423 448 { 424 449 switch(proc) … … 434 459 break; 435 460 461 case pp_Mult_mm_Noether_Proc: 462 pp_Mult_mm_Noether_Filter(field, length, ord); 463 break; 464 436 465 default: break; 437 466 } 438 467 439 468 FastOrdFilter(ord); 469 FastOrdZeroFilter(ord); 440 470 FastLengthFilter(length); 441 471 FastFieldFilter(field); … … 504 534 case p_Add_q_Proc: 505 535 case p_Minus_mm_Mult_qq_Proc: 536 case pp_Mult_mm_Noether_Proc: 506 537 return index(field, length, ord); 507 538 … … 655 686 (p_Procs->p_Copy != NULL) && 656 687 (p_Procs->pp_Mult_mm != NULL) && 688 (p_Procs->pp_Mult_mm_Noether != NULL) && 657 689 (p_Procs->p_Mult_mm != NULL) && 658 690 (p_Procs->p_Add_q != NULL) && … … 661 693 (p_Procs->p_Merge_q != NULL) && 662 694 (p_Procs->p_Minus_mm_Mult_qq != NULL)); 695 assume(p_Procs->pp_Mult_mm_Noether != pp_Mult_mm_Noether__FieldGeneral_LengthGeneral_OrdGeneral || r->OrdSgn == 1 || r->LexOrder); 663 696 } 664 697 … … 787 820 printf("#undef %s\n#define %s %s\n", s_what, s_what, s_full_proc_name); 788 821 printf("#include \"%s__Template.cc\"\n", s_what); 789 printf("#undef %s\n #undef pp_Mult_mm\n", s_what);822 printf("#undef %s\n", s_what); 790 823 } 791 824 … … 903 936 ***************************************************************/ 904 937 905 #define SetProc(what, field, length, ord) 938 #define SetProc(what, field, length, ord) \ 906 939 do \ 907 940 { \ … … 909 942 p_Ord t_ord = ord; \ 910 943 p_Length t_length = length; \ 911 FastProcFilter(what##_Proc, t_field, t_length, t_ord); 944 FastProcFilter(what##_Proc, t_field, t_length, t_ord);\ 912 945 _SetProc(what, t_field, t_length, t_ord); \ 913 946 } \ … … 922 955 SetProc(p_Copy, field, length, OrdGeneral); 923 956 SetProc(pp_Mult_mm, field, length, OrdGeneral); 957 SetProc(pp_Mult_mm_Noether, field, length, ord); 924 958 SetProc(p_Mult_mm, field, length, OrdGeneral); 925 959 SetProc(p_Add_q, field, length, ord); -
Singular/p_Procs.h
r0632984 ra77e2c 8 8 * Author: obachman (Olaf Bachmann) 9 9 * Created: 8/00 10 * Version: $Id: p_Procs.h,v 1. 8 2000-11-23 17:34:12obachman Exp $10 * Version: $Id: p_Procs.h,v 1.9 2000-11-24 19:30:50 obachman Exp $ 11 11 *******************************************************************/ 12 12 #ifndef P_PROCS_H … … 22 22 typedef poly (*p_Mult_mm_Proc_Ptr)(poly p, poly m, const ring r); 23 23 typedef poly (*pp_Mult_mm_Proc_Ptr)(poly p, poly m, 24 int &shorter, poly spNoether,25 24 const ring r, 26 25 poly &last); 26 typedef poly (*pp_Mult_mm_Noether_Proc_Ptr)(poly p, poly m, 27 poly spNoether, int &length, 28 const ring r, 29 poly &last); 27 30 typedef poly (*p_Add_q_Proc_Ptr)(poly p, poly q, int & shorter, const ring r); 28 31 typedef poly (*p_Minus_mm_Mult_qq_Proc_Ptr)(poly p, poly m, poly q, … … 41 44 pp_Mult_nn_Proc_Ptr pp_Mult_nn; 42 45 pp_Mult_mm_Proc_Ptr pp_Mult_mm; 46 pp_Mult_mm_Noether_Proc_Ptr pp_Mult_mm_Noether; 43 47 p_Mult_mm_Proc_Ptr p_Mult_mm; 44 48 p_Add_q_Proc_Ptr p_Add_q; -
Singular/pp_Mult_mm__Template.cc
r0632984 ra77e2c 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 8/00 9 * Version: $Id: pp_Mult_mm__Template.cc,v 1. 7 2000-11-23 17:34:13obachman Exp $9 * Version: $Id: pp_Mult_mm__Template.cc,v 1.8 2000-11-24 19:30:50 obachman Exp $ 10 10 *******************************************************************/ 11 11 … … 14 14 * Returns: p*m 15 15 * Const: p, m 16 * If spNoether != NULL, then monoms which are smaller17 * then spNoether are cut18 16 * 19 17 ***************************************************************/ 20 poly pp_Mult_mm(poly p, const poly m, int& Shorter, const poly spNoether,const ring ri, poly &last)18 poly pp_Mult_mm(poly p, const poly m, const ring ri, poly &last) 21 19 { 22 20 p_Test(p, ri); … … 37 35 38 36 39 if (spNoether == NULL)37 do 40 38 { 41 do 42 { 43 p_AllocBin( pNext(q), bin, ri); 44 q = pNext(q); 45 pSetCoeff0(q, n_Mult(ln, pGetCoeff(p), ri)); 46 p_MemSum(q->exp, p->exp, m_e, length); 47 p_MemAddAdjust(q, ri); 48 p = pNext(p); 49 } 50 while (p != NULL); 51 last = q; 39 p_AllocBin( pNext(q), bin, ri); 40 q = pNext(q); 41 pSetCoeff0(q, n_Mult(ln, pGetCoeff(p), ri)); 42 p_MemSum(q->exp, p->exp, m_e, length); 43 p_MemAddAdjust(q, ri); 44 p = pNext(p); 52 45 } 53 else 54 { 55 poly r; 56 while (p != NULL) 57 { 58 p_AllocBin( r, bin, ri); 59 p_MemSum(r->exp, p->exp, m_e, length); 60 p_MemAddAdjust(r, ri); 61 if (p_LmCmp(r, spNoether, ri) == -1) 62 { 63 Shorter += pLength(p); 64 p_FreeBinAddr(r, ri); 65 break; 66 } 67 q = pNext(q) = r; 68 pSetCoeff0(q, n_Mult(ln, pGetCoeff(p), ri)); 69 pIter(p); 70 } 71 if (q != &rp) last = q; 72 } 46 while (p != NULL); 47 last = q; 73 48 pNext(q) = NULL; 74 49
Note: See TracChangeset
for help on using the changeset viewer.