Changeset e69b7c in git


Ignore:
Timestamp:
Mar 10, 2011, 1:24:53 PM (12 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
Children:
6f43a604effeab2d302d92bcbe3e726674616371
Parents:
f47f569bdf07891fa2a30df0f1c5315e6fe1f5d1
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2011-03-10 13:24:53+01:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 12:01:05+01:00
Message:
fixes for p_Mult_q.cc (buckets still missing)
Location:
libpolys
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • libpolys/coeffs/coeffs.h

    rf47f56 re69b7c  
    240240}
    241241
     242/// returns true for coeffs being a domain
     243static inline bool nField_is_Domain(const coeffs r)
     244{
     245#ifdef HAVE_RINGS
     246  return (r->ringtype == 4 || r->ringtype == 0);
     247#else
     248  return true;
     249#endif
     250}
     251
     252
    242253static inline int nInternalChar(const coeffs r)
    243254{
  • libpolys/coeffs/longrat.cc

    rf47f56 re69b7c  
    13371337
    13381338// copy not immediate number a
    1339 number _nlCopy_NoImm(number a, const coeffs r)
     1339number _nlCopy_NoImm(number a)
    13401340{
    13411341  assume(!((SR_HDL(a) & SR_INT)||(a==NULL)));
    1342   nlTest(a, r);
     1342  //nlTest(a, r);
    13431343  number b=ALLOC_RNUMBER();
    13441344#if defined(LDEBUG)
     
    13551355  }
    13561356  b->s = a->s;
    1357   nlTest(b, r);
    13581357  return b;
    13591358}
     
    13771376}
    13781377
    1379 number _nlNeg_NoImm(number a, const coeffs r)
     1378number _nlNeg_NoImm(number a)
    13801379{
    13811380  {
     
    13901389}
    13911390
    1392 number _nlAdd_aNoImm_OR_bNoImm(number a, number b, const coeffs r)
     1391number _nlAdd_aNoImm_OR_bNoImm(number a, number b)
    13931392{
    13941393  number u=ALLOC_RNUMBER();
     
    15571556}
    15581557
    1559 number _nlSub_aNoImm_OR_bNoImm(number a, number b, const coeffs r)
     1558number _nlSub_aNoImm_OR_bNoImm(number a, number b)
    15601559{
    15611560  number u=ALLOC_RNUMBER();
     
    17821781
    17831782// a and b are intermediate, but a*b not
    1784 number _nlMult_aImm_bImm_rNoImm(number a, number b, const coeffs r)
     1783number _nlMult_aImm_bImm_rNoImm(number a, number b)
    17851784{
    17861785  number u=ALLOC_RNUMBER();
     
    17961795
    17971796// a or b are not immediate
    1798 number _nlMult_aNoImm_OR_bNoImm(number a, number b, const coeffs r)
     1797number _nlMult_aNoImm_OR_bNoImm(number a, number b)
    17991798{
    18001799  assume(! (SR_HDL(a) & SR_HDL(b) & SR_INT));
     
    19101909    return a;
    19111910  }
    1912   return _nlCopy_NoImm(a, src); // dst?
     1911  return _nlCopy_NoImm(a);
    19131912}
    19141913
     
    20632062    return a;
    20642063  }
    2065   return _nlCopy_NoImm(a, r);
     2064  return _nlCopy_NoImm(a);
    20662065}
    20672066
     
    20862085* za:= - za
    20872086*/
    2088 LINLINE number nlNeg (number a, const coeffs r)
    2089 {
    2090   nlTest(a, r);
     2087LINLINE number nlNeg (number a, const coeffs R)
     2088{
     2089  nlTest(a, R);
    20912090  if(SR_HDL(a) &SR_INT)
    20922091  {
     
    20962095    return a;
    20972096  }
    2098   return _nlNeg_NoImm(a, r);
     2097  return _nlNeg_NoImm(a);
    20992098}
    21002099
     
    21022101* u:= a + b
    21032102*/
    2104 LINLINE number nlAdd (number a, number b, const coeffs r)
     2103LINLINE number nlAdd (number a, number b, const coeffs R)
    21052104{
    21062105  number u;
     
    21132112      return nlRInit(SR_TO_INT(r));
    21142113  }
    2115   return _nlAdd_aNoImm_OR_bNoImm(a, b, r);
     2114  return _nlAdd_aNoImm_OR_bNoImm(a, b);
    21162115}
    21172116
     
    22852284      return nlRInit(SR_HDL(u)>>2);
    22862285    }
    2287     return _nlMult_aImm_bImm_rNoImm(a, b, R);
    2288   }
    2289   return _nlMult_aNoImm_OR_bNoImm(a, b, R);
     2286    return _nlMult_aImm_bImm_rNoImm(a, b);
     2287  }
     2288  return _nlMult_aNoImm_OR_bNoImm(a, b);
    22902289}
    22912290
     
    23062305      return nlRInit(SR_TO_INT(r));
    23072306  }
    2308   return _nlSub_aNoImm_OR_bNoImm(a, b, r);
     2307  return _nlSub_aNoImm_OR_bNoImm(a, b);
    23092308}
    23102309
  • libpolys/polys/operations/p_Mult_q.cc

    rf47f56 re69b7c  
    1717 * Assumes: pLength(p) >= 2 pLength(q) >=2
    1818 ***************************************************************/
    19 // #include <polys/options.h>
     19#include <misc/options.h>
    2020#include <polys/monomials/p_polys.h>
    2121#include <polys/templates/p_Procs.h>
     
    129129  Equal:
    130130  n1 = pGetCoeff(rn);
    131   n = n_Add(n1, pGetCoeff(qn), r);
    132   n_Delete(&n1, r);
    133   if (n_IsZero(n, r))
    134   {
    135     n_Delete(&n, r);
     131  n = n_Add(n1, pGetCoeff(qn), r->cf);
     132  n_Delete(&n1, r->cf);
     133  if (n_IsZero(n, r->cf))
     134  {
     135    n_Delete(&n, r->cf);
    136136    p_LmFree(rn, r);
    137137  }
     
    142142  }
    143143  rn = kBucketExtractLm(bucket);
    144   n_Delete(&pGetCoeff(qn),r);
     144  n_Delete(&pGetCoeff(qn),r->cf);
    145145  qn = p_LmFreeAndNext(qn, r);
    146146  goto Work;
     
    193193  assume(p != NULL && pNext(p) != NULL && q != NULL && pNext(q) != NULL);
    194194#ifdef HAVE_RINGS
    195   assume(rField_is_Domain(r));
     195  assume(nField_is_Domain(r->cf));
    196196#endif
    197197  pAssume1(! pHaveCommonMonoms(p, q));
     
    239239  Equal:
    240240  n1 = pGetCoeff(rn);
    241   n = n_Add(n1, pGetCoeff(qn), r);
    242   n_Delete(&n1, r);
    243   if (n_IsZero(n, r))
    244   {
    245     n_Delete(&n, r);
     241  n = n_Add(n1, pGetCoeff(qn), r->cf);
     242  n_Delete(&n1, r->cf);
     243  if (n_IsZero(n, r->cf))
     244  {
     245    n_Delete(&n, r->cf);
    246246    rn = p_LmFreeAndNext(rn, r);
    247247  }
     
    252252    pIter(rn);
    253253  }
    254   n_Delete(&pGetCoeff(qn),r);
     254  n_Delete(&pGetCoeff(qn),r->cf);
    255255  qn = p_LmFreeAndNext(qn, r);
    256256  goto Work;
     
    270270{
    271271#ifdef HAVE_RINGS
    272   if (!rField_is_Domain(currRing))
     272  if (!nField_is_Domain(r->cf))
    273273    return _p_Mult_q_Normal_ZeroDiv(p, q, copy, r);
    274274#endif
  • libpolys/polys/templates/p_Numbers.h

    rf47f56 re69b7c  
    2323
    2424static inline number n_Mult_FieldGeneral(number n1, number n2, const ring r)
    25 { return r->cf->nMult(n1, n2, r->cf); }
     25{ return r->cf->cfMult(n1, n2, r->cf); }
    2626
    2727static inline number n_Add_FieldGeneral(number n1, number n2, const ring r)
    28 { return r->cf->nAdd(n1, n2, r->cf); }
     28{ return r->cf->cfAdd(n1, n2, r->cf); }
    2929
    3030static inline BOOLEAN n_IsZero_FieldGeneral(number n, const ring r)
    31 { return r->cf->nIsZero(n, r->cf); }
     31{ return r->cf->cfIsZero(n, r->cf); }
    3232
    3333static inline BOOLEAN n_Equal_FieldGeneral(number n1, number n2, const ring r)
    34 { return r->cf->nEqual(n1, n2, r->cf); }
     34{ return r->cf->cfEqual(n1, n2, r->cf); }
    3535
    3636static inline number n_Neg_FieldGeneral(number n,     const ring r)
    37 { return r->cf->nNeg(n, r->cf); }
     37{ return r->cf->cfNeg(n, r->cf); }
    3838
    3939static inline number n_Sub_FieldGeneral(number n1, number n2, const ring r)
    40 { return r->cf->nSub(n1, n2, r->cf); }
     40{ return r->cf->cfSub(n1, n2, r->cf); }
    4141
    4242static inline void n_InpMult_FieldGeneral(number &n1, number n2, const ring r)
Note: See TracChangeset for help on using the changeset viewer.