@@ -51,7 +51,7 @@ class lar_term {
51
51
return ;
52
52
auto *e = m_coeffs.find_core (j);
53
53
if (e == nullptr ) {
54
- m_coeffs.insert (j, c);
54
+ m_coeffs.insert (j, - c);
55
55
} else {
56
56
e->get_data ().m_value -= c;
57
57
if (e->get_data ().m_value .is_zero ())
@@ -90,6 +90,21 @@ class lar_term {
90
90
}
91
91
// constructors
92
92
lar_term () = default ;
93
+ <<<<<<< HEAD
94
+ =======
95
+ lar_term (lar_term&& other) noexcept = default ;
96
+ // copy assignment operator
97
+ lar_term& operator =(const lar_term& other) = default ;
98
+ // move assignment operator
99
+ lar_term& operator =(lar_term&& other) noexcept = default ;
100
+ ~lar_term () = default ;
101
+ lar_term (const lar_term& a) {
102
+ for (auto const & p : a) {
103
+ add_monomial (p.coeff (), p.var ());
104
+ }
105
+ }
106
+
107
+ >>>>>>> 956229fb6 (test that pivoting is correct in dioph_eq.cpp)
93
108
lar_term (const vector<std::pair<mpq, unsigned >>& coeffs) {
94
109
for (auto const & p : coeffs) {
95
110
add_monomial (p.first , p.second );
@@ -205,7 +220,16 @@ class lar_term {
205
220
}
206
221
return r;
207
222
}
208
-
223
+
224
+ friend lar_term operator -(const lar_term& a, const lar_term& b) {
225
+ lar_term r (a);
226
+ for (const auto & p : b) {
227
+ r.sub_monomial (p.coeff (), p.j ());
228
+ }
229
+ return r;
230
+ }
231
+
232
+
209
233
lar_term& operator +=(const lar_term& a) {
210
234
for (const auto & p : a) {
211
235
add_monomial (p.coeff (), p.j ());
0 commit comments