Changeset a77e2c in git


Ignore:
Timestamp:
Nov 24, 2000, 8:30:51 PM (23 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
483a6d073ca6be3178039b976fc900816aaff6b5
Parents:
063298496e87a107e8e451ba9042077435d86b9b
Message:
* buckets for local case


git-svn-id: file:///usr/local/Singular/svn/trunk@4770 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/standard.lib

    r0632984 ra77e2c  
    1 // $Id: standard.lib,v 1.48 2000-05-12 12:17:18 krueger Exp $
     1// $Id: standard.lib,v 1.49 2000-11-24 19:30:51 obachman Exp $
    22//////////////////////////////////////////////////////////////////////////////
    33
    4 version="$Id: standard.lib,v 1.48 2000-05-12 12:17:18 krueger Exp $";
     4version="$Id: standard.lib,v 1.49 2000-11-24 19:30:51 obachman Exp $";
    55info="
    66LIBRARY: standard.lib   PROCEDURES WHICH ARE ALWAYS LOADED AT START-UP
     
    331331    "std in " + ri[13, size(ri) - 13];
    332332  }
    333   ideal qh1=std(qh);
    334   intvec hi=hilb(qh1,1);
     333  intvec hi=hilb(std(qh),1);
    335334
    336335  if (add_vars == 0)
  • Singular/kbuckets.cc

    r0632984 ra77e2c  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kbuckets.cc,v 1.20 2000-11-23 17:34:08 obachman Exp $ */
     4/* $Id: kbuckets.cc,v 1.21 2000-11-24 19:30:46 obachman Exp $ */
    55
    66#include "mod2.h"
     
    483483  else
    484484  {
    485     int shorter = 0;
    486485    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);
    488492    pSetCoeff0(m, nNeg(pGetCoeff(m)));
    489     l1 -= shorter;
    490493  }
    491494
  • Singular/kspoly.cc

    r0632984 ra77e2c  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kspoly.cc,v 1.20 2000-11-23 17:34:08 obachman Exp $ */
     4/* $Id: kspoly.cc,v 1.21 2000-11-24 19:30:47 obachman Exp $ */
    55/*
    66*  ABSTRACT -  Routines for Spoly creation and reductions
     
    161161 
    162162  // 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);
    164167  Pair->SetLmTail(m2, a2, l2-shorter, use_buckets, tailRing, last);
    165168
  • Singular/kstd1.cc

    r0632984 ra77e2c  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kstd1.cc,v 1.66 2000-11-23 17:34:08 obachman Exp $ */
     4/* $Id: kstd1.cc,v 1.67 2000-11-24 19:30:47 obachman Exp $ */
    55/*
    66* ABSTRACT:
    77*/
     8
     9// define if LDEG should not be used in inner reduction loops
     10#define NO_LDEG
    811
    912#include "mod2.h"
     
    232235        if (at <= strat->Ll)
    233236        {
    234           h->CanonicalizeP();
    235237          /*- h will not become the next element to reduce -*/
    236238          enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
     
    245247    }
    246248
    247     // now we fianlly can reduce
     249    // now we finally can reduce
    248250    doRed(h,&(strat->T[ii]),strat->fromT,strat);
    249251    strat->fromT=FALSE;
     
    306308          return 1;
    307309        }
    308         h->CanonicalizeP();
    309310        enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
    310311#ifdef KDEBUG
     
    346347    if (j < 0)
    347348    {
    348       if (strat->homog)
    349         h->SetDegStuffReturnLDeg(strat->LDegLast);
     349      if (strat->kNoether)
     350        h->pLength = NULL;
     351      h->SetDegStuffReturnLDeg(strat->LDegLast);
    350352      return 1;
    351353    }
     
    394396    if (!strat->homog)
    395397    {
     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;
    396409      d = h->SetDegStuffReturnLDeg(strat->LDegLast);
     410#endif
    397411      /*- try to reduce the s-polynomial -*/
    398412      pass++;
     
    406420      {
    407421        h->SetLmCurrRing();
     422        if (strat->kNoether != NULL)
     423          h->pLength = NULL;
     424        if (strat->posInLDependsOnLength)
     425          h->SetLength(strat->length_pLength);
    408426        at = strat->posInL(strat->L,strat->Ll,h,strat);
    409427        if (at <= strat->Ll)
     
    18441862  if (strat->red == redFirst)
    18451863  {
     1864#ifdef NO_LDEG
     1865    if (!strat->syzComp)
     1866      return TRUE;
     1867#else   
    18461868    if (strat->homog && !strat->syzComp)
    18471869      return TRUE;
    18481870    else
    18491871      return FALSE;
     1872#endif
    18501873  }
    18511874  else
  • Singular/kstd2.cc

    r0632984 ra77e2c  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kstd2.cc,v 1.62 2000-11-23 17:34:09 obachman Exp $ */
     4/* $Id: kstd2.cc,v 1.63 2000-11-24 19:30:48 obachman Exp $ */
    55/*
    66*  ABSTRACT -  Kernel: alg. of Buchberger
     
    294294      {
    295295        at = strat->posInL(strat->L,strat->Ll,h,strat);
    296 
    297296        if(at <= strat->Ll)
    298297          /*- h will not become the next element to reduce -*/
    299298        {
    300           h->CanonicalizeP();
    301299          enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
    302300#ifdef KDEBUG
     
    363361        if (kFindDivisibleByInS(strat->S, strat->sevS, strat->sl, h) < 0)
    364362          return 1;
    365         h->CanonicalizeP();
    366363        enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
    367364#ifdef KDEBUG
  • Singular/kutil.cc

    r0632984 ra77e2c  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kutil.cc,v 1.79 2000-11-23 17:34:09 obachman Exp $ */
     4/* $Id: kutil.cc,v 1.80 2000-11-24 19:30:48 obachman Exp $ */
    55/*
    66* ABSTRACT: kernel: utils for kStd
     
    23612361  }
    23622362}
    2363 
    23642363
    23652364/*2
  • Singular/pInline2.h

    r0632984 ra77e2c  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: pInline2.h,v 1.18 2000-11-23 17:34:11 obachman Exp $
     9 *  Version: $Id: pInline2.h,v 1.19 2000-11-24 19:30:49 obachman Exp $
    1010 *******************************************************************/
    1111#ifndef PINLINE2_H
     
    466466{
    467467  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);
    470469}
    471470
     
    543542{
    544543  poly last;
    545   int shorter;
    546544  if (p == NULL || q == NULL) return NULL;
    547545
    548546  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);
    550548
    551549  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);
    553551
    554552  poly qq = q;
  • Singular/p_Minus_mm_Mult_qq__Template.cc

    r0632984 ra77e2c  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: p_Minus_mm_Mult_qq__Template.cc,v 1.7 2000-11-23 17:34:11 obachman Exp $
     9 *  Version: $Id: p_Minus_mm_Mult_qq__Template.cc,v 1.8 2000-11-24 19:30:49 obachman Exp $
    1010 *******************************************************************/
    1111
     
    119119    pSetCoeff0(m, tneg);
    120120    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);
    122128    pSetCoeff0(m, tm);
    123129  }
  • Singular/p_Procs.cc

    r0632984 ra77e2c  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: p_Procs.cc,v 1.21 2000-11-08 17:12:33 obachman Exp $
     9 *  Version: $Id: p_Procs.cc,v 1.22 2000-11-24 19:30:50 obachman Exp $
    1010 *******************************************************************/
    1111#include <string.h>
     
    5555#endif
    5656
     57#define inline
     58
    5759// Set HAVE_FAST_FIELD to:
    5860//   0 -- only FieldGeneral
     
    6870//   3 -- special cases for length <= 4
    6971//   4 -- special cases for length <= 8
    70 const int HAVE_FAST_LENGTH = 4;
     72const int HAVE_FAST_LENGTH = 3;
    7173
    7274// Set HAVE_FAST_ORD to:
     
    180182  pp_Mult_nn_Proc,
    181183  pp_Mult_mm_Proc,
     184  pp_Mult_mm_Noether_Proc,
    182185  p_Mult_mm_Proc,
    183186  p_Add_q_Proc,
     
    270273      case pp_Mult_nn_Proc: return "pp_Mult_nn_Proc";
    271274      case pp_Mult_mm_Proc: return "pp_Mult_mm_Proc";
     275      case pp_Mult_mm_Noether_Proc: return "pp_Mult_mm_Noether_Proc";
    272276      case p_Mult_mm_Proc: return "p_Mult_mm_Proc";
    273277      case p_Add_q_Proc: return "p_Add_q_Proc";
     
    419423}
    420424
    421 static inline void FastProcFilter(p_Proc proc, p_Field &field, p_Length &length,
    422                                    p_Ord &ord)
     425static 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     
     446static inline void FastProcFilter(p_Proc proc, p_Field &field,
     447                                  p_Length &length, p_Ord &ord)
    423448{
    424449  switch(proc)
     
    434459        break;
    435460       
     461      case pp_Mult_mm_Noether_Proc:
     462        pp_Mult_mm_Noether_Filter(field, length, ord);
     463        break;
     464
    436465      default: break;
    437466  }
    438467
    439468  FastOrdFilter(ord);
     469  FastOrdZeroFilter(ord);
    440470  FastLengthFilter(length);
    441471  FastFieldFilter(field);
     
    504534      case p_Add_q_Proc:
    505535      case p_Minus_mm_Mult_qq_Proc:
     536      case pp_Mult_mm_Noether_Proc:
    506537        return index(field, length, ord);
    507538       
     
    655686    (p_Procs->p_Copy != NULL) &&
    656687    (p_Procs->pp_Mult_mm != NULL) &&
     688    (p_Procs->pp_Mult_mm_Noether != NULL) &&
    657689    (p_Procs->p_Mult_mm != NULL) &&
    658690    (p_Procs->p_Add_q != NULL) &&
     
    661693    (p_Procs->p_Merge_q != NULL) &&
    662694    (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);
    663696}
    664697
     
    787820  printf("#undef %s\n#define %s %s\n", s_what, s_what, s_full_proc_name);
    788821  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);
    790823}
    791824
     
    903936 ***************************************************************/
    904937
    905 #define SetProc(what, field, length, ord)                   \
     938#define SetProc(what, field, length, ord)              \
    906939do                                                          \
    907940{                                                           \
     
    909942  p_Ord t_ord = ord;                                        \
    910943  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);\
    912945  _SetProc(what, t_field, t_length, t_ord);                 \
    913946}                                                           \
     
    922955  SetProc(p_Copy, field, length, OrdGeneral);
    923956  SetProc(pp_Mult_mm, field, length, OrdGeneral);
     957  SetProc(pp_Mult_mm_Noether, field, length, ord);
    924958  SetProc(p_Mult_mm, field, length, OrdGeneral);
    925959  SetProc(p_Add_q, field, length, ord);
  • Singular/p_Procs.h

    r0632984 ra77e2c  
    88 *  Author:  obachman (Olaf Bachmann)
    99 *  Created: 8/00
    10  *  Version: $Id: p_Procs.h,v 1.8 2000-11-23 17:34:12 obachman Exp $
     10 *  Version: $Id: p_Procs.h,v 1.9 2000-11-24 19:30:50 obachman Exp $
    1111 *******************************************************************/
    1212#ifndef P_PROCS_H
     
    2222typedef poly (*p_Mult_mm_Proc_Ptr)(poly p, poly m, const ring r);
    2323typedef poly (*pp_Mult_mm_Proc_Ptr)(poly p, poly m,
    24                                     int &shorter, poly spNoether,
    2524                                    const ring r,
    2625                                    poly &last);
     26typedef poly (*pp_Mult_mm_Noether_Proc_Ptr)(poly p, poly m,
     27                                            poly spNoether, int &length,
     28                                            const ring r,
     29                                            poly &last);
    2730typedef poly (*p_Add_q_Proc_Ptr)(poly p, poly q, int & shorter, const ring r);
    2831typedef poly (*p_Minus_mm_Mult_qq_Proc_Ptr)(poly p, poly m, poly q,
     
    4144  pp_Mult_nn_Proc_Ptr           pp_Mult_nn;
    4245  pp_Mult_mm_Proc_Ptr           pp_Mult_mm;
     46  pp_Mult_mm_Noether_Proc_Ptr   pp_Mult_mm_Noether;
    4347  p_Mult_mm_Proc_Ptr            p_Mult_mm;
    4448  p_Add_q_Proc_Ptr              p_Add_q;
  • Singular/pp_Mult_mm__Template.cc

    r0632984 ra77e2c  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: pp_Mult_mm__Template.cc,v 1.7 2000-11-23 17:34:13 obachman Exp $
     9 *  Version: $Id: pp_Mult_mm__Template.cc,v 1.8 2000-11-24 19:30:50 obachman Exp $
    1010 *******************************************************************/
    1111
     
    1414 *   Returns:  p*m
    1515 *   Const:    p, m
    16  *   If spNoether != NULL, then monoms which are smaller
    17  *   then spNoether are cut
    1816 *
    1917 ***************************************************************/
    20 poly pp_Mult_mm(poly p, const poly m, int& Shorter, const poly spNoether, const ring ri, poly &last)
     18poly pp_Mult_mm(poly p, const poly m, const ring ri, poly &last)
    2119{
    2220  p_Test(p, ri);
     
    3735
    3836
    39   if (spNoether == NULL)
     37  do
    4038  {
    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);
    5245  }
    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;
    7348  pNext(q) = NULL;
    7449
Note: See TracChangeset for help on using the changeset viewer.