Giter Club home page Giter Club logo

class-poly's Introduction

Classpoly

Hilber class polynomial computation in Z or modulo arbitrary integer P using CRT

Sources:

Contents

This repository contains the following libraries:

Original versions are in the branch original. Master contains slightly modified version.

Modifications

The following modifications has been made:

  • Logging to stderr (so output can be used for classpoly output)
  • CLASSPOLY_TEMP defines the temporary directory to use. If undefined, goes by default to $HOME/temp
  • CLASSPOLY_PHI_FILES defines directory with the PHI data files (downloaded from SmallModPolys). If undefined, default is $HOME/phi_files
  • CLASSPOLY_STDOUT=1 means the classpoly outputs the resulting polynomial to stdout instead of writing to the $PWD/H_$D.txt
  • Filename - means stdout

Docker build

$ docker build -t="classpoly" .
$ docker run -i -t classpoly

As described in the classpoly readme, you need to fetch polynomials from https://math.mit.edu/~drew/SmallModPolys and extract it to $HOME/phi_files according to selected invariant (0=Hilbert class, phi_j.tar)

Inside the docker, you can fetch phi_files by calling fetch-jinv.sh for invariant=0.

If you have phi files already downloaded, mount the directory to the image and set env var correspondingly

$ docker build -t="classpoly" .
$ docker run -i --mount type=bind,src=/home/user/phi_files,dst=/usr/local/phi_files -t classpoly
$ export CLASSPOLY_PHI_FILES=/usr/local/phi_files
$ classpoly -19 0
Class polynomial for  D=-19 written to H_19.txt, degree 1, height 20 (20), size 0.000 MB (0.0s)

# For stdout:
$ CLASSPOLY_STDOUT=1 classpoly -19 0 2>/dev/null
I=0
D=-19
884736*X^0 +
1*X^1

Recompiling, or cache busting:

$ docker build -t="classpoly" --build-arg DIR_BUSTER=2.

Build from sources

For build form the original sources:

sudo apt-get install \
        autoconf \
        automake \
        bzip2 \
        ca-certificates \
        curl \
        g++ \
        git \
        libgmp-dev \
        libntl-dev \
        libtool-bin \
        make \
        pkg-config \
        python \
        rsync \
        unzip \
        wget

cd src/

tar -xzvf zn_poly-0.9.tar.gz
cd zn_poly-0.9
./configure
make && make install
cp include/* /usr/local/include/zn_poly/
cd ..

tar -xvf ff_poly_big_v1.2.7.tar
cd ff_poly_big_v1.2.7
make && make install
cp *.h /usr/local/include/ff_poly/
cp ntutil.h /usr/local/include/
cd ..

tar -xvf classpoly_v1.0.2.tar
cd classpoly_v1.0.2
sed -e 's/^\(OBJECTS = \)/\1 prime.o /g' -i makefile
make
mkdir $HOME/temp

class-poly's People

Contributors

ph4r05 avatar mistsuu 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.