Documentation of 'edu.jas.arith.PrimeList' Java class
PrimeList
edu.jas.arith

Class PrimeList

  • All Implemented Interfaces:
    java.lang.Iterable<java.math.BigInteger>


    public final class PrimeList
    extends java.lang.Object
    implements java.lang.Iterable<java.math.BigInteger>
    List of big primes. Provides an Iterator for generating prime numbers. Similar to ALDES/SAC2 SACPOL.PRIME list.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class and Description
      static class  PrimeList.Range
      Range of probable primes.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.math.BigInteger get(int i)
      get prime at index i.
      static java.math.BigInteger getLongPrime(int n, int m)
      Method to compute a prime as 2**n - m.
      static java.math.BigInteger getMersennePrime(int n)
      Method to compute a Mersenne prime as 2**n - 1.
      java.util.Iterator<java.math.BigInteger> iterator()
      Iterator.
      int size()
      size of current list.
      java.lang.String toString()
      toString.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • PrimeList

        public PrimeList()
        Constructor for PrimeList.
      • PrimeList

        public PrimeList(PrimeList.Range r)
        Constructor for PrimeList.
        Parameters:
        r - size range for primes.
    • Method Detail

      • getLongPrime

        public static java.math.BigInteger getLongPrime(int n,
                                                        int m)
        Method to compute a prime as 2**n - m.
        Parameters:
        n - power for 2.
        m - for 2**n - m.
        Returns:
        2**n - m
      • getMersennePrime

        public static java.math.BigInteger getMersennePrime(int n)
        Method to compute a Mersenne prime as 2**n - 1.
        Parameters:
        n - power for 2.
        Returns:
        2**n - 1
      • toString

        public java.lang.String toString()
        toString.
        Overrides:
        toString in class java.lang.Object
      • size

        public int size()
        size of current list.
      • get

        public java.math.BigInteger get(int i)
        get prime at index i.
      • iterator

        public java.util.Iterator<java.math.BigInteger> iterator()
        Iterator.
        Specified by:
        iterator in interface java.lang.Iterable<java.math.BigInteger>

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.