A parallelized prime number generator written in Rust.
Go to file
Nicolás A. Ortega Froysa 80f9cc855d Forgot to add one to `pp` in parallel implementation. 2022-03-09 17:30:51 +01:00
src Forgot to add one to `pp` in parallel implementation. 2022-03-09 17:30:51 +01:00
.gitignore Initial commit. 2021-02-26 17:58:58 +01:00
.gitlab-ci.yml Add license scanning again. 2022-03-01 18:59:38 +01:00
Cargo.lock Add rayon for parallelization. 2022-03-04 15:22:48 +01:00
Cargo.toml Add rayon for parallelization. 2022-03-04 15:22:48 +01:00
LICENSE Added license file. 2021-03-01 16:18:34 +01:00
README.md Use markdown for README. 2022-03-04 17:06:39 +01:00
TODO Will probably use normal threading. 2021-05-10 18:46:05 +02:00
indivisible.1 Added 'test' option to man page. 2021-05-19 17:15:57 +02:00
install Install and uninstall scripts. 2021-03-03 18:54:12 +01:00
test.sh Add test stage to CI. 2022-03-01 18:42:10 +01:00
uninstall Install and uninstall scripts. 2021-03-03 18:54:12 +01:00

README.md

Indivisible

Indivisible is an optimized prime number generator and tester written in Rust.

Build & Installation

To build the project you will require the Rust compiler and build system, cargo. At which point you simply run cargo build in the root directory of the project. To create an optimized release build append the --release flag to the previous command.

Once a release build has been compiled, you may install Indivisible and the manpage documentation by running the install script. In a similar manner, you can run the uninstall script to remove the previously installed binary and documentation.

Usage

The purpose of Indivisible is to find the nth prime and all the primes before it. The basic usage is indivisible <n> where n is the ordinal of the prime you'd like to find. To display all primes before n, you can run verbose mode by using the --verbose or simply -v option.

Since Indivisible generates primes using previously computed primes, you can also import prime numbers previously computed with the --import or -i option. To store already computed primes you are expected to use piping like any UNIX user would expect. Here is an example:

# store first 100 primes in ./primes
indivisible -v 100 > ./primes
# appends next 400 primes
indivisible -i ./primes -v 500 >> ./primes
# display the 600th prime
indivisible -i ./primes 600

Legacy

This project was originally written in C. It can be found in the indivisible-legacy repository on my GitLab.

License

This project is licensed under the terms & conditions of the GNU General Public License version 3 or greater (see LICENSE file for more information).