Changeset ff4e34f in git


Ignore:
Timestamp:
Oct 4, 2000, 3:12:05 PM (24 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
f103fb07c2e69147dd1bca55b8421e35361355a8
Parents:
122d498cedb975079e9eff3554a721e5e8f3af86
Message:
* buckets, lmBin, tailBin


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

Legend:

Unmodified
Added
Removed
  • Singular/kInline.cc

    r122d49 rff4e34f  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: kInline.cc,v 1.3 2000-09-25 12:26:31 obachman Exp $
     9 *  Version: $Id: kInline.cc,v 1.4 2000-10-04 13:12:01 obachman Exp $
    1010 *******************************************************************/
    1111#ifndef KINLINE_CC
     
    1717#include "p_Procs.h"
    1818#include "kbuckets.h"
    19 
     19#include "omalloc.h"
     20
     21#define HAVE_TAIL_BIN
     22// #define HAVE_LM_BIN
     23
     24KINLINE skStrategy::skStrategy()
     25{
     26  memset(this, 0, sizeof(skStrategy));
     27  tailRing = currRing;
     28  P.tailRing = currRing;
     29  P.lmRing = currRing;
     30#ifdef HAVE_LM_BIN
     31  lmBin = omGetStickyBinOfBin(currRing->PolyBin);
     32#endif
     33#ifdef HAVE_TAIL_BIN
     34  tailBin = omGetStickyBinOfBin(currRing->PolyBin);
     35#endif
     36}
     37
     38KINLINE skStrategy::~skStrategy()
     39{
     40  if (lmBin != NULL)
     41    omMergeStickyBinIntoBin(lmBin, currRing->PolyBin);
     42  if (tailBin != NULL)
     43    omMergeStickyBinIntoBin(tailBin,
     44                            (tailRing!= NULL ? tailRing->PolyBin:
     45                             currRing->PolyBin));
     46}
     47 
    2048KINLINE TSet initT () { return (TSet)omAlloc0(setmax*sizeof(TObject)); }
    2149
     
    97125}
    98126
    99 KINLINE poly sLObject::GetP(ring get_lmRing = currRing)
     127KINLINE poly sLObject::GetP(ring get_lmRing = currRing, omBin lmBin = NULL)
    100128{
    101129  kTest_L(this);
     
    112140    if (get_lmRing != lmRing)
    113141    {
    114       p = k_LmShallowCopyDelete_tailRing_2_lmRing(p, tailRing, lmRing);
    115       get_lmRing = lmRing;
    116     }
    117   }
     142      if (lmBin == NULL) lmBin = get_lmRing->PolyBin;
     143      p = k_LmShallowCopyDelete_tailRing_2_lmRing(p,lmRing, get_lmRing,lmBin);
     144      lmRing = get_lmRing;
     145    }
     146    else if (lmBin != NULL)
     147    {
     148      p = p_LmShallowCopyDelete(p, lmRing, lmBin);
     149    }
     150  }
     151   
    118152  kTest_L(this);
    119153  return p;
     
    126160 *
    127161 ***************************************************************/
    128 
    129 KINLINE poly k_LmInit_lmRing_2_tailRing(poly p, ring lmRing, ring tailRing)
     162 
     163KINLINE poly k_LmInit_lmRing_2_tailRing(poly p, ring lmRing, ring tailRing, omBin tailBin)
    130164{
    131165  int i;
    132   poly np = p_New(tailRing);
     166  poly np = p_Init(tailRing, tailBin);
    133167  pNext(np) = pNext(p);
    134168  pSetCoeff0(np, pGetCoeff(p));
     
    147181}
    148182
    149 KINLINE poly k_LmInit_tailRing_2_lmRing(poly p, ring tailRing, ring lmRing)
    150 {
    151   return k_LmInit_lmRing_2_tailRing(p, tailRing, lmRing);
     183KINLINE poly k_LmInit_tailRing_2_lmRing(poly p, ring tailRing, ring lmRing, omBin lmBin)
     184{
     185  return k_LmInit_lmRing_2_tailRing(p, tailRing, lmRing, lmBin);
    152186}
    153187
    154188// this should be made more efficient
    155 KINLINE poly k_LmShallowCopyDelete_lmRing_2_tailRing(poly p, ring lmRing, ring tailRing)
    156 {
    157   poly np = k_LmInit_lmRing_2_tailRing(p, lmRing, tailRing);
     189KINLINE poly k_LmShallowCopyDelete_lmRing_2_tailRing(poly p, ring lmRing, ring tailRing, omBin tailBin)
     190{
     191  poly np = k_LmInit_lmRing_2_tailRing(p, lmRing, tailRing, tailBin);
    158192  p_LmFree(p, lmRing);
    159193  return np;
    160194}
    161195
    162 KINLINE poly k_LmShallowCopyDelete_tailRing_2_lmRing(poly p, ring tailRing, ring lmRing)
    163 {
    164   poly np = k_LmInit_tailRing_2_lmRing(p, tailRing, lmRing);
     196KINLINE poly k_LmShallowCopyDelete_tailRing_2_lmRing(poly p, ring tailRing, ring lmRing, omBin lmBin)
     197{
     198  poly np = k_LmInit_tailRing_2_lmRing(p, tailRing, lmRing, lmBin);
    165199  p_LmFree(p, tailRing);
    166200  return np;
    167201}
    168202
     203KINLINE poly k_LmInit_lmRing_2_tailRing(poly p, ring lmRing, ring tailRing)
     204{
     205  return k_LmInit_lmRing_2_tailRing(p, lmRing, tailRing, tailRing->PolyBin);
     206}
     207
     208KINLINE poly k_LmInit_tailRing_2_lmRing(poly p, ring tailRing, ring lmRing)
     209{
     210  return  k_LmInit_tailRing_2_lmRing(p, tailRing, lmRing, lmRing->PolyBin);
     211}
     212
     213KINLINE poly k_LmShallowCopyDelete_lmRing_2_tailRing(poly p, ring lmRing, ring tailRing)
     214{
     215  return k_LmShallowCopyDelete_lmRing_2_tailRing(p, lmRing, tailRing, tailRing->PolyBin);
     216}
     217
     218KINLINE poly k_LmShallowCopyDelete_tailRing_2_lmRing(poly p, ring tailRing, ring lmRing)
     219{
     220  return  k_LmShallowCopyDelete_tailRing_2_lmRing(p, tailRing, lmRing, lmRing->PolyBin);
     221}
     222
    169223#endif // defined(KINLINE) || defined(KUTIL_CC)
    170224#endif // KINLINE_CC
  • Singular/kspoly.cc

    r122d49 rff4e34f  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kspoly.cc,v 1.10 2000-09-25 12:26:32 obachman Exp $ */
     4/* $Id: kspoly.cc,v 1.11 2000-10-04 13:12:01 obachman Exp $ */
    55/*
    66*  ABSTRACT -  Routines for Spoly creation and reductions
     
    111111                   int use_buckets, ring tailRing)
    112112{
    113   assume(kTest_L(Pair));
     113  kTest_L(Pair);
    114114  poly p1 = Pair->p1;
    115115  poly p2 = Pair->p2;
  • Singular/kstd1.cc

    r122d49 rff4e34f  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kstd1.cc,v 1.54 2000-09-18 09:19:07 obachman Exp $ */
     4/* $Id: kstd1.cc,v 1.55 2000-10-04 13:12:01 obachman Exp $ */
    55/*
    66* ABSTRACT:
     
    17711771//Print("%d reductions canceled \n",strat->cel);
    17721772  HCord=strat->HCord;
    1773   kFreeStrat(strat);
     1773  delete(strat);
    17741774  if ((delete_w)&&(w!=NULL)&&(*w!=NULL)) delete *w;
    17751775  return r;
     
    18971897    l->m[1].data=(void *)strat->M;
    18981898  }
    1899   kFreeStrat(strat);
     1899  delete(strat);
    19001900  if (reduced>2)
    19011901  {
     
    19171917  else
    19181918    p=kNF2(F,Q,p,strat,lazyReduce);
    1919   kFreeStrat(strat);
     1919  delete(strat);
    19201920  return p;
    19211921}
     
    19341934  else
    19351935    res=kNF2(F,Q,p,strat,lazyReduce);
    1936   kFreeStrat(strat);
     1936  delete(strat);
    19371937  return res;
    19381938}
     
    19931993//  }
    19941994  ideal shdl=strat->Shdl;
    1995   kFreeStrat(strat);
     1995  delete(strat);
    19961996  return shdl;
    19971997}
  • Singular/kstd2.cc

    r122d49 rff4e34f  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kstd2.cc,v 1.48 2000-09-25 12:26:32 obachman Exp $ */
     4/* $Id: kstd2.cc,v 1.49 2000-10-04 13:12:02 obachman Exp $ */
    55/*
    66*  ABSTRACT -  Kernel: alg. of Buchberger
     
    623623      /* statistic */
    624624      if (TEST_OPT_PROT) PrintS("s");
    625       strat->P.GetP();
     625      strat->P.GetP(currRing, strat->lmBin);
    626626      /* enter P.p into s and L */
    627627      {
     
    877877  }
    878878  pLexOrder = b;
    879   kFreeStrat(strat);
     879  delete(strat);
    880880  if ((delete_w)&&(w!=NULL)&&(*w!=NULL)) delete *w;
    881881  idSkipZeroes(r);
  • Singular/kstdfac.cc

    r122d49 rff4e34f  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kstdfac.cc,v 1.41 2000-09-25 12:26:32 obachman Exp $ */
     4/* $Id: kstdfac.cc,v 1.42 2000-10-04 13:12:02 obachman Exp $ */
    55/*
    66*  ABSTRACT -  Kernel: factorizing alg. of Buchberger
     
    884884  {
    885885    orgstrat=strat->next;
    886     kFreeStrat(strat);
     886    delete(strat);
    887887    strat=orgstrat;
    888888  }
  • Singular/kutil.cc

    r122d49 rff4e34f  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kutil.cc,v 1.63 2000-09-25 12:26:33 obachman Exp $ */
     4/* $Id: kutil.cc,v 1.64 2000-10-04 13:12:03 obachman Exp $ */
    55/*
    66* ABSTRACT: kernel: utils for kStd
     
    32433243  }
    32443244  else atT = 0;
     3245
     3246  if (strat->tailBin != NULL)
     3247    pNext(p.p)=p_ShallowCopyDelete(pNext(p.p),
     3248                                   (strat->tailRing != NULL ?
     3249                                    strat->tailRing : currRing),
     3250                                   strat->tailBin);
    32453251  strat->T[atT].p = p.p;
    32463252  strat->T[atT].ecart = p.ecart;
     
    32823288    strat->T[atT].length = p.length;
    32833289
    3284   strat->T[atT].pLength = p.pLength;
     3290  if (strat->tailBin != NULL)
     3291    pNext(p.p)=p_ShallowCopyDelete(pNext(p.p),
     3292                                   (strat->tailRing != NULL ?
     3293                                    strat->tailRing : currRing),
     3294                                   strat->tailBin);
     3295  if (strat->use_buckets && p.pLength <= 0)
     3296    strat->T[atT].pLength = pLength(p.p);
     3297  else
     3298    strat->T[atT].pLength = p.pLength;
     3299
    32853300  if (p.sev == 0)
    32863301  {
     
    36243639}
    36253640
    3626 void kFreeStrat(kStrategy strat)
    3627 {
    3628   omFreeSize(strat, sizeof(skStrategy));
    3629 }
    3630 
    36313641rOrderType_t spGetOrderType(ring r, int modrank, int syzcomp)
    36323642{
  • Singular/kutil.h

    r122d49 rff4e34f  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: kutil.h,v 1.31 2000-09-25 12:26:34 obachman Exp $ */
     6/* $Id: kutil.h,v 1.32 2000-10-04 13:12:03 obachman Exp $ */
    77/*
    88* ABSTRACT: kernel: utils for kStd
     
    5858  KINLINE void Tail_Minus_mm_Mult_qq(poly m, poly qq, int lq, poly spNoether);
    5959  KINLINE void sLObject::Tail_Mult_nn(number n);
    60   KINLINE poly GetP(ring LmRing = currRing);
     60  KINLINE poly GetP(ring LmRing = currRing, omBin bin = NULL);
    6161  KINLINE void CanonicalizeP();
    6262};
     
    126126  BOOLEAN use_buckets;
    127127  ring tailRing;
     128  omBin lmBin;
     129  omBin tailBin;
    128130  /*FALSE, if posInL == posInL10*/
    129131  char    redTailChange;
     
    131133  char    newt;/*used for messageSets*/
    132134
    133   skStrategy()
    134     {
    135       memset(this, 0, sizeof(skStrategy));
    136       tailRing = currRing;
    137       P.tailRing = currRing;
    138       P.lmRing = currRing;
    139     };
    140  
     135  KINLINE skStrategy();
     136  KINLINE ~skStrategy();
    141137};
    142138
     
    208204
    209205KINLINE TSet initT ();
     206KINLINE poly k_LmInit_lmRing_2_tailRing(poly p, ring lmRing, ring tailRing, omBin bin);
     207KINLINE poly k_LmInit_tailRing_2_lmRing(poly p, ring tailRing, ring lmRing, omBin bin);
     208KINLINE poly k_LmShallowCopyDelete_lmRing_2_tailRing(poly p, ring lmRing, ring tailRing, omBin bin);
     209KINLINE poly k_LmShallowCopyDelete_tailRing_2_lmRing(poly p, ring tailRing, ring lmRing,  omBin bin);
     210
    210211KINLINE poly k_LmInit_lmRing_2_tailRing(poly p, ring lmRing, ring tailRing);
    211212KINLINE poly k_LmInit_tailRing_2_lmRing(poly p, ring tailRing, ring lmRing);
  • Singular/pInline1.h

    r122d49 rff4e34f  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: pInline1.h,v 1.4 2000-09-20 12:56:36 obachman Exp $
     9 *  Version: $Id: pInline1.h,v 1.5 2000-10-04 13:12:04 obachman Exp $
    1010 *******************************************************************/
    1111#ifndef PINLINE1_H
     
    6060 *
    6161 ***************************************************************/
    62 PINLINE1 poly p_Init(ring r)
     62PINLINE1 poly p_Init(ring r, omBin bin)
    6363{
    6464  p_CheckRing1(r);
     65  pAssume1(bin != NULL && r->PolyBin->sizeW == bin->sizeW);
    6566  poly p;
    66   omTypeAlloc0Bin(poly, p, r->PolyBin);
     67  omTypeAlloc0Bin(poly, p, bin);
    6768  p_SetRingOfPoly(p, r);
    6869  return p;
    6970}
     71PINLINE1 poly p_Init(ring r)
     72{
     73  return p_Init(r, r->PolyBin);
     74}
     75
    7076PINLINE1 poly p_LmInit(poly p, ring r)
    7177{
     
    9096  _pSetCoeff0(np, n_Copy(_pGetCoeff(p), r));
    9197  return np;
     98}
     99
     100PINLINE1 poly p_LmShallowCopyDelete(poly p, const ring r, omBin bin)
     101{
     102  p_CheckPolyRing1(p, r);
     103  pAssume1(bin->sizeW == r->PolyBin->sizeW);
     104  poly new_p = p_New(r);
     105  p_MemCopy_LengthGeneral(new_p->exp, p->exp, r->ExpLSize);
     106  pSetCoeff0(new_p, pGetCoeff(p));
     107  pNext(new_p) = pNext(p);
     108  omFreeBinAddr(p);
     109  return new_p;
    92110}
    93111
  • Singular/pInline2.h

    r122d49 rff4e34f  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: pInline2.h,v 1.6 2000-09-25 12:26:35 obachman Exp $
     9 *  Version: $Id: pInline2.h,v 1.7 2000-10-04 13:12:04 obachman Exp $
    1010 *******************************************************************/
    1111#ifndef PINLINE2_H
     
    169169 *
    170170 ***************************************************************/
    171 PINLINE2 poly p_New(ring r)
     171PINLINE2 poly p_New(ring r, omBin bin)
    172172{
    173173  p_CheckRing2(r);
     174  pAssume2(bin != NULL && r->PolyBin->sizeW == bin->sizeW);
    174175  poly p;
    175   omTypeAllocBin(poly, p, r->PolyBin);
     176  omTypeAllocBin(poly, p, bin);
    176177  p_SetRingOfPoly(p, r);
    177178  return p;
     179}
     180
     181PINLINE2 poly p_New(ring r)
     182{
     183  return p_New(r, r->PolyBin);
    178184}
    179185
     
    302308    p_LmDelete(p, lmRing);
    303309  }
     310}
     311
     312PINLINE2 poly p_ShallowCopyDelete(poly p, const ring r, omBin bin)
     313{
     314  p_CheckPolyRing2(p, r);
     315  pAssume2(r->PolyBin->sizeW == bin->sizeW);
     316  return r->p_Procs->p_ShallowCopyDelete(p, r, bin);
    304317}
    305318
  • Singular/p_Procs.cc

    r122d49 rff4e34f  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: p_Procs.cc,v 1.12 2000-09-25 12:26:35 obachman Exp $
     9 *  Version: $Id: p_Procs.cc,v 1.13 2000-10-04 13:12:04 obachman Exp $
    1010 *******************************************************************/
    1111#include <string.h>
     
    6464//   3 -- special cases for length <= 4
    6565//   4 -- special cases for length <= 8
    66 const int HAVE_FAST_LENGTH = 3;
     66const int HAVE_FAST_LENGTH = 4;
    6767
    6868// Set HAVE_FAST_ORD to:
  • Singular/p_polys.h

    r122d49 rff4e34f  
    88 *  Author:  obachman (Olaf Bachmann)
    99 *  Created: 9/00
    10  *  Version: $Id: p_polys.h,v 1.2 2000-09-20 12:56:37 obachman Exp $
     10 *  Version: $Id: p_polys.h,v 1.3 2000-10-04 13:12:05 obachman Exp $
    1111 *******************************************************************/
    1212#ifndef P_POLYS_H
     
    9797 ***************************************************************/
    9898PINLINE2 poly p_New(ring r);
     99PINLINE2 poly p_New(ring r, omBin bin);
    99100PINLINE1 poly p_Init(ring r);
     101PINLINE1 poly p_Init(ring rm, omBin bin);
    100102PINLINE1 poly p_LmInit(poly p, ring r);
    101103PINLINE1 poly p_Head(poly p, ring r);
     
    180182PINLINE2 void p_Delete(poly *p, const ring lmRing, const ring tailRing);
    181183
     184// copys monomials of p, allocates nwe monomials from bin,
     185// deletes monomoals of p
     186PINLINE2 poly p_ShallowCopyDelete(poly p, const ring r, omBin bin);
     187// simial but does it only for leading monomial
     188PINLINE1 poly p_LmShallowCopyDelete(poly p, const ring r, omBin bin);
    182189
    183190/***************************************************************
Note: See TracChangeset for help on using the changeset viewer.