Questions tagged [pari]

a C library targeted at number theorists and mathematicians allowing fast number-theoretic computations (factorizations, algebraic number theory, elliptic curves...), also including routines for computing with matrices, polynomials, power series, algebraic numbers etc.

This tag is for the C-library PARI. See for the scripting language GP and associated computer algebra system PARI/GP. Questions with this tag should generally also have the tag.

118 questions
7
votes
1 answer

How to use PARI C library

I have already searched for some tutorial on how to use the PARI library in a C program, but unfortunatelly I found nothing but generic tutorials of using the GP package in command line interface. Could anyone help? For instance, I would like to…
nullgeppetto
  • 539
  • 1
  • 8
  • 25
5
votes
1 answer

Python Pari Library?

Pari/GP is an excellent library for functions relating to number theory. The problem is that there doesn't seem to be an up to date wrapper for python anywhere around, (pari-python uses an old version of pari) and I'm wondering if anyone knows of…
user300330
3
votes
2 answers

Identify loops over a vector of indices; make list, minus rotations

I work with vectors of natural numbers of length N and sum-of-entries S, for instance, with (N,S)=(4,7) one example vector E=[1,2,1,3] where all entries in the vector are assumed > 0. I want to list all vectors with the same configuration…
3
votes
1 answer

Using PARI library for C

I've got all the source code for PARI, but i'm not sure how to use it/generate the pari library. Up to now, i've had to add a couple header files for things such as complex numbers using #include , so I figure it is the same idea for…
Chris
  • 67
  • 3
3
votes
2 answers

Is there a comfortable way to generate the combinations k out of n in PARI/GP?

Suppose, I have a vector in PARI/GP with n elements. I want to generate the combinations k out of n elements. For example, if the vector is [3,7,11,14,18] and k=3, the output should…
Peter
  • 214
  • 1
  • 10
3
votes
1 answer

Pari/GP: the user defined function as a return value

I have a problem with Pari/GP user defined functions making use of user defined functions returning functions. Here is a dumbed-down example: ? f(x) = { (t) -> x + t } %1 = (x)->(t)->x+t ? g(x) = { local(y); y = f(x); (t) -> y(t) } %2 =…
Alexander Klauer
  • 957
  • 11
  • 18
3
votes
1 answer

Doxygen: how to document a non-C function using only its documentation block but not the code?

I want Doxygen to document the code written in C-like language (PARI/GP) but having slightly different syntax. I believe Doxygen can document the entities those do not exist. It seems to be the simplest way to do the job while the programming…
Piotr Semenov
  • 1,761
  • 16
  • 24
2
votes
1 answer

How to calculate the Modular multiplicative inverse in pari?

The modular multiplicative inverse is an integer ‘x’ such that. a x ≡ 1 (mod m). So, is there any way to calculate the Modular multiplicative inverse in pari\gp calculator ? I am really sorry if this question is trivial or duplicated.
2
votes
1 answer

Simple way to request a factorization over the Gaussians

I work in the Gaussian integers and use factor on them with success. However, occasionally the imaginary part can vanish, but I still want a factorization in the Gaussian integers. As an example, the program for(j=-3, 3, print(j,":…
Jeppe Stig Nielsen
  • 60,409
  • 11
  • 110
  • 181
2
votes
1 answer

Sending a Polynomial to PARI/GP from Python (ctypes)

I would like to call nfroots({nf}; x) function of PARI/GP from Python. (see function no 3.13.135.on page 371 in this link:), but the probllem is, I couldn't send the algebraic expression or the polynomial, that need to be send, for example,…
2
votes
1 answer

Plotting multiple lists in Pari

I have two (pairs of) lists which I want to plot. I know, that I can plot each separably, using the plothraw function. But how can I plot them in the same picture, such that I end up with two curves in different colours?
klirk
  • 127
  • 4
2
votes
1 answer

Function to find the least prime factor

Does PARI/GP have a function for finding the smallest prime factor of a t_INT or otherwise perform a partial factorization of an integer? For example, if I have the…
Jeppe Stig Nielsen
  • 60,409
  • 11
  • 110
  • 181
2
votes
1 answer

How to construct fields in bnfinit()?

I am new to PARI/GP, learning about different number fields. I am trying to construct the field k = Q(\zeta_23) using bnfinit (23rd cyclotomic field) to run the following script: v=[]; w=[]; j=0; l=0; forprime(p=29, 100000, { if(p%46==1, j++;…
J. Linne
  • 275
  • 4
  • 15
2
votes
0 answers

Pari compatibility with C++ classes

I'm writing a program using Pari and used classes to code conveniently, but it seems that Pari is not compatible with C++ classes. I made a class that had a GEN variable and initialized it using the constructor. Every time I try to access that…
AdveRSAry
  • 187
  • 7
2
votes
0 answers

Compiling with a multi-precision math library in C using Code::Blocks on Windows

I'm having a lot of trouble figuring out how to do this. I need an arbitrary precision library for math in C. I'm good with either CLN or PARI/GP, both of which I've installed. I'm using Windows, so I had to do this via Cygwin, and ran the…
Chris
  • 67
  • 3
1
2 3 4 5 6 7 8