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 initialize a 3x3 matrix and find it's 1000-th power. In gp (the CLI), this could be achieved just by typing something like:
? A=[1,2,3;4,5,6;7,8,9]
? A^1000
but I found no help about doing this quiet simple thing in a C source file. Is there a comprehensive tutorial, or a documentation that provides such examples? Any comment will be extremely appreciated!
This is covered in the manual libpari ("User's Guide to the PARI library"). An easy way to use it for simple cases is to save the associated GP script and run
gp2c -g
on it, which will produce a C file doing the calculations with the PARI library. You can then edit to suit your tastes.For this particular case: