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 void
add(int factor)
Add a factor.void
add(int factor, short power)
Add a factor to the given power.short[]
copyExponents()
int[]
copyFactors()
int
get(int i)
int
getExponent(int i)
void
reset()
reset() must be called before using for a new Q.int
size()
java.lang.String
toString()
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:
toString
in classjava.lang.Object
-