Portability | portable |
---|---|
Stability | provisional |
Maintainer | Alberto Ruiz <aruiz@um.es> |
Safe Haskell | None |
The library can be easily extended with additional foreign functions
using the tools in this module. Illustrative usage examples can be found
in the examples/devel
folder included in the package.
- createVector :: Storable a => Int -> IO (Vector a)
- createMatrix :: Storable a => MatrixOrder -> Int -> Int -> IO (Matrix a)
- vec :: Storable t => Vector t -> (((CInt -> Ptr t -> t1) -> t1) -> IO b) -> IO b
- mat :: Storable t => Matrix t -> (((CInt -> CInt -> Ptr t -> t1) -> t1) -> IO b) -> IO b
- app1 :: f -> Adapt1 f t1
- app2 :: f -> Adapt2 f t1 r1 t2
- app3 :: f -> Adapt3 f t1 r1 t2 r2 t3
- app4 :: f -> Adapt4 f t1 r1 t2 r2 t3 r3 t4
- app5 :: f -> Adapt5 f t1 r1 t2 r2 t3 r3 t4 r4 t5
- app6 :: f -> Adapt6 f t1 r1 t2 r2 t3 r3 t4 r4 t5 r5 t6
- app7 :: f -> Adapt7 f t1 r1 t2 r2 t3 r3 t4 r4 t5 r5 t6 r6 t7
- app8 :: f -> Adapt8 f t1 r1 t2 r2 t3 r3 t4 r4 t5 r5 t6 r6 t7 r7 t8
- app9 :: f -> Adapt9 f t1 r1 t2 r2 t3 r3 t4 r4 t5 r5 t6 r6 t7 r7 t8 r8 t9
- app10 :: f -> Adapt10 f t1 r1 t2 r2 t3 r3 t4 r4 t5 r5 t6 r6 t7 r7 t8 r8 t9 r9 t10
- data MatrixOrder
- = RowMajor
- | ColumnMajor
- orderOf :: Matrix t -> MatrixOrder
- cmat :: Element t => Matrix t -> Matrix t
- fmat :: Element t => Matrix t -> Matrix t
- matrixFromVector :: Storable t => MatrixOrder -> Int -> Vector t -> Matrix t
- unsafeFromForeignPtr :: Storable a => ForeignPtr a -> Int -> Int -> Vector a
- unsafeToForeignPtr :: Storable a => Vector a -> (ForeignPtr a, Int, Int)
- check :: String -> IO CInt -> IO ()
- (//) :: x -> (x -> y) -> y
- at' :: Storable a => Vector a -> Int -> a
- atM' :: Storable a => Matrix a -> Int -> Int -> a
Documentation
createMatrix :: Storable a => MatrixOrder -> Int -> Int -> IO (Matrix a)Source
orderOf :: Matrix t -> MatrixOrderSource
matrixFromVector :: Storable t => MatrixOrder -> Int -> Vector t -> Matrix tSource
:: Storable a | |
=> ForeignPtr a | pointer |
-> Int | offset |
-> Int | length |
-> Vector a |
O(1) Create a vector from a ForeignPtr
with an offset and a length.
The data may not be modified through the ForeignPtr
afterwards.
If your offset is 0 it is more efficient to use unsafeFromForeignPtr0
.
unsafeToForeignPtr :: Storable a => Vector a -> (ForeignPtr a, Int, Int)
O(1) Yield the underlying ForeignPtr
together with the offset to the
data and its length. The data may not be modified through the ForeignPtr
.