Class DictionaryPrimes
A default selection of prime numbers used with different collections.
Inheritance
System.Object
DictionaryPrimes
Namespace: GDX.Collections.Generic
Syntax
public static class DictionaryPrimes
Methods
| Improve this Doc View SourceGetNextSize(Int32)
Returns size of hashtable to grow to.
Declaration
public static int GetNextSize(int oldSize)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | oldSize |
Returns
Type | Description |
---|---|
System.Int32 |
GetPrime(Int32)
Get the nearest prime number greater then or equal to the provided minimum
.
Declaration
public static int GetPrime(int minimum)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | minimum | The lowest possible value. |
Returns
Type | Description |
---|---|
System.Int32 | A prime number. |
GetPrimeAtIndex(Int32)
Get the prime number in GDX.Collections.Generic.DictionaryPrimes.s_Primes at index.
Declaration
public static int GetPrimeAtIndex(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The valid array index requested. |
Returns
Type | Description |
---|---|
System.Int32 | A prime number. |
Remarks
No out of bounds detection.
GetPrimesLength()
Get the number of prime numbers
Declaration
public static int GetPrimesLength()
Returns
Type | Description |
---|---|
System.Int32 |
SetDefaultPrimes()
Establish the default prime numbers in GDX.Collections.Generic.DictionaryPrimes.s_Primes.
Declaration
public static void SetDefaultPrimes()
SetPrimes(Int32[])
Set the GDX.Collections.Generic.DictionaryPrimes.s_Primes array with the provided primes
.
Declaration
public static void SetPrimes(int[] primes)
Parameters
Type | Name | Description |
---|---|---|
System.Int32[] | primes | An array of prime numbers. |