[−][src]Function reikna::prime::factorize_wp
pub fn factorize_wp(value: u64, primes: &[u64]) -> Vec<u64>
Return a Vec<u64>
of the value's factorization,
using the provided list of primes.
This function preforms factorization by test dividing
value
for all provided primes in [1, value].
This function is best suited for computing multiple
factorizations, so the primes list can be cached between
calls, or for computing factorizations with a custom list
of "prime factors". For other uses, such as factoring a
single value, factorize()
may be a wiser choice.
Examples
Please note this function assumes that primes
is sorted.
use reikna::prime::factorize; assert_eq!(factorize(200), vec![2, 2, 2, 5, 5]);