Macaulay2 Engine
Loading...
Searching...
No Matches
◆
operator+=()
[2/2]
template<typename MonomType>
const
Polynom
< MonomType > &
BIBasis::Polynom
< MonomType >::operator+=
(
const
Polynom
< MonomType > &
anotherPolynom
)
Definition at line
295
of file
polynom.hpp
.
296
{
297
if
(
anotherPolynom
.
MonomListHead
)
298
{
299
MonomType
**
iterator
= &
MonomListHead
,
300
*
iteratorAnother
=
anotherPolynom
.
MonomListHead
,
301
*
tmpMonom
= 0;
302
303
while
(*
iterator
&&
iteratorAnother
)
304
{
305
switch
((**iterator).Compare(*
iteratorAnother
))
306
{
307
case
-1:
308
tmpMonom
=
new
MonomType
(*
iteratorAnother
);
309
tmpMonom
->Next = *
iterator
;
310
*
iterator
=
tmpMonom
;
311
iterator
= &(
tmpMonom
->Next);
312
iteratorAnother
=
iteratorAnother
->Next;
313
break
;
314
case
0:
315
tmpMonom
= *
iterator
;
316
*
iterator
= (*iterator)->Next;
317
delete
tmpMonom
;
318
iteratorAnother
=
iteratorAnother
->Next;
319
break
;
320
case
1:
321
iterator
= &((*iterator)->Next);
322
break
;
323
}
324
}
325
326
while
(
iteratorAnother
)
327
{
328
*
iterator
=
new
MonomType
(*
iteratorAnother
);
329
iterator
= &((*iterator)->Next);
330
iteratorAnother
=
iteratorAnother
->Next;
331
}
332
}
333
334
return
*
this
;
335
}
BIBasis::Polynom::MonomListHead
MonomType * MonomListHead
Definition
polynom.hpp:53
BIBasis::Polynom
Definition
polynom.hpp:51
References
MonomListHead
,
operator+=()
, and
Polynom()
.
BIBasis
Polynom
Generated on
for Macaulay2 Engine by
1.15.0