Flint2-0.1.0.5: Haskell bindings for the flint library for number theory
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Number.Flint.Support.Mpfr.Mat

Synopsis

Matrices of MPFR floating-point numbers

data MpfrMat Source #

Constructors

MpfrMat !(ForeignPtr CMpfrMat) 

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.

mpfr_mat_clear :: Ptr CMpfrMat -> IO () Source #

mpfr_mat_clear mat

Clears the given matrix.

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.

mpfr_mat_zero :: Ptr CMpfrMat -> IO () Source #

mpfr_mat_zero mat

Set mat to the zero matrix.

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.

Basic arithmetic

mpfr_mat_mul_classical :: Ptr CMpfrMat -> Ptr CMpfrMat -> Ptr CMpfrMat -> CMpfrRnd -> IO () Source #

mpfr_mat_mul_classical C A B rnd

Set \(C\) to the product of \(A\) and \(B\) with the given rounding mode, using the classical algorithm.