메소드 | 설명 | |
---|---|---|
DividePrimeFactors ( IList |
Given two integers expressed as a list of prime factors, divides these numbers and returns an integer also expressed as a set of prime factors. If the result is not a integer, then the result is undefined. That is, 11 / 5 when divided by this function will not yield a correct result. As such, this function is ONLY useful for division with combinatorial results where the result is known to be an integer AND the division occurs as the last operation(s).
|
|
EvaluatePrimeFactors ( IList |
Given a list of prime factors returns the long representation.
|
|
Factor ( int i ) : List |
Performs a prime factorization of a given integer using the table of primes in PrimeTable. Since this will only factor Int32 sized integers, a simple list of factors is returned instead of the more scalable, but more difficult to consume, list of primes and associated exponents.
|
|
MultiplyPrimeFactors ( IList |
Given two integers expressed as a list of prime factors, multiplies these numbers together and returns an integer also expressed as a set of prime factors. This allows multiplication to overflow well beyond a Int64 if necessary.
|
메소드 | 설명 | |
---|---|---|
CalculatePrimes ( ) : void |
Calculate all primes up to Sqrt(2^32) = 2^16. This table will be large enough for all factorizations for Int32's. Small tables are best built using the Sieve Of Eratosthenes, Reference: http://primes.utm.edu/glossary/page.php?sort=SieveOfEratosthenes
|
|
SmallPrimeUtility ( ) : System.Collections.Generic |
Utility class, no instances allowed.
|
public static DividePrimeFactors ( IList |
||
numerator | IList |
Numerator argument, expressed as list of prime factors. |
denominator | IList |
Denominator argument, expressed as list of prime factors. |
리턴 | List |
public static EvaluatePrimeFactors ( IList |
||
value | IList |
Integer, expressed as list of prime factors. |
리턴 | long |
public static Factor ( int i ) : List |
||
i | int | The number to factorize, must be positive. |
리턴 | List |
public static MultiplyPrimeFactors ( IList |
||
lhs | IList |
Left Hand Side argument, expressed as list of prime factors. |
rhs | IList |
Right Hand Side argument, expressed as list of prime factors. |
리턴 | List |