Skip to content

Commit

Permalink
Minor changes to p_Lcm for (module) monomials
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleksandr Motsak committed Oct 5, 2012
1 parent 095dee7 commit f7a3f2c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
12 changes: 4 additions & 8 deletions libpolys/polys/monomials/p_polys.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1482,16 +1482,12 @@ BOOLEAN p_DivisibleByRingCase(poly f, poly g, const ring r)
}
#endif

/*2
* returns the LCM of the head terms of a and b in *m
*/
void p_Lcm(poly a, poly b, poly m, const ring r)
// returns the LCM of the head terms of a and b in *m
void p_Lcm(const poly a, const poly b, poly m, const ring r)
{
int i;
for (i=rVar(r); i; i--)
{
for (int i=rVar(r); i; --i)
p_SetExp(m,i, si_max( p_GetExp(a,i,r), p_GetExp(b,i,r)),r);
}

p_SetComp(m, si_max(p_GetComp(a,r), p_GetComp(b,r)),r);
/* Don't do a pSetm here, otherwise hres/lres chockes */
}
Expand Down
5 changes: 4 additions & 1 deletion libpolys/polys/monomials/p_polys.h
Original file line number Diff line number Diff line change
Expand Up @@ -1816,7 +1816,10 @@ const char * p_Read(const char *s, poly &p,const ring r); /* monom -> poly */
poly p_Divide(poly a, poly b, const ring r);
poly p_DivideM(poly a, poly b, const ring r);
poly p_Div_nn(poly p, const number n, const ring r);
void p_Lcm(poly a, poly b, poly m, const ring r);

// returns the LCM of the head terms of a and b in *m
void p_Lcm(const poly a, const poly b, poly m, const ring r);

poly p_Diff(poly a, int k, const ring r);
poly p_DiffOp(poly a, poly b,BOOLEAN multiply, const ring r);
int p_Weight(int c, const ring r);
Expand Down

0 comments on commit f7a3f2c

Please sign in to comment.