Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data MpfrMat = MpfrMat !(ForeignPtr CMpfrMat)
- data CMpfrMat = CMpfrMat (Ptr CMpfr) CLong CLong (Ptr (Ptr CMpfr))
- newMpfrMat :: CLong -> CLong -> CMpfrPrec -> IO MpfrMat
- withMpfrMat :: MpfrMat -> (Ptr CMpfrMat -> IO a) -> IO (MpfrMat, a)
- withNewMpfrMat :: CLong -> CLong -> CMpfrPrec -> (Ptr CMpfrMat -> IO a) -> IO (MpfrMat, a)
- mpfr_mat_init :: Ptr CMpfrMat -> CLong -> CLong -> CMpfrPrec -> IO ()
- mpfr_mat_clear :: Ptr CMpfrMat -> IO ()
- mpfr_mat_swap :: Ptr CMpfrMat -> Ptr CMpfrMat -> IO ()
- mpfr_mat_swap_entrywise :: Ptr CMpfrMat -> Ptr CMpfrMat -> IO ()
- mpfr_mat_entry :: Ptr CMpfrMat -> CLong -> CLong -> IO (Ptr CMpfr)
- mpfr_mat_set :: Ptr CMpfrMat -> Ptr CMpfrMat -> IO ()
- mpfr_mat_zero :: Ptr CMpfrMat -> IO ()
- mpfr_mat_equal :: Ptr CMpfrMat -> Ptr CMpfrMat -> IO CInt
- mpfr_mat_randtest :: Ptr CMpfrMat -> Ptr CFRandState -> IO ()
- mpfr_mat_mul_classical :: Ptr CMpfrMat -> Ptr CMpfrMat -> Ptr CMpfrMat -> CMpfrRnd -> IO ()
Matrices of MPFR floating-point numbers
Instances
Storable CMpfrMat Source # | |
Defined in Data.Number.Flint.Support.Mpfr.Mat.FFI |
Memory management
mpfr_mat_init :: Ptr CMpfrMat -> CLong -> CLong -> CMpfrPrec -> IO () Source #
mpfr_mat_init mat rows cols prec
Initialises a matrix with the given number of rows and columns and the given precision for use. The precision is the exact precision of the entries.
Basic manipulation
mpfr_mat_swap :: Ptr CMpfrMat -> Ptr CMpfrMat -> IO () Source #
mpfr_mat_swap mat1 mat2
Efficiently swap matrices mat1
and mat2
.
mpfr_mat_swap_entrywise :: Ptr CMpfrMat -> Ptr CMpfrMat -> IO () Source #
mpfr_mat_swap_entrywise mat1 mat2
Swaps two matrices by swapping the individual entries rather than swapping the contents of the structs.
mpfr_mat_set :: Ptr CMpfrMat -> Ptr CMpfrMat -> IO () Source #
mpfr_mat_set mat1 mat2
Set mat1
to the value of mat2
.
Comparison
mpfr_mat_equal :: Ptr CMpfrMat -> Ptr CMpfrMat -> IO CInt Source #
mpfr_mat_equal mat1 mat2
Return \(1\) if the two given matrices are equal, otherwise return \(0\).
Randomisation
mpfr_mat_randtest :: Ptr CMpfrMat -> Ptr CFRandState -> IO () Source #
mpfr_mat_randtest mat state
Generate a random matrix with random number of rows and columns and random entries for use in test code.