Changeset a497a1 in git


Ignore:
Timestamp:
Sep 10, 2012, 8:33:35 PM (10 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'ad2543eab51733612ba7d118afc77edca719600e')
Children:
36ebfaa4578b6a83a5511dbbc252bdd925f2845f
Parents:
fff61504bea4abfcad24fecfcec903e476caa188
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-09-10 20:33:35+02:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-09-10 20:41:23+02:00
Message:
replaced direct calls to ->p_Procs->* from kernel/kInline.h with appropriate wrappers

add: added another variant of p_Minus_mm_Mult_qq (with a reference to last)
chg: minor changes to p_Last
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/kInline.h

    rfff6150 ra497a1  
    2222
    2323#include <polys/monomials/p_polys.h>
    24 #include <polys/templates/p_Procs.h>
    2524#include <polys/kbuckets.h>
    2625
     
    311310{
    312311  if (t_p != NULL)
    313   {    t_p = tailRing->p_Procs->p_Mult_nn(t_p, n, tailRing);
     312  {    t_p = p_Mult_nn(t_p, n, tailRing);
    314313    if (p != NULL) pSetCoeff0(p, pGetCoeff(t_p));
    315314  }
     
    583582    poly _p = (t_p != NULL ? t_p : p);
    584583    assume(_p != NULL);
    585     pNext(_p) = tailRing->p_Procs->p_Mult_nn(pNext(_p), n, tailRing);
     584    pNext(_p) = p_Mult_nn(pNext(_p), n, tailRing);
    586585  }
    587586}
     
    598597    poly _p = (t_p != NULL ? t_p : p);
    599598    assume(_p != NULL);
    600     int shorter;
    601     pNext(_p) = tailRing->p_Procs->p_Minus_mm_Mult_qq(pNext(_p), m, q,
    602                                                       shorter,spNoether,
    603                                                       tailRing, last);
    604     pLength += lq - shorter;
     599
     600    pNext(_p) = p_Minus_mm_Mult_qq( pNext(_p), m, q, pLength, lq,
     601                                    spNoether, last, tailRing );
     602//    tailRing->p_Procs->p_Minus_mm_Mult_qq(pNext(_p), m, q, shorter,spNoether, tailRing, last);
     603//    pLength += lq - shorter;
    605604  }
    606605}
  • libpolys/polys/monomials/p_polys.cc

    rfff6150 ra497a1  
    40724072* respect syzComp
    40734073*/
    4074 poly p_Last(poly a, int &l, const ring r)
    4075 {
    4076   if (a == NULL)
     4074poly p_Last(const poly p, int &l, const ring r)
     4075{
     4076  if (p == NULL)
    40774077  {
    40784078    l = 0;
     
    40804080  }
    40814081  l = 1;
     4082  poly a = p;
    40824083  if (! rIsSyzIndexRing(r))
    40834084  {
    4084     while (pNext(a)!=NULL)
    4085     {
    4086       pIter(a);
     4085    poly next = pNext(a);
     4086    while (next!=NULL)
     4087    {
     4088      a = next;
     4089      next = pNext(a);     
    40874090      l++;
    40884091    }
  • libpolys/polys/monomials/p_polys.h

    rfff6150 ra497a1  
    185185  return l;
    186186}
     187
     188// returns the length of a polynomial (numbers of monomials) and the last mon.
     189// respect syzComp
     190poly p_Last(const poly a, int &l, const ring r);
     191
     192/*----------------------------------------------------*/
    187193
    188194void      p_Norm(poly p1, const ring r);
     
    958964}
    959965
    960 // return p - m*Copy(q), destroys p; const: p,m
    961 static inline poly p_Minus_mm_Mult_qq(poly p, poly m, poly q, const ring r)
    962 {
     966// like p_Minus_mm_Mult_qq, except that if lp == pLength(lp) lq == pLength(lq)
     967// then result = p-m*q, lp == pLength(result), last == pLast(result)
     968static inline poly p_Minus_mm_Mult_qq(poly p, const poly m, const poly q, int &lp, int lq,
     969                                 const poly spNoether, poly& last, const ring r)
     970{
     971  int l;
    963972#ifdef HAVE_PLURAL
    964973  if (rIsPluralRing(r))
    965974  {
     975    p = nc_p_Minus_mm_Mult_qq(p, m, q, lp, lq, spNoether, r);
     976    last = p_Last(p, l, r);
     977    assume( lp == l );
     978    assume( lp == pLength(p) );
     979    return p;
     980  }
     981#endif
     982
     983  int shorter;
     984  const poly res = r->p_Procs->p_Minus_mm_Mult_qq(p, m, q, shorter, spNoether, r, last);
     985  lp = (lp + lq) - shorter;
     986  assume( last == p_Last(res, l, r) );
     987  assume( lp == l );
     988  assume( lp == pLength(res) );
     989  return res;
     990}
     991
     992
     993// like p_Minus_mm_Mult_qq (above) but without last
     994static inline poly p_Minus_mm_Mult_qq(poly p, const poly m, const poly q, int &lp, int lq,
     995                                      const poly spNoether, const ring r)
     996{
     997#ifdef HAVE_PLURAL
     998  if (rIsPluralRing(r))
     999  {
     1000    p = nc_p_Minus_mm_Mult_qq(p, m, q, lp, lq, spNoether, r);
     1001    assume( lp == pLength(p) );
     1002    return p;
     1003  }
     1004#endif
     1005
     1006  int shorter; poly last;
     1007  const poly res = r->p_Procs->p_Minus_mm_Mult_qq(p, m, q, shorter, spNoether, r, last);
     1008  lp += lq - shorter;
     1009  assume( lp == pLength(res) );
     1010  return res;
     1011}
     1012
     1013// return p - m*Copy(q), destroys p; const: p,m
     1014static inline poly p_Minus_mm_Mult_qq(poly p, const poly m, const poly q, const ring r)
     1015{
     1016#ifdef HAVE_PLURAL
     1017  if (rIsPluralRing(r))
     1018  {
    9661019    int lp, lq = 0;
    9671020    return nc_p_Minus_mm_Mult_qq(p, m, q, lp, lq, NULL, r);
     
    9751028}
    9761029
    977 // like p_Minus_mm_Mult_qq, except that if lp == pLength(lp) lq == pLength(lq)
    978 // then lp == pLength(p -m*q)
    979 static inline poly p_Minus_mm_Mult_qq(poly p, poly m, poly q, int &lp, int lq,
    980                                  poly spNoether, const ring r)
    981 {
    982 #ifdef HAVE_PLURAL
    983   if (rIsPluralRing(r))
    984      return nc_p_Minus_mm_Mult_qq(p, m, q, lp, lq, spNoether, r);
    985 #endif
    986 
    987   int shorter;
    988   poly last,res;
    989   res = r->p_Procs->p_Minus_mm_Mult_qq(p, m, q, shorter, spNoether, r, last);
    990   lp = (lp + lq) - shorter;
    991   return res;
    992 }
    9931030
    9941031// returns p*Coeff(m) for such monomials pm of p, for which m is divisble by pm
     
    19251962
    19261963/*----------------------------------------------------*/
    1927 // returns the length of a polynomial (numbers of monomials) and the last mon.
    1928 // respect syzComp
    1929 poly p_Last(poly a, int &l, const ring r);
    1930 
    19311964/// shifts components of the vector p by i
    19321965void p_Shift (poly * p,int i, const ring r);
Note: See TracChangeset for help on using the changeset viewer.