Macaulay2 Engine
Loading...
Searching...
No Matches

◆ addition()

void BRP::addition ( const BRP & other,
monomials::iterator pos )

Definition at line 27 of file franzi-brp.cpp.

28{
29 // merge m with other.m, while removing doubles
30 monomials::const_iterator it = other.m.begin();
31 monomials::iterator pos_end = m.end();
32 monomials::const_iterator other_end = other.m.end();
33 while (it != other_end && pos != pos_end)
34 {
35 // if ( funccompGRL(*it, *pos) ) {
36 if (*it > *pos)
37 {
38 m.insert(pos, *it);
39 ++it;
40 }
41 else if (*it == *pos)
42 {
43 pos = m.erase(pos);
44 ++it;
45 }
46 else
47 {
48 ++pos;
49 }
50 }
51 if (pos == pos_end)
52 {
53 m.insert(pos, it, other_end);
54 }
55}
monomials m

References BRP(), and m.

Referenced by operator+(), and reduceTail().