Coder Social home page Coder Social logo

brainstone / truncateableprimes Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 254 KB

A C++ program that calculates left and right truncatable primes

License: GNU General Public License v3.0

Shell 7.67% Groovy 21.11% C++ 71.22%
cpp cpp14 prime-numbers mathematics mathematical-modelling gradle

truncateableprimes's Introduction

TruncateablePrimes Build Status

TruncateablePrimes is a project designed to calculate left and right truncatable primes in C++.

Inspired by https://www.youtube.com/watch?v=azL5ehbw_24

Contributions are always welcome!

Cloning

Since this repo is recursive, you need to clone it recursively

$ git clone --recursive https://github.com/BrainStone/TruncateablePrimes.git

If you forgot to do that, you can download the submodules later by running

$ git submodule update --init --recursive

Hooks

This repo also provides a few simple hooks to make working with submodules easier. While it is not necessary to do this step, it is recommended.

$ cp -va .hooks/* .git/hooks/

Building

This project uses gradle for building. The nice thing about gradle is that you only need to have Java (and a C++ compiler of your choice) installed.
Building is super straight forward:

$ ./gradlew build

This will build the project and all its dependencies.

Compiler version

For this project to build properly, you need an up to date version of your compiler:

Compiler Required Version
Clang 3.4+
GCC 5+ (4.9 might work)
Visual Studio 2015+

(If you find that it compiles on different versions than stated here, open an issue stating on which compiler version it compiled successfully. (Including the tests!))

MPIR

This program depends on the MPIR library (libmpir) and its C++ Wrapper (libmpirxx). Due to the complexity I cannot include MPIR here directly.

You sadly need to build it yourself. Downloads can be found here: http://mpir.org/downloads.html
Be sure to use the version 3.0.0. Building instructions can be found in the documentation.

In general you have three options:

  • Recommended (for Unix): Run the provided ./build-mpir.sh script.
    For most cases the invocation ./build-mpir.sh -t is the best choice.
    Run ./build-mpir.sh -h to get an overview and explanation of all flags.
  • Install it system wide. The library files should be in /usr/local/lib/ (Unix only)
  • Provide the files yourself:
    • Put the mpir.h and mpirxx.h in the lib/mpir/include dir
    • Put the library files in the lib/mpir/lib dir (libmpir.a and libmpirxx.a on Linux and OSX, mpir.lib and mpirxx.lib on Windows)

Documentation

This project comes with a Doxyfile. You can either generate the documentation manually by using Doxygen from the command line, or by running this gradle task:

$ ./gradlew doc

License

This is project is licensed under the GPLv3 license.

Projects included in this project through submodules or other means are licensed under their respective licenses.

truncateableprimes's People

Contributors

brainstone avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.