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

Data.Number.Flint.Acb.Acf

Synopsis

Complex floating-point numbers

data Acf Source #

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.

Constructors

Acf !(ForeignPtr CAcf) 

data CAcf Source #

Constructors

CAcf CArf CArf 

Instances

Instances details
Storable CAcf Source # 
Instance details

Defined in Data.Number.Flint.Acb.Acf.FFI

Methods

sizeOf :: CAcf -> Int #

alignment :: CAcf -> Int #

peekElemOff :: Ptr CAcf -> Int -> IO CAcf #

pokeElemOff :: Ptr CAcf -> Int -> CAcf -> IO () #

peekByteOff :: Ptr b -> Int -> IO CAcf #

pokeByteOff :: Ptr b -> Int -> CAcf -> IO () #

peek :: Ptr CAcf -> IO CAcf #

poke :: Ptr CAcf -> CAcf -> IO () #

newAcf :: IO Acf Source #

Createst a new CAcf structure encapsulated in Acf.

withAcf :: Acf -> (Ptr CAcf -> IO a) -> IO (Acf, a) Source #

Access to the C pointer in Acf structure.

withNewAcf :: (Ptr CAcf -> IO a) -> IO (Acf, a) Source #

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_swap :: Ptr CAcf -> Ptr CAcf -> IO () Source #

acf_swap z x

Swaps z and x efficiently.

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_real_ptr :: Ptr CAcf -> IO (Ptr CArf) Source #

acf_real_ptr z

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_set :: Ptr CAcf -> Ptr CAcf -> IO () Source #

acf_set z x

Sets z to the value x.

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

acf_approx_sqrt :: Ptr CAcf -> Ptr CAcf -> CLong -> ArfRnd -> IO () Source #

acf_approx_sqrt res x prec rnd

Computes an approximate inverse, quotient or square root.

acf_approx_dot :: Ptr CAcf -> Ptr CAcf -> CInt -> Ptr CAcf -> CLong -> Ptr CAcf -> CLong -> CLong -> CLong -> ArfRnd -> IO () Source #

acf_approx_dot res initial subtract x xstep y ystep len prec rnd

Computes an approximate dot product, with the same meaning of the parameters as arb_dot.