2 * @file CriticalPairs.tpp
4 * @author Sebastian Junges
7 #include "CriticalPairs.h"
12 template<template <class> class Datastructure, class Configuration>
13 SPolPair CriticalPairs<Datastructure, Configuration>::pop( )
15 typename Configuration::Entry top = mDatastruct.top( );
16 SPolPair ret = top->getFirst( );
19 //empty, so we remove the top
25 // not empty, get new leading element
26 mDatastruct.decreaseTop( top );
36 template<template <class> class Datastructure, class Configuration>
37 void CriticalPairs<Datastructure, Configuration>::elimMultiples( const Monomial::Arg& lm, const std::unordered_map<size_t, SPolPair>& newpairs )
39 typename Datastructure<Configuration>::const_iterator it( mDatastruct.begin( ) );
40 while( it != mDatastruct.end( ) )
42 auto ps = it.get( )->getPairsBegin( );
44 for( ++ps; ps != it.get( )->getPairsEnd( ); )
46 auto spp1 = newpairs.find(ps->mP1);
47 auto spp2 = newpairs.find(ps->mP2);
49 if( spp1 == newpairs.end( ) )
54 if( spp2 == newpairs.end( ) )
60 const Monomial::Arg & psLcm = ps->mLcm;
61 if( psLcm->divisible( lm ) && psLcm != spp1->second.mLcm && psLcm != spp2->second.mLcm )
63 ps = it.get( )->erase( ps );
70 if( it.get( )->getPairsBegin( ) == it.get( )->getPairsEnd( ) )
72 mDatastruct.popPosition( it );