Changeset 6538bd in git


Ignore:
Timestamp:
Apr 6, 2016, 3:40:08 PM (8 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '5b153614cbc72bfa198d75b1e9e33dab2645d9fe')
Children:
b5fe229e050d2307170596d0863df47990daae6a
Parents:
281335d5bbcb1497be84e729427cf2f4b494c484
Message:
opt: p_Power(f,i,r) in char p with i>p
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpolys/polys/monomials/p_polys.cc

    r281335 r6538bd  
    20942094}
    20952095
     2096static poly p_Pow_charp(poly p, int i, const ring r)
     2097{
     2098  //assume char_p == i
     2099  poly h=p;
     2100  while(h!=NULL) { p_MonPower(h,i,r);pIter(h);}
     2101  return p;
     2102}
     2103
    20962104/*2
    20972105* returns the i-th power of p
     
    21572165          /* else: binom ?*/
    21582166          int char_p=rChar(r);
     2167          if ((char_p>0) && (i>char_p)
     2168          && ((rField_is_Zp(r,char_p)
     2169            || (rField_is_Zp_a(r,char_p)))))
     2170          {
     2171            poly h=p_Pow_charp(p_Copy(p,r),char_p,r);
     2172            int rest=i-char_p;
     2173            while (rest>=char_p)
     2174            {
     2175              rest-=char_p;
     2176              h=p_Mult_q(h,p_Pow_charp(p_Copy(p,r),char_p,r),r);
     2177            }
     2178            poly res=h;
     2179            if (rest>0)
     2180              res=p_Mult_q(p_Power(p_Copy(p,r),rest,r),h,r);
     2181            p_Delete(&p,r);
     2182            return res;
     2183          }
    21592184          if ((pNext(rc) != NULL)
    21602185#ifdef HAVE_RINGS
Note: See TracChangeset for help on using the changeset viewer.