Changeset 55e6b0 in git


Ignore:
Timestamp:
Nov 30, 2014, 3:23:34 AM (9 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', 'e7cc1ebecb61be8b9ca6c18016352af89940b21a')
Children:
80478a3a86d08f6bb8b5675c8c993cd57e0b9c47
Parents:
0ab2c4c1fc27408db639cea5d0dd682f902463b4
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2014-11-30 03:23:34+01:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2014-11-30 03:26:49+01:00
Message:
Improved Cache Keys - no need for numbers in some cases
Location:
Singular/dyn_modules/syzextra
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Singular/dyn_modules/syzextra/syzextra.cc

    r0ab2c4c r55e6b0  
    451451
    452452
    453 static FORCE_INLINE poly myp_Head(const poly p, const ring r)
    454 {
    455  p_Test(p,r);
    456  const poly pp = p_Head(p, r);
    457  p_Test(pp,r);
    458  return pp; 
     453static FORCE_INLINE poly myp_Head(const poly p, const bool bIgnoreCoeff, const ring r)
     454{
     455  assume( p != NULL ); p_LmCheckPolyRing1(p, r);
     456   
     457  poly np; omTypeAllocBin(poly, np, r->PolyBin);
     458  p_SetRingOfLm(np, r);
     459  memcpy(np->exp, p->exp, r->ExpL_Size*sizeof(long));
     460  pNext(np) = NULL;
     461  pSetCoeff0(np, (bIgnoreCoeff)? NULL : n_Copy(pGetCoeff(p), r->cf));
     462
     463  p_LmCheckPolyRing1(np, r);
     464  return np; 
    459465}
    460466   
     
    15781584// };
    15791585
    1580 
    15811586   
    1582    bool my_p_LmCmp (poly a, poly b, const ring r) { return p_LmCmp(a, b, r) == -1; } // TODO: change to simple lex. memory compare!
     1587bool my_p_LmCmp (poly a, poly b, const ring r) { return p_LmCmp(a, b, r) == -1; } // TODO: change to simple lex. memory compare!
    15831588
    15841589// NOTE: need p_Copy?????? for image + multiplier!!???
     
    16151620       assume( p_LmEqual(itr->first, multiplier, r) );
    16161621
    1617        if( itr->second == NULL )
     1622       if( itr->second == NULL ) // leadcoeff plays no role if value is NULL!
    16181623         return (NULL);
    16191624
     
    16841689     p_Test(multiplier, r);
    16851690     
    1686      T.insert( TP2PCache::value_type(myp_Head(multiplier, r), p) ); //     T[ multiplier ] = p;
     1691     T.insert( TP2PCache::value_type(myp_Head(multiplier, (p==NULL), r), p) ); //     T[ multiplier ] = p;
    16871692
    16881693     p_Test(multiplier, r);
     
    17141719  if( UNLIKELY( __PROT__ ) ) ++ m_stat[8]; // PrintS("S"); // store // %d", tail + 1);
    17151720 
    1716   T.insert( TP2PCache::value_type(p_Copy(multiplier, r), p) );
     1721  T.insert( TP2PCache::value_type(myp_Head(multiplier, (p==NULL), r), p) );
    17171722
    17181723  m_cache.insert( TCache::value_type(tail, T) );
     
    20412046    m_sev( p_GetShortExpVector(_lt, R) ),  m_label( _label ),  m_lt( _lt )
    20422047#ifndef SING_NDEBUG
    2043     , _R(R), m_lt_copy( myp_Head(_lt, R) )
     2048    , _R(R), m_lt_copy( myp_Head(_lt, true, R) ) // note that p_LmEqual only tests exponents!
    20442049#endif 
    20452050{
  • Singular/dyn_modules/syzextra/syzextra.h

    r0ab2c4c r55e6b0  
    3737#endif
    3838
    39 // set to 1 if all leading coeffs are assumed to be all =1...
     39// set to 1 if all leading coeffs are assumed to be all =1...
     40// note the use of simplify on input in SSinit!
    4041#ifndef NODIVISION
    4142# define NODIVISION 1
Note: See TracChangeset for help on using the changeset viewer.