Class CycleCounter2LP
java.lang.Object
de.tilman_neumann.jml.factor.base.congruence.CycleCounter2LP
- All Implemented Interfaces:
CycleCounter
public class CycleCounter2LP extends java.lang.Object implements CycleCounter
Cycle counting algorithm implementation for two large primes, following [LM94].
The algorithm is exact for partials with 2 large primes.
-
Constructor Summary
Constructors Constructor Description CycleCounter2LP()
-
Method Summary
Modifier and Type Method Description int
addPartial(Partial partial, int correctSmoothCount)
Counts the number of independent cycles in the partial relations.int
getCycleCount()
java.util.HashSet<Partial>
getPartialRelations()
int
getPartialRelationsCount()
void
initializeForN()
Initialize this cycle counter for a new factor argument.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
CycleCounter2LP
public CycleCounter2LP()
-
-
Method Details
-
initializeForN
public void initializeForN()Description copied from interface:CycleCounter
Initialize this cycle counter for a new factor argument.- Specified by:
initializeForN
in interfaceCycleCounter
-
addPartial
Description copied from interface:CycleCounter
Counts the number of independent cycles in the partial relations.- Specified by:
addPartial
in interfaceCycleCounter
- Parameters:
partial
- the newest partial relation to addcorrectSmoothCount
- the correct number of smooths from partials (only for debugging)- Returns:
- the updated number of smooths from partials
-
getPartialRelations
- Specified by:
getPartialRelations
in interfaceCycleCounter
- Returns:
- the partial relations found so far
-
getPartialRelationsCount
public int getPartialRelationsCount()- Specified by:
getPartialRelationsCount
in interfaceCycleCounter
- Returns:
- number of partial relations found so far.
-
getCycleCount
public int getCycleCount()- Specified by:
getCycleCount
in interfaceCycleCounter
- Returns:
- the number of cycles counted by this algorithm
-