{-# LINE 1 "src/Data/Number/Flint/Fq/Zech/FFI.hsc" #-}
module Data.Number.Flint.Fq.Zech.FFI (
FqZech (..)
, CFqZech (..)
, newFqZech
, withFqZech
, FqZechCtx (..)
, CFqZechCtx (..)
, newFqZechCtx
, newFqZechCtxConway
, newFqZechCtxRandom
, newFqZechCtxModulus
, newFqZechCtxModulusCheck
, newFqZechCtxFqNModCtx
, newFqZechCtxFqNModCtxCheck
, withFqZechCtx
, fq_zech_ctx_init
, _fq_zech_ctx_init_conway
, fq_zech_ctx_init_conway
, fq_zech_ctx_init_random
, fq_zech_ctx_init_modulus
, fq_zech_ctx_init_modulus_check
, fq_zech_ctx_init_fq_nmod_ctx
, fq_zech_ctx_init_fq_nmod_ctx_check
, fq_zech_ctx_clear
, fq_zech_ctx_modulus
, fq_zech_ctx_degree
, fq_zech_ctx_order
, fq_zech_ctx_order_ui
, fq_zech_ctx_get_str
, fq_zech_ctx_fprint
, fq_zech_ctx_print
, fq_zech_ctx_randtest
, fq_zech_ctx_randtest_reducible
, fq_zech_init
, fq_zech_init2
, fq_zech_clear
, fq_zech_reduce
, fq_zech_add
, fq_zech_sub
, fq_zech_sub_one
, fq_zech_neg
, fq_zech_mul
, fq_zech_mul_fmpz
, fq_zech_mul_si
, fq_zech_mul_ui
, fq_zech_sqr
, fq_zech_div
, fq_zech_inv
, fq_zech_gcdinv
, fq_zech_pow
, fq_zech_pow_ui
, fq_zech_sqrt
, fq_zech_pth_root
, fq_zech_is_square
, fq_zech_fprint_pretty
, fq_zech_print_pretty
, fq_zech_fprint
, fq_zech_print
, fq_zech_get_str
, fq_zech_get_str_pretty
, fq_zech_randtest
, fq_zech_randtest_not_zero
, fq_zech_rand
, fq_zech_rand_not_zero
, fq_zech_set
, fq_zech_set_si
, fq_zech_set_ui
, fq_zech_set_fmpz
, fq_zech_swap
, fq_zech_zero
, fq_zech_one
, fq_zech_gen
, fq_zech_get_fmpz
, fq_zech_get_fq_nmod
, fq_zech_set_fq_nmod
, fq_zech_get_nmod_poly
, fq_zech_set_nmod_poly
, fq_zech_get_nmod_mat
, fq_zech_set_nmod_mat
, fq_zech_is_zero
, fq_zech_is_one
, fq_zech_equal
, fq_zech_is_invertible
, fq_zech_is_invertible_f
, fq_zech_trace
, fq_zech_norm
, fq_zech_frobenius
, fq_zech_multiplicative_order
, fq_zech_bit_pack
, fq_zech_bit_unpack
) where
import Foreign.C.String
import Foreign.C.Types
import Foreign.Ptr ( Ptr, FunPtr, plusPtr )
import Foreign.ForeignPtr
import Foreign.Storable
import Foreign.Marshal ( free )
import Data.Number.Flint.Flint
import Data.Number.Flint.Fmpz
import Data.Number.Flint.NMod.Poly
import Data.Number.Flint.NMod.Mat
import Data.Number.Flint.Fq
import Data.Number.Flint.Fq.NMod
import Data.Number.Flint.Fq.NMod.Mat
import Data.Number.Flint.Fq.Zech.Types
instance Storable CFqZech where
{-# INLINE sizeOf #-}
sizeOf :: CFqZech -> Int
sizeOf CFqZech
_ = (Int
8)
{-# LINE 150 "src/Data/Number/Flint/Fq/Zech/FFI.hsc" #-}
{-# INLINE alignment #-}
alignment :: CFqZech -> Int
alignment CFqZech
_ = Int
8
{-# LINE 152 "src/Data/Number/Flint/Fq/Zech/FFI.hsc" #-}
peek = undefined
poke :: Ptr CFqZech -> CFqZech -> IO ()
poke = forall a. HasCallStack => a
undefined
newFqZech :: FqZechCtx -> IO FqZech
newFqZech ctx :: FqZechCtx
ctx@(FqZechCtx ForeignPtr CFqZechCtx
ftx) = do
ForeignPtr CFqZech
x <- forall a. Storable a => IO (ForeignPtr a)
mallocForeignPtr
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr CFqZech
x forall a b. (a -> b) -> a -> b
$ \Ptr CFqZech
x -> do
forall {a}.
FqZechCtx -> (Ptr CFqZechCtx -> IO a) -> IO (FqZechCtx, a)
withFqZechCtx FqZechCtx
ctx forall a b. (a -> b) -> a -> b
$ \Ptr CFqZechCtx
ctx -> do
Ptr CFqZech -> Ptr CFqZechCtx -> IO ()
fq_zech_init Ptr CFqZech
x Ptr CFqZechCtx
ctx
forall env a.
FinalizerEnvPtr env a -> Ptr env -> ForeignPtr a -> IO ()
addForeignPtrFinalizerEnv FunPtr (Ptr CFqZech -> Ptr CFqZechCtx -> IO ())
p_fq_zech_clear Ptr CFqZech
x ForeignPtr CFqZechCtx
ftx
forall (m :: * -> *) a. Monad m => a -> m a
return forall a b. (a -> b) -> a -> b
$ ForeignPtr CFqZech -> FqZech
FqZech ForeignPtr CFqZech
x
{-# INLINE withFqZech #-}
withFqZech :: FqZech -> (Ptr CFqZech -> IO a) -> IO (FqZech, a)
withFqZech (FqZech ForeignPtr CFqZech
x) Ptr CFqZech -> IO a
f = do
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr CFqZech
x forall a b. (a -> b) -> a -> b
$ \Ptr CFqZech
px -> Ptr CFqZech -> IO a
f Ptr CFqZech
px 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 CFqZech -> FqZech
FqZech ForeignPtr CFqZech
x,)
instance Storable CFqZechCtx where
{-# INLINE sizeOf #-}
sizeOf :: CFqZechCtx -> Int
sizeOf CFqZechCtx
_ = (Int
88)
{-# LINE 172 "src/Data/Number/Flint/Fq/Zech/FFI.hsc" #-}
{-# INLINE alignment #-}
alignment :: CFqZechCtx -> Int
alignment CFqZechCtx
_ = Int
8
{-# LINE 174 "src/Data/Number/Flint/Fq/Zech/FFI.hsc" #-}
peek = undefined
poke :: Ptr CFqZechCtx -> CFqZechCtx -> IO ()
poke = forall a. HasCallStack => a
undefined
_newFqZechCtx :: (Ptr CFqZechCtx -> Ptr CFmpz -> t -> CString -> IO a)
-> Fmpz -> t -> String -> IO FqZechCtx
_newFqZechCtx Ptr CFqZechCtx -> Ptr CFmpz -> t -> CString -> IO a
f Fmpz
p t
d String
var = do
ForeignPtr CFqZechCtx
x <- forall a. Storable a => IO (ForeignPtr a)
mallocForeignPtr
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr CFqZechCtx
x forall a b. (a -> b) -> a -> b
$ \Ptr CFqZechCtx
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 -> do
Ptr CFqZechCtx -> Ptr CFmpz -> t -> CString -> IO a
f Ptr CFqZechCtx
x Ptr CFmpz
p t
d CString
var
forall a. FinalizerPtr a -> ForeignPtr a -> IO ()
addForeignPtrFinalizer FunPtr (Ptr CFqZechCtx -> IO ())
p_fq_zech_ctx_clear ForeignPtr CFqZechCtx
x
forall (m :: * -> *) a. Monad m => a -> m a
return forall a b. (a -> b) -> a -> b
$ ForeignPtr CFqZechCtx -> FqZechCtx
FqZechCtx ForeignPtr CFqZechCtx
x
newFqZechCtx :: Fmpz -> CLong -> String -> IO FqZechCtx
newFqZechCtx = forall {t} {a}.
(Ptr CFqZechCtx -> Ptr CFmpz -> t -> CString -> IO a)
-> Fmpz -> t -> String -> IO FqZechCtx
_newFqZechCtx Ptr CFqZechCtx -> Ptr CFmpz -> CLong -> CString -> IO ()
fq_zech_ctx_init
newFqZechCtxConway :: Fmpz -> CLong -> String -> IO FqZechCtx
newFqZechCtxConway = forall {t} {a}.
(Ptr CFqZechCtx -> Ptr CFmpz -> t -> CString -> IO a)
-> Fmpz -> t -> String -> IO FqZechCtx
_newFqZechCtx Ptr CFqZechCtx -> Ptr CFmpz -> CLong -> CString -> IO ()
fq_zech_ctx_init_conway
newFqZechCtxRandom :: Fmpz -> CLong -> String -> IO FqZechCtx
newFqZechCtxRandom = forall {t} {a}.
(Ptr CFqZechCtx -> Ptr CFmpz -> t -> CString -> IO a)
-> Fmpz -> t -> String -> IO FqZechCtx
_newFqZechCtx Ptr CFqZechCtx -> Ptr CFmpz -> CLong -> CString -> IO ()
fq_zech_ctx_init_random
newFqZechCtxModulus :: p -> NModPoly -> String -> IO FqZechCtx
newFqZechCtxModulus p
f NModPoly
modulus String
var = do
ForeignPtr CFqZechCtx
x <- forall a. Storable a => IO (ForeignPtr a)
mallocForeignPtr
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr CFqZechCtx
x forall a b. (a -> b) -> a -> b
$ \Ptr CFqZechCtx
x ->
forall {a}. NModPoly -> (Ptr CNModPoly -> IO a) -> IO (NModPoly, a)
withNModPoly NModPoly
modulus forall a b. (a -> b) -> a -> b
$ \Ptr CNModPoly
modulus ->
forall a. String -> (CString -> IO a) -> IO a
withCString String
var forall a b. (a -> b) -> a -> b
$ \CString
var ->
Ptr CFqZechCtx -> Ptr CNModPoly -> CString -> IO ()
fq_zech_ctx_init_modulus Ptr CFqZechCtx
x Ptr CNModPoly
modulus CString
var
forall a. FinalizerPtr a -> ForeignPtr a -> IO ()
addForeignPtrFinalizer FunPtr (Ptr CFqZechCtx -> IO ())
p_fq_zech_ctx_clear ForeignPtr CFqZechCtx
x
forall (m :: * -> *) a. Monad m => a -> m a
return forall a b. (a -> b) -> a -> b
$ ForeignPtr CFqZechCtx -> FqZechCtx
FqZechCtx ForeignPtr CFqZechCtx
x
newFqZechCtxModulusCheck :: p -> NModPoly -> String -> IO FqZechCtx
newFqZechCtxModulusCheck p
f NModPoly
modulus String
var = do
ForeignPtr CFqZechCtx
x <- forall a. Storable a => IO (ForeignPtr a)
mallocForeignPtr
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr CFqZechCtx
x forall a b. (a -> b) -> a -> b
$ \Ptr CFqZechCtx
x ->
forall {a}. NModPoly -> (Ptr CNModPoly -> IO a) -> IO (NModPoly, a)
withNModPoly NModPoly
modulus forall a b. (a -> b) -> a -> b
$ \Ptr CNModPoly
modulus ->
forall a. String -> (CString -> IO a) -> IO a
withCString String
var forall a b. (a -> b) -> a -> b
$ \CString
var ->
Ptr CFqZechCtx -> Ptr CNModPoly -> CString -> IO CInt
fq_zech_ctx_init_modulus_check Ptr CFqZechCtx
x Ptr CNModPoly
modulus CString
var
forall a. FinalizerPtr a -> ForeignPtr a -> IO ()
addForeignPtrFinalizer FunPtr (Ptr CFqZechCtx -> IO ())
p_fq_zech_ctx_clear ForeignPtr CFqZechCtx
x
forall (m :: * -> *) a. Monad m => a -> m a
return forall a b. (a -> b) -> a -> b
$ ForeignPtr CFqZechCtx -> FqZechCtx
FqZechCtx ForeignPtr CFqZechCtx
x
newFqZechCtxFqNModCtx :: p -> FqNModCtx -> IO FqZechCtx
newFqZechCtxFqNModCtx p
f FqNModCtx
ctxn = do
ForeignPtr CFqZechCtx
x <- forall a. Storable a => IO (ForeignPtr a)
mallocForeignPtr
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr CFqZechCtx
x forall a b. (a -> b) -> a -> b
$ \Ptr CFqZechCtx
x ->
forall {a}.
FqNModCtx -> (Ptr CFqNModCtx -> IO a) -> IO (FqNModCtx, a)
withFqNModCtx FqNModCtx
ctxn forall a b. (a -> b) -> a -> b
$ \Ptr CFqNModCtx
ctxn ->
Ptr CFqZechCtx -> Ptr CFqNModCtx -> IO ()
fq_zech_ctx_init_fq_nmod_ctx Ptr CFqZechCtx
x Ptr CFqNModCtx
ctxn
forall a. FinalizerPtr a -> ForeignPtr a -> IO ()
addForeignPtrFinalizer FunPtr (Ptr CFqZechCtx -> IO ())
p_fq_zech_ctx_clear ForeignPtr CFqZechCtx
x
forall (m :: * -> *) a. Monad m => a -> m a
return forall a b. (a -> b) -> a -> b
$ ForeignPtr CFqZechCtx -> FqZechCtx
FqZechCtx ForeignPtr CFqZechCtx
x
newFqZechCtxFqNModCtxCheck :: p -> FqNModCtx -> IO FqZechCtx
newFqZechCtxFqNModCtxCheck p
f FqNModCtx
ctxn = do
ForeignPtr CFqZechCtx
x <- forall a. Storable a => IO (ForeignPtr a)
mallocForeignPtr
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr CFqZechCtx
x forall a b. (a -> b) -> a -> b
$ \Ptr CFqZechCtx
x ->
forall {a}.
FqNModCtx -> (Ptr CFqNModCtx -> IO a) -> IO (FqNModCtx, a)
withFqNModCtx FqNModCtx
ctxn forall a b. (a -> b) -> a -> b
$ \Ptr CFqNModCtx
ctxn ->
Ptr CFqZechCtx -> Ptr CFqNModCtx -> IO CInt
fq_zech_ctx_init_fq_nmod_ctx_check Ptr CFqZechCtx
x Ptr CFqNModCtx
ctxn
forall a. FinalizerPtr a -> ForeignPtr a -> IO ()
addForeignPtrFinalizer FunPtr (Ptr CFqZechCtx -> IO ())
p_fq_zech_ctx_clear ForeignPtr CFqZechCtx
x
forall (m :: * -> *) a. Monad m => a -> m a
return forall a b. (a -> b) -> a -> b
$ ForeignPtr CFqZechCtx -> FqZechCtx
FqZechCtx ForeignPtr CFqZechCtx
x
newFqZechCtxFqCtxModulusCheck :: p -> FqNModCtx -> IO FqZechCtx
newFqZechCtxFqCtxModulusCheck p
f FqNModCtx
ctxn = do
ForeignPtr CFqZechCtx
x <- forall a. Storable a => IO (ForeignPtr a)
mallocForeignPtr
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr CFqZechCtx
x forall a b. (a -> b) -> a -> b
$ \Ptr CFqZechCtx
x ->
forall {a}.
FqNModCtx -> (Ptr CFqNModCtx -> IO a) -> IO (FqNModCtx, a)
withFqNModCtx FqNModCtx
ctxn forall a b. (a -> b) -> a -> b
$ \Ptr CFqNModCtx
ctxn ->
Ptr CFqZechCtx -> Ptr CFqNModCtx -> IO CInt
fq_zech_ctx_init_fq_nmod_ctx_check Ptr CFqZechCtx
x Ptr CFqNModCtx
ctxn
forall a. FinalizerPtr a -> ForeignPtr a -> IO ()
addForeignPtrFinalizer FunPtr (Ptr CFqZechCtx -> IO ())
p_fq_zech_ctx_clear ForeignPtr CFqZechCtx
x
forall (m :: * -> *) a. Monad m => a -> m a
return forall a b. (a -> b) -> a -> b
$ ForeignPtr CFqZechCtx -> FqZechCtx
FqZechCtx ForeignPtr CFqZechCtx
x
{-# INLINE withFqZechCtx #-}
withFqZechCtx :: FqZechCtx -> (Ptr CFqZechCtx -> IO a) -> IO (FqZechCtx, a)
withFqZechCtx (FqZechCtx ForeignPtr CFqZechCtx
x) Ptr CFqZechCtx -> IO a
f = do
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr CFqZechCtx
x forall a b. (a -> b) -> a -> b
$ \Ptr CFqZechCtx
px -> Ptr CFqZechCtx -> IO a
f Ptr CFqZechCtx
px 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 CFqZechCtx -> FqZechCtx
FqZechCtx ForeignPtr CFqZechCtx
x,)
foreign import ccall "fq_zech.h fq_zech_ctx_init"
fq_zech_ctx_init :: Ptr CFqZechCtx -> Ptr CFmpz -> CLong -> CString -> IO ()
foreign import ccall "fq_zech.h _fq_zech_ctx_init_conway"
_fq_zech_ctx_init_conway :: Ptr CFqZechCtx -> Ptr CFmpz -> CLong -> CString -> IO CInt
foreign import ccall "fq_zech.h fq_zech_ctx_init_conway"
fq_zech_ctx_init_conway :: Ptr CFqZechCtx -> Ptr CFmpz -> CLong -> CString -> IO ()
foreign import ccall "fq_zech.h fq_zech_ctx_init_random"
fq_zech_ctx_init_random :: Ptr CFqZechCtx -> Ptr CFmpz -> CLong -> CString -> IO ()
foreign import ccall "fq_zech.h fq_zech_ctx_init_modulus"
fq_zech_ctx_init_modulus :: Ptr CFqZechCtx -> Ptr CNModPoly -> CString -> IO ()
foreign import ccall "fq_zech.h fq_zech_ctx_init_modulus_check"
fq_zech_ctx_init_modulus_check :: Ptr CFqZechCtx -> Ptr CNModPoly -> CString -> IO CInt
foreign import ccall "fq_zech.h fq_zech_ctx_init_fq_nmod_ctx"
fq_zech_ctx_init_fq_nmod_ctx :: Ptr CFqZechCtx -> Ptr CFqNModCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_ctx_init_fq_nmod_ctx_check"
fq_zech_ctx_init_fq_nmod_ctx_check :: Ptr CFqZechCtx -> Ptr CFqNModCtx -> IO CInt
foreign import ccall "fq_zech.h fq_zech_ctx_clear"
fq_zech_ctx_clear :: Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h &fq_zech_ctx_clear"
p_fq_zech_ctx_clear :: FunPtr (Ptr CFqZechCtx -> IO ())
foreign import ccall "fq_zech.h fq_zech_ctx_modulus"
fq_zech_ctx_modulus :: Ptr CFqZechCtx -> IO (Ptr (Ptr CNModPoly))
foreign import ccall "fq_zech.h fq_zech_ctx_degree"
fq_zech_ctx_degree :: Ptr CFqZechCtx -> IO CLong
foreign import ccall "fq_zech.h fq_zech_ctx_order"
fq_zech_ctx_order :: Ptr CFmpz -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_ctx_order_ui"
fq_zech_ctx_order_ui :: Ptr CFqZechCtx -> IO CMpLimb
foreign import ccall "fq_zech.h fq_zech_ctx_get_str"
fq_zech_ctx_get_str :: Ptr CFqZechCtx -> IO CString
foreign import ccall "fq_zech.h fq_zech_ctx_fprint"
fq_zech_ctx_fprint :: Ptr CFile -> Ptr CFqZechCtx -> IO CInt
fq_zech_ctx_print :: Ptr CFqZechCtx -> IO ()
fq_zech_ctx_print :: Ptr CFqZechCtx -> IO ()
fq_zech_ctx_print Ptr CFqZechCtx
ctx = do
forall a. (Ptr a -> IO CString) -> Ptr a -> IO CInt
printCStr Ptr CFqZechCtx -> IO CString
fq_zech_ctx_get_str Ptr CFqZechCtx
ctx
forall (m :: * -> *) a. Monad m => a -> m a
return ()
foreign import ccall "fq_zech.h fq_zech_ctx_randtest"
fq_zech_ctx_randtest :: Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_ctx_randtest_reducible"
fq_zech_ctx_randtest_reducible :: Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_init"
fq_zech_init :: Ptr CFqZech -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_init2"
fq_zech_init2 :: Ptr CFqZech -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_clear"
fq_zech_clear :: Ptr CFqZech -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h &fq_zech_clear"
p_fq_zech_clear :: FunPtr (Ptr CFqZech -> Ptr CFqZechCtx -> IO ())
foreign import ccall "fq_zech.h fq_zech_reduce"
fq_zech_reduce :: Ptr CFqZech -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_add"
fq_zech_add :: Ptr CFqZech -> Ptr CFqZech -> Ptr CFqZech -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_sub"
fq_zech_sub :: Ptr CFqZech -> Ptr CFqZech -> Ptr CFqZech -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_sub_one"
fq_zech_sub_one :: Ptr CFqZech -> Ptr CFqZech -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_neg"
fq_zech_neg :: Ptr CFqZech -> Ptr CFqZech -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_mul"
fq_zech_mul :: Ptr CFqZech -> Ptr CFqZech -> Ptr CFqZech -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_mul_fmpz"
fq_zech_mul_fmpz :: Ptr CFqZech -> Ptr CFqZech -> Ptr CFmpz -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_mul_si"
fq_zech_mul_si :: Ptr CFqZech -> Ptr CFqZech -> CLong -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_mul_ui"
fq_zech_mul_ui :: Ptr CFqZech -> Ptr CFqZech -> CULong -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_sqr"
fq_zech_sqr :: Ptr CFqZech -> Ptr CFqZech -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_div"
fq_zech_div :: Ptr CFqZech -> Ptr CFqZech -> Ptr CFqZech -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_inv"
fq_zech_inv :: Ptr CFqZech -> Ptr CFqZech -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_gcdinv"
fq_zech_gcdinv :: Ptr CFqZech -> Ptr CFqZech -> Ptr CFqZech -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_pow"
fq_zech_pow :: Ptr CFqZech -> Ptr CFqZech -> Ptr CFmpz -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_pow_ui"
fq_zech_pow_ui :: Ptr CFqZech -> Ptr CFqZech -> CULong -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_sqrt"
fq_zech_sqrt :: Ptr CFqZech -> Ptr CFqZech -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_pth_root"
fq_zech_pth_root :: Ptr CFqZech -> Ptr CFqZech -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_is_square"
fq_zech_is_square :: Ptr CFqZech -> Ptr CFqZechCtx -> IO CInt
foreign import ccall "fq_zech.h fq_zech_fprint_pretty"
fq_zech_fprint_pretty :: Ptr CFile -> Ptr CFqZech -> Ptr CFqZechCtx -> IO CInt
fq_zech_print_pretty :: Ptr CFqZech -> Ptr CFqZechCtx -> IO CInt
fq_zech_print_pretty :: Ptr CFqZech -> Ptr CFqZechCtx -> IO CInt
fq_zech_print_pretty Ptr CFqZech
op Ptr CFqZechCtx
ctx = do
forall a. (Ptr a -> IO CString) -> Ptr a -> IO CInt
printCStr (\Ptr CFqZech
op -> Ptr CFqZech -> Ptr CFqZechCtx -> IO CString
fq_zech_get_str_pretty Ptr CFqZech
op Ptr CFqZechCtx
ctx) Ptr CFqZech
op
foreign import ccall "fq_zech.h fq_zech_fprint"
fq_zech_fprint :: Ptr CFile -> Ptr CFqZech -> Ptr CFqZechCtx -> IO ()
fq_zech_print :: Ptr CFqZech -> Ptr CFqZechCtx -> IO ()
fq_zech_print :: Ptr CFqZech -> Ptr CFqZechCtx -> IO ()
fq_zech_print Ptr CFqZech
op Ptr CFqZechCtx
ctx = do
forall a. (Ptr a -> IO CString) -> Ptr a -> IO CInt
printCStr (\Ptr CFqZech
op -> Ptr CFqZech -> Ptr CFqZechCtx -> IO CString
fq_zech_get_str Ptr CFqZech
op Ptr CFqZechCtx
ctx) Ptr CFqZech
op
forall (m :: * -> *) a. Monad m => a -> m a
return ()
foreign import ccall "fq_zech.h fq_zech_get_str"
fq_zech_get_str :: Ptr CFqZech -> Ptr CFqZechCtx -> IO CString
foreign import ccall "fq_zech.h fq_zech_get_str_pretty"
fq_zech_get_str_pretty :: Ptr CFqZech -> Ptr CFqZechCtx -> IO CString
foreign import ccall "fq_zech.h fq_zech_randtest"
fq_zech_randtest :: Ptr CFqZech -> Ptr CFRandState -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_randtest_not_zero"
fq_zech_randtest_not_zero :: Ptr CFqZech -> Ptr CFRandState -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_rand"
fq_zech_rand :: Ptr CFqZech -> Ptr CFRandState -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_rand_not_zero"
fq_zech_rand_not_zero :: Ptr CFqZech -> Ptr CFRandState -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_set"
fq_zech_set :: Ptr CFqZech -> Ptr CFqZech -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_set_si"
fq_zech_set_si :: Ptr CFqZech -> CLong -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_set_ui"
fq_zech_set_ui :: Ptr CFqZech -> CULong -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_set_fmpz"
fq_zech_set_fmpz :: Ptr CFqZech -> Ptr CFmpz -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_swap"
fq_zech_swap :: Ptr CFqZech -> Ptr CFqZech -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_zero"
fq_zech_zero :: Ptr CFqZech -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_one"
fq_zech_one :: Ptr CFqZech -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_gen"
fq_zech_gen :: Ptr CFqZech -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_get_fmpz"
fq_zech_get_fmpz :: Ptr CFmpz -> Ptr CFqZech -> Ptr CFqZechCtx -> IO CInt
foreign import ccall "fq_zech.h fq_zech_get_fq_nmod"
fq_zech_get_fq_nmod :: Ptr CFqNMod -> Ptr CFqZech -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_set_fq_nmod"
fq_zech_set_fq_nmod :: Ptr CFqZech -> Ptr CFqNMod -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_get_nmod_poly"
fq_zech_get_nmod_poly :: Ptr CNModPoly -> Ptr CFqZech -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_set_nmod_poly"
fq_zech_set_nmod_poly :: Ptr CFqZech -> Ptr CNModPoly -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_get_nmod_mat"
fq_zech_get_nmod_mat :: Ptr CNModMat -> Ptr CFqZech -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_set_nmod_mat"
fq_zech_set_nmod_mat :: Ptr CFqZech -> Ptr CNModMat -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_is_zero"
fq_zech_is_zero :: Ptr CFqZech -> Ptr CFqZechCtx -> IO CInt
foreign import ccall "fq_zech.h fq_zech_is_one"
fq_zech_is_one :: Ptr CFqZech -> Ptr CFqZechCtx -> IO CInt
foreign import ccall "fq_zech.h fq_zech_equal"
fq_zech_equal :: Ptr CFqZech -> Ptr CFqZech -> Ptr CFqZechCtx -> IO CInt
foreign import ccall "fq_zech.h fq_zech_is_invertible"
fq_zech_is_invertible :: Ptr CFqZech -> Ptr CFqZechCtx -> IO CInt
foreign import ccall "fq_zech.h fq_zech_is_invertible_f"
fq_zech_is_invertible_f :: Ptr CFqZech -> Ptr CFqZech -> Ptr CFqZechCtx -> IO CInt
foreign import ccall "fq_zech.h fq_zech_trace"
fq_zech_trace :: Ptr CFmpz -> Ptr CFqZech -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_norm"
fq_zech_norm :: Ptr CFmpz -> Ptr CFqZech -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_frobenius"
fq_zech_frobenius :: Ptr CFqZech -> Ptr CFqZech -> CLong -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_multiplicative_order"
fq_zech_multiplicative_order :: Ptr CFmpz -> Ptr CFqZech -> Ptr CFqZechCtx -> IO CInt
foreign import ccall "fq_zech.h fq_zech_bit_pack"
fq_zech_bit_pack :: Ptr CFmpz -> Ptr CFqZech -> CFBitCnt -> Ptr CFqZechCtx -> IO ()
foreign import ccall "fq_zech.h fq_zech_bit_unpack"
fq_zech_bit_unpack :: Ptr CFqZech -> Ptr CFmpz -> CFBitCnt -> Ptr CFqZechCtx -> IO ()