Class SortedIntegerArray
java.lang.Object
de.tilman_neumann.jml.factor.base.SortedIntegerArray
public class SortedIntegerArray
extends java.lang.Object
A reused buffer to store small factors temporarily during trial division.
-
Constructor Summary
Constructors Constructor Description SortedIntegerArray()SortedIntegerArray(SortedIntegerArray original)Copy constructor. -
Method Summary
Modifier and Type Method Description voidadd(int factor)Add a factor.voidadd(int factor, short power)Add a factor to the given power.short[]copyExponents()int[]copyFactors()intget(int i)intgetExponent(int i)voidreset()reset() must be called before using for a new Q.intsize()java.lang.StringtoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
SortedIntegerArray
public SortedIntegerArray() -
SortedIntegerArray
Copy constructor.- Parameters:
original-
-
-
Method Details
-
reset
public void reset()reset() must be called before using for a new Q. -
add
public void add(int factor)Add a factor.- Parameters:
factor-
-
add
public void add(int factor, short power)Add a factor to the given power.- Parameters:
factor-power-
-
get
public int get(int i)- Parameters:
i-- Returns:
- the i.th entry
-
getExponent
public int getExponent(int i)- Parameters:
i-- Returns:
- the i.th exponent
-
size
public int size() -
copyFactors
public int[] copyFactors() -
copyExponents
public short[] copyExponents() -
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-