Questions tagged [ntl]

NTL is a high-performance, portable C++ library licensed under GPL providing data structures and algorithms for arbitrary length integers; for vectors, matrices, and polynomials over the integers and over finite fields; and for arbitrary precision floating point arithmetic.

NTL (A Library For Doing Number Theory) is a high-performance, portable C++ library licensed under GPL providing data structures and algorithms for arbitrary length integers; for vectors, matrices, and polynomials over the integers and over finite fields; and for arbitrary precision floating point arithmetic.

See https://libntl.org/ for more details.

81 questions
0
votes
1 answer

Incorrect evaluation of the irreducibility of the polynomial

in my function PolynomialIrreducibility() I'm evaluating if entered polynomial is irreducible or not over GF(prime_number). void PolynomialIrreducibility () { // Enter prime number ZZ prime_number; ZZ_pX polynom; do { cout…
martink
  • 35
  • 5
0
votes
0 answers

Error when initialize NTL vector in a class

In my code, I've used many NTL vector and matrix as class members. Most of the variables can initialize as a zero-length vector or matrix. But the last one (randE), it somehow defaults to a vector with size=4444736032 and fixed. class…
Franky Lau
  • 51
  • 5
0
votes
0 answers

c++ operator overloading: NTL library export/import of a ZZ_pX vector

I'm trying to export and import a NTL vector from type ZZ_pX. After Reading the source code i found this interesting operator functions: istream& operator>>(istream& s, ZZ_pX& x) { NTL_INPUT_CHECK_RET(s, s >> x.rep); x.normalize(); …
azicko
  • 13
  • 3
0
votes
2 answers

How to recompile ntl and gmp libraries with "-fPIC" flag & make HELib as a shared library & undefined reference to func(std::ostream&) error

a C++ code built into a shared library for HELib is using NTL and GMP static library. But it gets following error: /usr/bin/ld: /usr/local/lib/libntl.a(FFT.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared…
4am
  • 105
  • 1
  • 3
  • 11
0
votes
1 answer

How can you check if a polynomial is invertible with NTL?

I've searched for hours and have not found an answer. I am working with polynomials modulo another polynomial (so ZZ_pE objects). When I use the method inv(ZZ_pE poly), the result is either the inverse (if it exists), or the following error message:…
Carlos Vazquez
  • 426
  • 3
  • 9
0
votes
1 answer

What is the standard way to construct a polynomial in NTL?

Specifically, I am trying to construct an polynomial in Z_p[x] modulo another polynomial P, which requires the usage of ZZ_pE. From the NTL library, the constructors for ZZ_pE are ZZ_pE(); // initial value 0 ZZ_pE(const ZZ_pE& a); // copy…
Carlos Vazquez
  • 426
  • 3
  • 9
0
votes
0 answers

Number Theory Library (NTL) on Mac Xcode - c++ - (Undefined symbols for architecture x86_64) Linker error - Apple Mach-O Linker (ld) Error Group

I have used "brew install ntl" on mac. If I use libc++ in Xcode I get the following linking errors: Undefined symbols for architecture x86_64: "_ntl_gcopy(_ntl_gbigint_body*, _ntl_gbigint_body**)", referenced from: NTL::ZZ::operator=(NTL::ZZ&&) in…
0
votes
1 answer

error: no matching function for call to 'function namel'

My final goal is to compute the power of a quadratic ideal which is implemented as struct variables in C using GMP library. I have been given a library(ANTL), which contains generic optimized exponentiations using C++ templates, namespaces and NTL.…
Papa Delta
  • 267
  • 3
  • 12
0
votes
0 answers

Polynomials with real coefficients in NTL

Does anyone know if the NTL library supports polynomials with real number coefficients, such as from the NTL classes RR or xdouble or just regular C++ floats? I'm wanting to do polynomial multiplication for polynomials with real coefficients and…
0
votes
1 answer

How to implement LLL Lattice Reduction in NTL using c++?

I am using C++ to do a research. And I am interested to know how to use the LLL function in NTL to find the shortest vector. My code is as follow; #include #include #include #include using…
Ivan Feng
  • 1
  • 2
0
votes
0 answers

SetDims in NTL is not working

I'm trying to use matrix functions in NTL, mat_ZZ_p . But when I try to set the dimension using SetDims() fucntion, it hangs. It is working for smaller numbers like 5 , 10 etc, But it fails even for 10000. It hangs the whole system. Here is the code…
0
votes
1 answer

Install NTL without root privileges and modify it's build path in makefile

I want to install the HElib library (for which NTL is a dependency) on a remote machine on which I do not have root privileges, i.e. I cannot use "sudo make install" to install NTL. The NTL library is not installed in usr/local as per HElib's…
Radwa Sherif
  • 61
  • 1
  • 9
0
votes
0 answers

Error when trying to use NTL vector

I am trying to use NTL::Vec, but I get this error whenever I want to use SetLength() The c++ code: #include #include int main(int argc, const char * argv[]) { NTL::Vec v; v.SetLength(8); return 0; } The error…
ayman
  • 1
0
votes
1 answer

installing NTL with GMP

The problem I am having is installing NTL with GMP on my mac (Sierra). These are the steps I have taken following this tutorial 1) I downloaded Unix: ntl-10.3.0.tar.gz 2) double clicked file to create the ntl-10.3.0.tar.gz folder in my…
brw59
  • 502
  • 4
  • 19
0
votes
1 answer

Slow down code without using NTL function result

I'm trying to implement some math function like My_AddMod, My_SubMod, My_MulMod, and put the result back to vec_long& - type data result. When I'm calling both function of mine and NTL and using the result of NTL like: long tmpt_My = My_AddMod(long…