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

◆ operator+=() [1/2]

template<typename MonomType>
const Polynom< MonomType > & BIBasis::Polynom< MonomType >::operator+= ( const MonomType & newMonom)

Definition at line 264 of file polynom.hpp.

265 {
266 MonomType** position = const_cast<MonomType**>(Find(newMonom));
267 MonomType* tmpMonom = 0;
268
269 if (!position)
270 {
272 tmpMonom->Next = MonomListHead;
274 }
275 else
276 {
277 if (*position && **position == newMonom)
278 {
280 *position = (*position)->Next;
281 delete tmpMonom;
282 }
283 else
284 {
286 tmpMonom->Next = (*position)->Next;
287 (*position)->Next = tmpMonom;
288 }
289 }
290
291 return *this;
292 }
MonomType * MonomListHead
Definition polynom.hpp:53
const MonomType *const * Find(const MonomType &monom) const
Definition polynom.hpp:662

References Find(), MonomListHead, operator+=(), and Polynom().

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