Documentation of 'org.jquantlib.math.PrimeNumbers' Java class
PrimeNumbers
org.jquantlib.math

Class PrimeNumbers



  • public class PrimeNumbers
    extends java.lang.Object
    This class creates an ArrayList of prime numbers, stored as long. This class is 'bootstrapped', and longs are calculated on demand. Therefore, if a time senstitve aspect of the application requires the quick retrieval of a prime, this array should be pre-fetched and populated before that quick need arises.

    Once a prime has been calculated, it will be stored for the life of the JVM.
    ALGO: The algorithm used from QuantLib is not very efficient, because it skips only multiples of 2, and checks each number after that. really, it could also skip multiples of 3,5,7,etc... In ohter words once a prime has been calculated, you can just skip over that multiple too. // TODO fill in a latex algo for later.
    • Constructor Summary

      Constructors 
      Constructor and Description
      PrimeNumbers() 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      long get(int absoluteIndex) 
      long nextPrimeNumber() 
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PrimeNumbers

        public PrimeNumbers()
    • Method Detail

      • get

        public long get(int absoluteIndex)
      • nextPrimeNumber

        public long nextPrimeNumber()

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.