class
FactorHeap extends AnyRef
Instance Constructors
-
new
FactorHeap()
Value Members
-
final
def
!=(arg0: AnyRef): Boolean
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
def
+=(factor: Factor): Unit
-
final
def
==(arg0: AnyRef): Boolean
-
final
def
==(arg0: Any): Boolean
-
final
def
asInstanceOf[T0]: T0
-
def
clone(): AnyRef
-
def
dequeue(): Factor
-
final
def
eq(arg0: AnyRef): Boolean
-
def
equals(arg0: Any): Boolean
-
def
finalize(): Unit
-
final
def
getClass(): Class[_]
-
def
hashCode(): Int
-
def
isEmpty: Boolean
-
final
def
isInstanceOf[T0]: Boolean
-
final
def
ne(arg0: AnyRef): Boolean
-
def
nonEmpty: Boolean
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
def
resizeIfNecessary(): Unit
-
def
size: Int
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
def
toString(): String
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
Inherited from AnyRef
Inherited from Any
Simple heap implementation for storing Factors.
The heap can hold at most ~2B items, which means we can't store more than this many prime factors.
Note that "fast factors" don't end up in this heap, so the number of primes we can sieve is actaully the max heap size + the number of fast factors.
The sieve implementation itself uses a cutoff, so to test primality of numbers <= K, we need to be able to store prime factors up to sqrt(K) in our heap. Since our heap can hold ~2B prime factors, this means the theoretical upper bound on our segmented sieve is (~2Bth prime)^2.
In practice the sieve will slow down to the point of not being useful far before we could reach this limit.