Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Acf = Acf !(ForeignPtr CAcf)
- data CAcf = CAcf CArf CArf
- newAcf :: IO Acf
- withAcf :: Acf -> (Ptr CAcf -> IO a) -> IO (Acf, a)
- withNewAcf :: (Ptr CAcf -> IO a) -> IO (Acf, a)
- acf_init :: Ptr CAcf -> IO ()
- acf_clear :: Ptr CAcf -> IO ()
- acf_swap :: Ptr CAcf -> Ptr CAcf -> IO ()
- acf_allocated_bytes :: Ptr CAcf -> IO CLong
- acf_real_ptr :: Ptr CAcf -> IO (Ptr CArf)
- acf_imag_ptr :: Ptr CAcf -> IO (Ptr CArf)
- acf_set :: Ptr CAcf -> Ptr CAcf -> IO ()
- acf_equal :: Ptr CAcf -> Ptr CAcf -> IO CInt
- acf_add :: Ptr CAcf -> Ptr CAcf -> Ptr CAcf -> CLong -> ArfRnd -> IO CInt
- acf_sub :: Ptr CAcf -> Ptr CAcf -> Ptr CAcf -> CLong -> ArfRnd -> IO CInt
- acf_mul :: Ptr CAcf -> Ptr CAcf -> Ptr CAcf -> CLong -> ArfRnd -> IO CInt
- acf_approx_inv :: Ptr CAcf -> Ptr CAcf -> CLong -> ArfRnd -> IO ()
- acf_approx_div :: Ptr CAcf -> Ptr CAcf -> Ptr CAcf -> CLong -> ArfRnd -> IO ()
- acf_approx_sqrt :: Ptr CAcf -> Ptr CAcf -> CLong -> ArfRnd -> IO ()
- acf_approx_dot :: Ptr CAcf -> Ptr CAcf -> CInt -> Ptr CAcf -> CLong -> Ptr CAcf -> CLong -> CLong -> CLong -> ArfRnd -> IO ()
Complex floating-point numbers
An Acf structure consists of a pair of arf_struct:s. An acf_t is defined as an array of length one of type acf_struct, permitting an acf_t to be passed by reference.
Acf !(ForeignPtr CAcf) |
Instances
Storable CAcf Source # | |
Defined in Data.Number.Flint.Acb.Acf.FFI |
withAcf :: Acf -> (Ptr CAcf -> IO a) -> IO (Acf, a) Source #
Access to the C pointer in Acf
structure.
Memory management
acf_init :: Ptr CAcf -> IO () Source #
acf_init x
Initializes the variable x for use, and sets its value to zero.
acf_clear :: Ptr CAcf -> IO () Source #
acf_clear x
Clears the variable x, freeing or recycling its allocated memory.
acf_allocated_bytes :: Ptr CAcf -> IO CLong Source #
acf_allocated_bytes x
Returns the total number of bytes heap-allocated internally by this
object. The count excludes the size of the structure itself. Add
sizeof(acf_struct)
to get the size of the object as a whole.
Basic manipulation
acf_imag_ptr :: Ptr CAcf -> IO (Ptr CArf) Source #
acf_imag_ptr z
Returns a pointer to the real or imaginary part of z.
acf_equal :: Ptr CAcf -> Ptr CAcf -> IO CInt Source #
acf_equal x y
Returns whether x and y are equal.
Arithmetic
acf_add :: Ptr CAcf -> Ptr CAcf -> Ptr CAcf -> CLong -> ArfRnd -> IO CInt Source #
acf_add res x y prec rnd
acf_sub :: Ptr CAcf -> Ptr CAcf -> Ptr CAcf -> CLong -> ArfRnd -> IO CInt Source #
acf_sub res x y prec rnd
acf_mul :: Ptr CAcf -> Ptr CAcf -> Ptr CAcf -> CLong -> ArfRnd -> IO CInt Source #
acf_mul res x y prec rnd
Sets res to the sum, difference or product of x or y, correctly rounding the real and imaginary parts in direction rnd. The return flag has the least significant bit set if the real part is inexact, and the second least significant bit set if the imaginary part is inexact.
Approximate arithmetic
acf_approx_inv :: Ptr CAcf -> Ptr CAcf -> CLong -> ArfRnd -> IO () Source #
acf_approx_inv res x prec rnd
acf_approx_div :: Ptr CAcf -> Ptr CAcf -> Ptr CAcf -> CLong -> ArfRnd -> IO () Source #
acf_approx_div res x y prec rnd