Changeset a576b0 in git


Ignore:
Timestamp:
May 29, 2015, 1:39:46 PM (8 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'a7324b6e0b44a1a8ed3fa4d9ca3e2ff210ddd52c')
Children:
e00d2000bacbdc1e3326af703d7555b6a847ad1e
Parents:
40e862737f0776c1a89a482ba5c81054d4339085
Message:
optim. kFindDivisibleByInT
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • Singular/extra.cc

    r40e8627 ra576b0  
    37563756        bigintmat *b=(bigintmat *)h->Data();
    37573757        // just for tests: simply transpose
    3758         bigintmat *bb=b->transpose();
    3759         // return the result:
     3758        bigintmat *bb=b->transpose();
     3759        // return the result:
    37603760        res->rtyp=CMATRIX_CMD;
    3761         res->data=(char*)bb;
     3761        res->data=(char*)bb;
    37623762        return FALSE;
    37633763      }
     
    37653765      {
    37663766        WerrorS("system(\"LU\",<cmatrix>) expected");
    3767         return TRUE;
     3767        return TRUE;
    37683768      }
    37693769    }
  • kernel/GBEngine/kstd1.cc

    r40e8627 ra576b0  
    186186  loop
    187187  {
    188     j = kFindDivisibleByInT(strat->T, strat->sevT, strat->tl, h);
     188    j = kFindDivisibleByInT(strat, h);
    189189    if (j < 0)
    190190    {
     
    214214            p_LmShortDivisibleBy(strat->T[i].GetLmTailRing(), strat->sevT[i], h->GetLmTailRing(), ~h->sev, strat->tailRing))
    215215#else
    216           j = kFindDivisibleByInT(strat->T, strat->sevT, strat->tl, h, i);
     216          j = kFindDivisibleByInT(strat, h, i);
    217217        if (j < 0) break;
    218218        i = j;
     
    387387  loop
    388388  {
    389     j = kFindDivisibleByInT(strat->T, strat->sevT, strat->tl, h);
     389    j = kFindDivisibleByInT(strat, h);
    390390#if ADIDEBUG_NF
    391391    if(j != -1)
     
    430430            p_LmShortDivisibleBy(strat->T[i].GetLmTailRing(), strat->sevT[i], h->GetLmTailRing(), ~h->sev, strat->tailRing))
    431431#else
    432           j = kFindDivisibleByInT(strat->T, strat->sevT, strat->tl, h, i);
     432          j = kFindDivisibleByInT(strat, h, i);
    433433        if (j < 0) break;
    434434        i = j;
     
    589589  loop
    590590  {
    591     j = kFindDivisibleByInT(strat->T, strat->sevT, strat->tl, h);
     591    j = kFindDivisibleByInT(strat, h);
    592592    if (j < 0)
    593593    {
  • kernel/GBEngine/kstd2.cc

    r40e8627 ra576b0  
    9999// return -1 if no divisor is found
    100100//        number of first divisor, otherwise
    101 int kFindDivisibleByInT(const TSet &T, const unsigned long* sevT,
    102                         const int tl, const LObject* L, const int start)
     101int kFindDivisibleByInT(const kStrategy strat, const LObject* L, const int start)
    103102{
    104103  unsigned long not_sev = ~L->sev;
    105104  int j = start;
    106   poly p=L->p;
    107   ring r=currRing;
    108   L->GetLm(p, r);
    109105
    110106  pAssume(~not_sev == p_GetShortExpVector(p, r));
    111107
    112   if (r == currRing)
    113   {
     108  const TSet T=strat->T;
     109  const unsigned long* sevT=strat->sevT;
     110  if (L->p!=NULL)
     111  {
     112    const ring r=currRing;
     113    const poly p=L->p;
    114114    loop
    115115    {
    116       if (j > tl) return -1;
     116      if (j > strat->tl) return -1;
    117117#if defined(PDEBUG) || defined(PDIV_DEBUG)
    118118      if (p_LmShortDivisibleBy(T[j].p, sevT[j],
     
    129129  else
    130130  {
     131    const poly p=L->t_p;
     132    const ring r=strat->tailRing;
    131133    loop
    132134    {
    133       if (j > tl) return -1;
     135      if (j > strat->tl) return -1;
    134136#if defined(PDEBUG) || defined(PDIV_DEBUG)
    135137      if (p_LmShortDivisibleBy(T[j].t_p, sevT[j],
     
    341343  loop
    342344  {
    343     j = kFindDivisibleByInT(strat->T, strat->sevT, strat->tl, h);
     345    j = kFindDivisibleByInT(strat, h);
    344346    if (j < 0) return 1;
    345347    ksReducePoly(h, &(strat->T[j]), NULL, NULL, strat); // with debug output
     
    423425  loop
    424426  {
    425     j = kFindDivisibleByInT(strat->T, strat->sevT, strat->tl, h);
     427    j = kFindDivisibleByInT(strat, h);
    426428    if (j < 0) return 1;
    427429
     
    595597  loop
    596598  {
    597     j = kFindDivisibleByInT(strat->T, strat->sevT, strat->tl, h, start);
     599    j = kFindDivisibleByInT(strat, h, start);
    598600    if (j < 0)
    599601    {
     
    765767      {
    766768        int j;
    767         j = kFindDivisibleByInT(strat->T, strat->sevT, strat->tl, &Ln);
     769        j = kFindDivisibleByInT(strat, &Ln);
    768770        if (j < 0) break;
    769771        With = &(strat->T[j]);
     
    858860  loop
    859861  {
    860     j = kFindDivisibleByInT(strat->T, strat->sevT, strat->tl, h);
     862    j = kFindDivisibleByInT(strat, h);
    861863    if (j < 0) return 1;
    862864
     
    10221024  loop
    10231025  {
    1024     j=kFindDivisibleByInT(strat->T, strat->sevT, strat->tl, h);
     1026    j=kFindDivisibleByInT(strat, h);
    10251027    if (j < 0) return 1;
    10261028
     
    31603162      LObject Ln (strat->S[k],currRing, strat->tailRing);
    31613163      Ln.SetShortExpVector();
    3162       j = kFindDivisibleByInT(strat->T, strat->sevT, strat->tl, &Ln, j+1);
     3164      j = kFindDivisibleByInT(strat, &Ln, j+1);
    31633165      if (j<0) {  k++; j=-1;}
    31643166      else
     
    31663168        if ( pLmCmp(strat->S[k],strat->T[j].p) == 0)
    31673169        {
    3168           j = kFindDivisibleByInT(strat->T, strat->sevT, strat->tl, &Ln, j+1);
     3170          j = kFindDivisibleByInT(strat, &Ln, j+1);
    31693171          if (j<0) {  k++; j=-1;}
    31703172          else
     
    32633265  loop
    32643266  {
    3265     j = kFindDivisibleByInT(strat->T, strat->sevT, strat->tl, h);
     3267    j = kFindDivisibleByInT(strat, h);
    32663268    if (j < 0)
    32673269    {
     
    33523354        if (at <= strat->Ll)
    33533355        {
    3354           int dummy=strat->sl;
     3356          //int dummy=strat->sl;
    33553357          /*          if (kFindDivisibleByInS(strat,&dummy, h) < 0) */
    3356           if (kFindDivisibleByInT(strat->T,strat->sevT, dummy, h) < 0)
     3358          //if (kFindDivisibleByInT(strat->T,strat->sevT, dummy, h) < 0)
     3359          if (kFindDivisibleByInT(strat, h) < 0)
    33573360            return 1;
    33583361          enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
  • kernel/GBEngine/kutil.cc

    r40e8627 ra576b0  
    54445444      {
    54455445        int j;
    5446         j = kFindDivisibleByInT(strat->T, strat->sevT, strat->tl, &Ln);
     5446        j = kFindDivisibleByInT(strat, &Ln);
    54475447        if (j < 0) break;
    54485448        With = &(strat->T[j]);
     
    97579757      {
    97589758        int j;
    9759         j = kFindDivisibleByInT(strat->T, strat->sevT, strat->tl, &Ln);
     9759        j = kFindDivisibleByInT(strat, &Ln);
    97609760        if (j < 0) break;
    97619761        With = &(strat->T[j]);
  • kernel/GBEngine/kutil.h

    r40e8627 ra576b0  
    559559/// return -1 if no divisor is found
    560560///        number of first divisor in T, otherwise
    561 int kFindDivisibleByInT(const TSet &T, const unsigned long* sevT,
    562                         const int tl, const LObject* L, const int start=0);
     561int kFindDivisibleByInT(const kStrategy strat, const LObject* L, const int start=0);
    563562
    564563/// return -1 if no divisor is found
  • libpolys/polys/monomials/p_polys.cc

    r40e8627 ra576b0  
    45294529
    45304530
    4531 static inline unsigned long GetBitFields(long e,
    4532                                          unsigned int s, unsigned int n)
     4531static inline unsigned long GetBitFields(const long e,
     4532                                         const unsigned int s, const unsigned int n)
    45334533{
    45344534#define Sy_bit_L(x)     (((unsigned long)1L)<<(x))
     
    45624562// exp1 / exp2 ==> (ev1 & ~ev2) == 0, i.e.,
    45634563// if (ev1 & ~ev2) then exp1 does not divide exp2
    4564 unsigned long p_GetShortExpVector(poly p, const ring r)
     4564unsigned long p_GetShortExpVector(const poly p, const ring r)
    45654565{
    45664566  assume(p != NULL);
  • libpolys/polys/monomials/p_polys.h

    r40e8627 ra576b0  
    5151 *
    5252 ***************************************************************/
    53 unsigned long p_GetShortExpVector(poly a, const ring r);
     53unsigned long p_GetShortExpVector(const poly a, const ring r);
    5454
    5555/// p_GetShortExpVector of p * pp
Note: See TracChangeset for help on using the changeset viewer.