{-# LINE 1 "src/Data/Number/Flint/Fq/FFI.hsc" #-}
module Data.Number.Flint.Fq.FFI (
Fq (..)
, CFq (..)
, newFq
, withFq
, withNewFq
, FqCtx (..)
, CFqCtx (..)
, newFqCtx
, withFqCtx
, withNewFqCtx
, newFqCtxConway
, withNewFqCtxConway
, newFqCtxModulus
, withNewFqCtxModulus
, fq_ctx_init
, _fq_ctx_init_conway
, fq_ctx_init_conway
, fq_ctx_init_modulus
, fq_ctx_clear
, fq_ctx_modulus
, fq_ctx_degree
, fq_ctx_prime
, fq_ctx_order
, fq_ctx_get_str
, fq_ctx_fprint
, fq_ctx_print
, fq_ctx_randtest
, fq_ctx_randtest_reducible
, fq_init
, fq_init2
, fq_clear
, _fq_sparse_reduce
, _fq_dense_reduce
, _fq_reduce
, fq_reduce
, fq_add
, fq_sub
, fq_sub_one
, fq_neg
, fq_mul
, fq_mul_fmpz
, fq_mul_si
, fq_mul_ui
, fq_sqr
, fq_div
, _fq_inv
, fq_inv
, fq_gcdinv
, _fq_pow
, fq_pow
, fq_pow_ui
, fq_sqrt
, fq_pth_root
, fq_is_square
, fq_fprint_pretty
, fq_print_pretty
, fq_fprint
, fq_print
, fq_get_str
, fq_get_str_pretty
, fq_randtest
, fq_randtest_not_zero
, fq_randtest_dense
, fq_rand
, fq_rand_not_zero
, fq_set
, fq_set_si
, fq_set_ui
, fq_set_fmpz
, fq_swap
, fq_zero
, fq_one
, fq_gen
, fq_get_fmpz
, fq_get_fmpz_poly
, fq_get_fmpz_mod_poly
, fq_set_fmpz_poly
, fq_set_fmpz_mod_poly
, fq_get_fmpz_mod_mat
, fq_set_fmpz_mod_mat
, fq_is_zero
, fq_is_one
, fq_equal
, fq_is_invertible
, fq_is_invertible_f
, _fq_trace
, fq_trace
, _fq_norm
, fq_norm
, _fq_frobenius
, fq_frobenius
, fq_multiplicative_order
, fq_is_primitive
, fq_bit_pack
, fq_bit_unpack
) where
import Foreign.C.String
import Foreign.C.Types
import qualified Foreign.Concurrent
import Foreign.ForeignPtr
import Foreign.Ptr ( Ptr, FunPtr, plusPtr )
import Foreign.Storable
import Foreign.Marshal ( free )
import Data.Number.Flint.Flint
import Data.Number.Flint.Fmpz
import Data.Number.Flint.Fmpz.Poly
import Data.Number.Flint.Fmpz.Mod
import Data.Number.Flint.Fmpz.Mod.Poly
import Data.Number.Flint.Fmpz.Mod.Mat
import Data.Number.Flint.Fmpq
import Data.Number.Flint.Fq.Types
newFq :: FqCtx -> IO Fq
newFq :: FqCtx -> IO Fq
newFq ctx :: FqCtx
ctx@(FqCtx ForeignPtr CFqCtx
pctx) = do
ForeignPtr CFq
x <- forall a. Storable a => IO (ForeignPtr a)
mallocForeignPtr
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr CFq
x forall a b. (a -> b) -> a -> b
$ \Ptr CFq
x -> do
forall {a}. FqCtx -> (Ptr CFqCtx -> IO a) -> IO (FqCtx, a)
withFqCtx FqCtx
ctx forall a b. (a -> b) -> a -> b
$ \Ptr CFqCtx
ctx -> do
Ptr CFq -> Ptr CFqCtx -> IO ()
fq_init Ptr CFq
x Ptr CFqCtx
ctx
forall env a.
FinalizerEnvPtr env a -> Ptr env -> ForeignPtr a -> IO ()
addForeignPtrFinalizerEnv FunPtr (Ptr CFq -> Ptr CFqCtx -> IO ())
p_fq_clear Ptr CFq
x ForeignPtr CFqCtx
pctx
forall (m :: * -> *) a. Monad m => a -> m a
return forall a b. (a -> b) -> a -> b
$ ForeignPtr CFq -> Fq
Fq ForeignPtr CFq
x
{-# INLINE withFq #-}
withFq :: Fq -> (Ptr CFq -> IO a) -> IO (Fq, a)
withFq (Fq ForeignPtr CFq
p) Ptr CFq -> IO a
f = do
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr CFq
p forall a b. (a -> b) -> a -> b
$ \Ptr CFq
fp -> Ptr CFq -> IO a
f Ptr CFq
fp forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= forall (m :: * -> *) a. Monad m => a -> m a
return forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ForeignPtr CFq -> Fq
Fq ForeignPtr CFq
p,)
{-# INLINE withNewFq #-}
withNewFq :: FqCtx -> (Ptr CFq -> IO a) -> IO (Fq, a)
withNewFq FqCtx
ctx Ptr CFq -> IO a
f = do
Fq
x <- FqCtx -> IO Fq
newFq FqCtx
ctx
forall {a}. Fq -> (Ptr CFq -> IO a) -> IO (Fq, a)
withFq Fq
x Ptr CFq -> IO a
f
data FqCtx = FqCtx {-# UNPACK #-} !(ForeignPtr CFqCtx)
type CFqCtx = CFlint FqCtx
instance Storable CFqCtx where
{-# INLINE sizeOf #-}
sizeOf :: CFqCtx -> Int
sizeOf CFqCtx
_ = (Int
200)
{-# LINE 174 "src/Data/Number/Flint/Fq/FFI.hsc" #-}
{-# INLINE alignment #-}
alignment :: CFqCtx -> Int
alignment CFqCtx
_ = Int
8
{-# LINE 176 "src/Data/Number/Flint/Fq/FFI.hsc" #-}
peek = undefined
poke :: Ptr CFqCtx -> CFqCtx -> IO ()
poke = forall a. HasCallStack => a
undefined
newFqCtx :: Fmpz -> CLong -> String -> IO FqCtx
newFqCtx Fmpz
p CLong
d String
var = do
ForeignPtr CFqCtx
x <- forall a. Storable a => IO (ForeignPtr a)
mallocForeignPtr
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr CFqCtx
x forall a b. (a -> b) -> a -> b
$ \Ptr CFqCtx
x ->
forall {a}. Fmpz -> (Ptr CFmpz -> IO a) -> IO (Fmpz, a)
withFmpz Fmpz
p forall a b. (a -> b) -> a -> b
$ \Ptr CFmpz
p ->
forall a. String -> (CString -> IO a) -> IO a
withCString String
var forall a b. (a -> b) -> a -> b
$ \CString
var ->
Ptr CFqCtx -> Ptr CFmpz -> CLong -> CString -> IO ()
fq_ctx_init Ptr CFqCtx
x Ptr CFmpz
p CLong
d CString
var
forall a. FinalizerPtr a -> ForeignPtr a -> IO ()
addForeignPtrFinalizer FunPtr (Ptr CFqCtx -> IO ())
p_fq_ctx_clear ForeignPtr CFqCtx
x
forall (m :: * -> *) a. Monad m => a -> m a
return forall a b. (a -> b) -> a -> b
$ ForeignPtr CFqCtx -> FqCtx
FqCtx ForeignPtr CFqCtx
x
{-# INLINE withFqCtx #-}
withFqCtx :: FqCtx -> (Ptr CFqCtx -> IO a) -> IO (FqCtx, a)
withFqCtx (FqCtx ForeignPtr CFqCtx
p) Ptr CFqCtx -> IO a
f = do
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr CFqCtx
p forall a b. (a -> b) -> a -> b
$ \Ptr CFqCtx
fp -> Ptr CFqCtx -> IO a
f Ptr CFqCtx
fp forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= forall (m :: * -> *) a. Monad m => a -> m a
return forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ForeignPtr CFqCtx -> FqCtx
FqCtx ForeignPtr CFqCtx
p,)
withNewFqCtx :: Fmpz -> CLong -> String -> (Ptr CFqCtx -> IO a) -> IO (FqCtx, a)
withNewFqCtx Fmpz
p CLong
d String
var Ptr CFqCtx -> IO a
f = do
FqCtx
ctx <- Fmpz -> CLong -> String -> IO FqCtx
newFqCtx Fmpz
p CLong
d String
var
forall {a}. FqCtx -> (Ptr CFqCtx -> IO a) -> IO (FqCtx, a)
withFqCtx FqCtx
ctx Ptr CFqCtx -> IO a
f
newFqCtxConway :: Fmpz -> CLong -> String -> IO FqCtx
newFqCtxConway Fmpz
p CLong
d String
var = do
ForeignPtr CFqCtx
x <- forall a. Storable a => IO (ForeignPtr a)
mallocForeignPtr
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr CFqCtx
x forall a b. (a -> b) -> a -> b
$ \Ptr CFqCtx
x ->
forall {a}. Fmpz -> (Ptr CFmpz -> IO a) -> IO (Fmpz, a)
withFmpz Fmpz
p forall a b. (a -> b) -> a -> b
$ \Ptr CFmpz
p ->
forall a. String -> (CString -> IO a) -> IO a
withCString String
var forall a b. (a -> b) -> a -> b
$ \CString
var ->
Ptr CFqCtx -> Ptr CFmpz -> CLong -> CString -> IO ()
fq_ctx_init_conway Ptr CFqCtx
x Ptr CFmpz
p CLong
d CString
var
forall a. FinalizerPtr a -> ForeignPtr a -> IO ()
addForeignPtrFinalizer FunPtr (Ptr CFqCtx -> IO ())
p_fq_ctx_clear ForeignPtr CFqCtx
x
forall (m :: * -> *) a. Monad m => a -> m a
return forall a b. (a -> b) -> a -> b
$ ForeignPtr CFqCtx -> FqCtx
FqCtx ForeignPtr CFqCtx
x
withNewFqCtxConway :: Fmpz -> CLong -> String -> (Ptr CFqCtx -> IO a) -> IO (FqCtx, a)
withNewFqCtxConway Fmpz
p CLong
d String
var Ptr CFqCtx -> IO a
f = do
FqCtx
ctx <- Fmpz -> CLong -> String -> IO FqCtx
newFqCtxConway Fmpz
p CLong
d String
var
forall {a}. FqCtx -> (Ptr CFqCtx -> IO a) -> IO (FqCtx, a)
withFqCtx FqCtx
ctx Ptr CFqCtx -> IO a
f
newFqCtxModulus :: FmpzModPoly -> FmpzModCtx -> String -> IO FqCtx
newFqCtxModulus FmpzModPoly
modulus FmpzModCtx
mod_ctx String
var = do
ForeignPtr CFqCtx
x <- forall a. Storable a => IO (ForeignPtr a)
mallocForeignPtr
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr CFqCtx
x forall a b. (a -> b) -> a -> b
$ \Ptr CFqCtx
x ->
forall {a}.
FmpzModPoly -> (Ptr CFmpzModPoly -> IO a) -> IO (FmpzModPoly, a)
withFmpzModPoly FmpzModPoly
modulus forall a b. (a -> b) -> a -> b
$ \Ptr CFmpzModPoly
modulus ->
forall {a}.
FmpzModCtx -> (Ptr CFmpzModCtx -> IO a) -> IO (FmpzModCtx, a)
withFmpzModCtx FmpzModCtx
mod_ctx forall a b. (a -> b) -> a -> b
$ \Ptr CFmpzModCtx
mod_ctx ->
forall a. String -> (CString -> IO a) -> IO a
withCString String
var forall a b. (a -> b) -> a -> b
$ \CString
var ->
Ptr CFqCtx
-> Ptr CFmpzModPoly -> Ptr CFmpzModCtx -> CString -> IO ()
fq_ctx_init_modulus Ptr CFqCtx
x Ptr CFmpzModPoly
modulus Ptr CFmpzModCtx
mod_ctx CString
var
forall a. FinalizerPtr a -> ForeignPtr a -> IO ()
addForeignPtrFinalizer FunPtr (Ptr CFqCtx -> IO ())
p_fq_ctx_clear ForeignPtr CFqCtx
x
forall (m :: * -> *) a. Monad m => a -> m a
return forall a b. (a -> b) -> a -> b
$ ForeignPtr CFqCtx -> FqCtx
FqCtx ForeignPtr CFqCtx
x
withNewFqCtxModulus :: FmpzModPoly
-> FmpzModCtx -> String -> (Ptr CFqCtx -> IO a) -> IO (FqCtx, a)
withNewFqCtxModulus FmpzModPoly
modulus FmpzModCtx
mod_ctx String
var Ptr CFqCtx -> IO a
f = do
FqCtx
ctx <- FmpzModPoly -> FmpzModCtx -> String -> IO FqCtx
newFqCtxModulus FmpzModPoly
modulus FmpzModCtx
mod_ctx String
var
forall {a}. FqCtx -> (Ptr CFqCtx -> IO a) -> IO (FqCtx, a)
withFqCtx FqCtx
ctx Ptr CFqCtx -> IO a
f
foreign import ccall "fq.h fq_ctx_init"
fq_ctx_init :: Ptr CFqCtx -> Ptr CFmpz -> CLong -> CString -> IO ()
foreign import ccall "fq.h _fq_ctx_init_conway"
_fq_ctx_init_conway :: Ptr CFqCtx -> Ptr CFmpz -> CLong -> CString -> IO CInt
foreign import ccall "fq.h fq_ctx_init_conway"
fq_ctx_init_conway :: Ptr CFqCtx -> Ptr CFmpz -> CLong -> CString -> IO ()
foreign import ccall "fq.h fq_ctx_init_modulus"
fq_ctx_init_modulus :: Ptr CFqCtx -> Ptr CFmpzModPoly -> Ptr CFmpzModCtx -> CString -> IO ()
foreign import ccall "fq.h fq_ctx_clear"
fq_ctx_clear :: Ptr CFqCtx -> IO ()
foreign import ccall "fq.h &fq_ctx_clear"
p_fq_ctx_clear :: FunPtr (Ptr CFqCtx -> IO ())
foreign import ccall "fq.h fq_ctx_modulus"
fq_ctx_modulus :: Ptr CFqCtx -> IO (Ptr CFmpzModPoly)
foreign import ccall "fq.h fq_ctx_degree"
fq_ctx_degree :: Ptr CFqCtx -> IO CLong
foreign import ccall "fq.h fq_ctx_prime"
fq_ctx_prime :: Ptr CFqCtx -> IO (Ptr CFmpz)
foreign import ccall "fq.h fq_ctx_order"
fq_ctx_order :: Ptr CFmpz -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_ctx_get_str"
fq_ctx_get_str :: Ptr CFqCtx -> IO CString
foreign import ccall "fq.h fq_ctx_fprint"
fq_ctx_fprint :: Ptr CFile -> Ptr CFqCtx -> IO CInt
fq_ctx_print :: Ptr CFqCtx -> IO ()
fq_ctx_print :: Ptr CFqCtx -> IO ()
fq_ctx_print Ptr CFqCtx
ctx = do
forall a. (Ptr a -> IO CString) -> Ptr a -> IO CInt
printCStr Ptr CFqCtx -> IO CString
fq_ctx_get_str Ptr CFqCtx
ctx
forall (m :: * -> *) a. Monad m => a -> m a
return ()
foreign import ccall "fq.h fq_ctx_randtest"
fq_ctx_randtest :: Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_ctx_randtest_reducible"
fq_ctx_randtest_reducible :: Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_init"
fq_init :: Ptr CFq -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_init2"
fq_init2 :: Ptr CFq -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_clear"
fq_clear :: Ptr CFq -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h &fq_clear"
p_fq_clear :: FunPtr (Ptr CFq -> Ptr CFqCtx -> IO ())
foreign import ccall "fq.h _fq_sparse_reduce"
_fq_sparse_reduce :: Ptr CFmpz -> CLong -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h _fq_dense_reduce"
_fq_dense_reduce :: Ptr CFmpz -> CLong -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h _fq_reduce"
_fq_reduce :: Ptr CFmpz -> CLong -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_reduce"
fq_reduce :: Ptr CFq -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_add"
fq_add :: Ptr CFq -> Ptr CFq -> Ptr CFq -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_sub"
fq_sub :: Ptr CFq -> Ptr CFq -> Ptr CFq -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_sub_one"
fq_sub_one :: Ptr CFq -> Ptr CFq -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_neg"
fq_neg :: Ptr CFq -> Ptr CFq -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_mul"
fq_mul :: Ptr CFq -> Ptr CFq -> Ptr CFq -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_mul_fmpz"
fq_mul_fmpz :: Ptr CFq -> Ptr CFq -> Ptr CFmpz -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_mul_si"
fq_mul_si :: Ptr CFq -> Ptr CFq -> CLong -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_mul_ui"
fq_mul_ui :: Ptr CFq -> Ptr CFq -> CULong -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_sqr"
fq_sqr :: Ptr CFq -> Ptr CFq -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_div"
fq_div :: Ptr CFq -> Ptr CFq -> Ptr CFq -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h _fq_inv"
_fq_inv :: Ptr CFmpz -> Ptr CFmpz -> CLong -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_inv"
fq_inv :: Ptr CFq -> Ptr CFq -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_gcdinv"
fq_gcdinv :: Ptr CFq -> Ptr CFq -> Ptr CFq -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h _fq_pow"
_fq_pow :: Ptr CFmpz -> Ptr CFmpz -> CLong -> Ptr CFmpz -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_pow"
fq_pow :: Ptr CFq -> Ptr CFq -> Ptr CFmpz -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_pow_ui"
fq_pow_ui :: Ptr CFq -> Ptr CFq -> CULong -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_sqrt"
fq_sqrt :: Ptr CFq -> Ptr CFq -> Ptr CFqCtx -> IO CInt
foreign import ccall "fq.h fq_pth_root"
fq_pth_root :: Ptr CFq -> Ptr CFq -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_is_square"
fq_is_square :: Ptr CFq -> Ptr CFqCtx -> IO CInt
foreign import ccall "fq.h fq_fprint_pretty"
fq_fprint_pretty :: Ptr CFile -> Ptr CFq -> Ptr CFqCtx -> IO CInt
fq_print_pretty :: Ptr CFq -> Ptr CFqCtx -> IO CInt
fq_print_pretty :: Ptr CFq -> Ptr CFqCtx -> IO CInt
fq_print_pretty Ptr CFq
x Ptr CFqCtx
ctx = forall a. (Ptr a -> IO CString) -> Ptr a -> IO CInt
printCStr (forall a b c. (a -> b -> c) -> b -> a -> c
flip Ptr CFq -> Ptr CFqCtx -> IO CString
fq_get_str_pretty Ptr CFqCtx
ctx) Ptr CFq
x
foreign import ccall "fq.h fq_fprint"
fq_fprint :: Ptr CFile -> Ptr CFq -> Ptr CFqCtx -> IO ()
fq_print :: Ptr CFq -> Ptr CFqCtx -> IO CInt
fq_print :: Ptr CFq -> Ptr CFqCtx -> IO CInt
fq_print Ptr CFq
x Ptr CFqCtx
ctx = forall a. (Ptr a -> IO CString) -> Ptr a -> IO CInt
printCStr (forall a b c. (a -> b -> c) -> b -> a -> c
flip Ptr CFq -> Ptr CFqCtx -> IO CString
fq_get_str Ptr CFqCtx
ctx) Ptr CFq
x
foreign import ccall "fq.h fq_get_str"
fq_get_str :: Ptr CFq -> Ptr CFqCtx -> IO CString
foreign import ccall "fq.h fq_get_str_pretty"
fq_get_str_pretty :: Ptr CFq -> Ptr CFqCtx -> IO CString
foreign import ccall "fq.h fq_randtest"
fq_randtest :: Ptr CFq -> Ptr CFRandState -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_randtest_not_zero"
fq_randtest_not_zero :: Ptr CFq -> Ptr CFRandState -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_randtest_dense"
fq_randtest_dense :: Ptr CFq -> Ptr CFRandState -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_rand"
fq_rand :: Ptr CFq -> Ptr CFRandState -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_rand_not_zero"
fq_rand_not_zero :: Ptr CFq -> Ptr CFRandState -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_set"
fq_set :: Ptr CFq -> Ptr CFq -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_set_si"
fq_set_si :: Ptr CFq -> CLong -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_set_ui"
fq_set_ui :: Ptr CFq -> CULong -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_set_fmpz"
fq_set_fmpz :: Ptr CFq -> Ptr CFmpz -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_swap"
fq_swap :: Ptr CFq -> Ptr CFq -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_zero"
fq_zero :: Ptr CFq -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_one"
fq_one :: Ptr CFq -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_gen"
fq_gen :: Ptr CFq -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_get_fmpz"
fq_get_fmpz :: Ptr CFmpz -> Ptr CFq -> Ptr CFqCtx -> IO CInt
foreign import ccall "fq.h fq_get_fmpz_poly"
fq_get_fmpz_poly :: Ptr CFmpzPoly -> Ptr CFq -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_get_fmpz_mod_poly"
fq_get_fmpz_mod_poly :: Ptr CFmpzModPoly -> Ptr CFq -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_set_fmpz_poly"
fq_set_fmpz_poly :: Ptr CFq -> Ptr CFmpzPoly -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_set_fmpz_mod_poly"
fq_set_fmpz_mod_poly :: Ptr CFq -> Ptr CFmpzModPoly -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_get_fmpz_mod_mat"
fq_get_fmpz_mod_mat :: Ptr CFmpzModMat -> Ptr CFq -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_set_fmpz_mod_mat"
fq_set_fmpz_mod_mat :: Ptr CFq -> Ptr CFmpzModMat -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_is_zero"
fq_is_zero :: Ptr CFq -> Ptr CFqCtx -> IO CInt
foreign import ccall "fq.h fq_is_one"
fq_is_one :: Ptr CFq -> Ptr CFqCtx -> IO CInt
foreign import ccall "fq.h fq_equal"
fq_equal :: Ptr CFq -> Ptr CFq -> Ptr CFqCtx -> IO CInt
foreign import ccall "fq.h fq_is_invertible"
fq_is_invertible :: Ptr CFq -> Ptr CFqCtx -> IO CInt
foreign import ccall "fq.h fq_is_invertible_f"
fq_is_invertible_f :: Ptr CFq -> Ptr CFq -> Ptr CFqCtx -> IO CInt
foreign import ccall "fq.h _fq_trace"
_fq_trace :: Ptr CFmpz -> Ptr CFmpz -> CLong -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_trace"
fq_trace :: Ptr CFmpz -> Ptr CFq -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h _fq_norm"
_fq_norm :: Ptr CFmpz -> Ptr CFmpz -> CLong -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_norm"
fq_norm :: Ptr CFmpz -> Ptr CFq -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h _fq_frobenius"
_fq_frobenius :: Ptr CFmpz -> Ptr CFmpz -> CLong -> CLong -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_frobenius"
fq_frobenius :: Ptr CFq -> Ptr CFq -> CLong -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_multiplicative_order"
fq_multiplicative_order :: Ptr CFmpz -> Ptr CFq -> Ptr CFqCtx -> IO CInt
foreign import ccall "fq.h fq_is_primitive"
fq_is_primitive :: Ptr CFq -> Ptr CFqCtx -> IO CInt
foreign import ccall "fq.h fq_bit_pack"
fq_bit_pack :: Ptr CFmpz -> Ptr CFq -> CFBitCnt -> Ptr CFqCtx -> IO ()
foreign import ccall "fq.h fq_bit_unpack"
fq_bit_unpack :: Ptr CFq -> Ptr CFmpz -> CFBitCnt -> Ptr CFqCtx -> IO ()