Got a PrimeFactorization method working but my first try is kinda slow, because it's pretty bute force-ish
//This works but is a little slow
// while(!IntUtils.IsPrime(number))
// {
// foreach(var p in primes)
// {
// if(number % p == 0)
// {
// yield return p;
// number /= p;
// break;
// }
// }
// }
I'm learning CUDA (and C to some extent), and one of the algorithms that I am learning is the Hillis-Steele scan algorithm. I wrote a program that performs a simple scan with adding.
I don't really care that the random number generation is in serial; this is just educational.
#include "cuda_run...
Below is my implementation of Pollard's rho algorithm for prime factorization:
#include <vector>
#include <queue>
#include <gmpxx.h>
// Interface to the GMP random number functions.
gmp_randclass rng(gmp_randinit_default);
// Returns a divisor of N using Pollard's rho method.
mpz_class getDiv...
Here is an implementation of the naive Pollard rho algorithm. Works well for small ish numbers. So numbers less than about 1000036317378699858851366323.
I've created an application that uses a cmd interface. It has multiple levels, and the number of available commands and their complexity is growing. As such, I need to generalise argument parsing - of the line parameter.
I like argparse - I've previously used it a few times for its 'intended' p...
@Phrancis Yeah. You can read about the RSA algorithm if you want. Basically if you want to decode the message you would have to factor really big primes.