Changeset 07ff96 in git


Ignore:
Timestamp:
Dec 5, 2012, 3:28:19 PM (10 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '00e2e9c41af3fde1273eb3633f4c0c7c3db2579d')
Children:
0145f469b68cb4ac35da3518ae5cb1464fbc85a4a07784ce2c96d788165ee1c5046e4e2f60bec8e3f659855c746f8978e0386f9dc2f9d9ecfc3d73b2
Parents:
80d7722e6833c629fe2c07881a5d23b7c4a9b4e4
Message:
optim. multiplication/equality test for algext.cc
Location:
libpolys/polys
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • libpolys/polys/ext_fields/algext.cc

    r80d772 r07ff96  
    299299{
    300300  naTest(a); naTest(b);
    301 
    302301  /// simple tests
    303   if (a == b) return TRUE;
    304   if ((a == NULL) && (b != NULL)) return FALSE;
    305   if ((b == NULL) && (a != NULL)) return FALSE;
    306 
    307   /// deg test
    308   int aDeg = 0;
    309   if (a != NULL) aDeg = p_Totaldegree((poly)a, naRing);
    310   int bDeg = 0;
    311   if (b != NULL) bDeg = p_Totaldegree((poly)b, naRing);
    312   if (aDeg != bDeg) return FALSE;
    313 
    314   /// subtraction test
    315   number c = naSub(a, b, cf);
    316   BOOLEAN result = naIsZero(c, cf);
    317   naDelete(&c, cf);
    318   return result;
     302  if (a == NULL) return (b == NULL);
     303  if (b == NULL) return (a == NULL);
     304  return p_EqualPolys((poly)a,(poly)b,naRing);
    319305}
    320306
     
    516502{
    517503  naTest(a); naTest(b);
    518   if (a == NULL) return NULL;
    519   if (b == NULL) return NULL;
     504  if ((a == NULL)||(b == NULL)) return NULL;
    520505  poly aTimesB = p_Mult_q(p_Copy((poly)a, naRing),
    521506                          p_Copy((poly)b, naRing), naRing);
     507  p_Normalize(aTimesB,naRing);
    522508  definiteReduce(aTimesB, naMinpoly, cf);
    523509  return (number)aTimesB;
  • libpolys/polys/monomials/p_polys.cc

    r80d772 r07ff96  
    15181518    poly t = p_ISet(1, r);
    15191519    number c = n_Div(p_GetCoeff(p, r), divisorLC, r->cf);
     1520    n_Normalize(c,r->cf);
    15201521    p_SetCoeff(t, c, r);
    15211522    int e = p_GetExp(p, 1, r) - divisorLE;
     
    39173918    if (! p_LmEqual(p1, p2,r))
    39183919      return FALSE;
    3919     if (! n_Equal(p_GetCoeff(p1,r), p_GetCoeff(p2,r),r ))
     3920    if (! n_Equal(p_GetCoeff(p1,r), p_GetCoeff(p2,r),r->cf ))
    39203921      return FALSE;
    39213922    pIter(p1);
     
    40024003        return FALSE;
    40034004    }
    4004     if (!n_Equal(p_GetCoeff(p1, r), nn = n_Mult(p_GetCoeff(p2, r),n, r), r))
     4005    if (!n_Equal(p_GetCoeff(p1, r), nn = n_Mult(p_GetCoeff(p2, r),n, r->cf), r->cf))
    40054006    {
    40064007      n_Delete(&n, r);
  • libpolys/polys/nc/old.gring.cc

    r80d772 r07ff96  
    29272927        }
    29282928
    2929         if (!n_Equal(pN, qN, curr)) tmpIsSkewConstant = false;
     2929        if (!n_Equal(pN, qN, curr->cf)) tmpIsSkewConstant = false;
    29302930      }
    29312931
Note: See TracChangeset for help on using the changeset viewer.