Class SortedIntegerArray


  • public class SortedIntegerArray
    extends Object
    A reused buffer to store small factors temporarily during trial division.
    Author:
    Tilman Neumann
    • Constructor Detail

      • SortedIntegerArray

        public SortedIntegerArray()
    • Method Detail

      • 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()