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

Data.Number.Flint.Support.Mpfr.Vec

Synopsis

Vectors of MPFR floating-point numbers

Memory management

_mpfr_vec_init :: CLong -> CFBitCnt -> IO (Ptr CMpfr) Source #

_mpfr_vec_init len prec

Returns a vector of the given length of initialised mpfr's with the given exact precision.

_mpfr_vec_clear :: Ptr CMpfr -> CLong -> IO () Source #

_mpfr_vec_clear vec len

Clears the given vector.

Arithmetic

_mpfr_vec_zero :: Ptr CMpfr -> CLong -> IO () Source #

_mpfr_vec_zero vec len

Zeros the vector (vec, len).

_mpfr_vec_set :: Ptr CMpfr -> Ptr CMpfr -> CLong -> IO () Source #

_mpfr_vec_set vec1 vec2 len

Copies the vector vec2 of the given length into vec1. No check is made to ensure vec1 and vec2 are different.

_mpfr_vec_add :: Ptr CMpfr -> Ptr CMpfr -> Ptr CMpfr -> CLong -> IO () Source #

_mpfr_vec_add res vec1 vec2 len

Adds the given vectors of the given length together and stores the result in res.

_mpfr_vec_scalar_mul_mpfr :: Ptr CMpfr -> Ptr CMpfr -> CLong -> Ptr CMpfr -> IO () Source #

_mpfr_vec_scalar_mul_mpfr res vec len c

Multiplies the vector with given length by the scalar \(c\) and sets res to the result.

_mpfr_vec_scalar_mul_2exp :: Ptr CMpfr -> Ptr CMpfr -> CLong -> CFBitCnt -> IO () Source #

_mpfr_vec_scalar_mul_2exp res vec len exp

Multiplies the given vector of the given length by 2^exp.

_mpfr_vec_scalar_product :: Ptr CMpfr -> Ptr CMpfr -> Ptr CMpfr -> CLong -> IO () Source #

_mpfr_vec_scalar_product res vec1 vec2 len

Sets res to the scalar product of (vec1, len) with (vec2, len). Assumes len > 0.