|
Data.Packed.Internal.Vector | Portability | portable (uses FFI) | Stability | provisional | Maintainer | Alberto Ruiz <aruiz@um.es> |
|
|
|
Description |
Vector implementation
|
|
Synopsis |
|
|
|
Documentation |
|
|
A one-dimensional array of objects stored in a contiguous memory block.
| Constructors | V | | dim :: Int | number of elements
| fptr :: ForeignPtr t | foreign pointer to the memory block
|
|
| Instances | |
|
|
|
signature of foreign functions admitting C-style vectors
|
|
|
allocates memory for a new vector
|
|
|
creates a Vector from a list:
> fromList [2,3,5,7]
4 |> [2.0,3.0,5.0,7.0] |
|
|
extracts the Vector elements to a list
> toList (linspace 5 (1,10))
[1.0,3.25,5.5,7.75,10.0] |
|
|
an alternative to fromList with explicit dimension, used also in the instances for Show (Vector a).
|
|
|
access to Vector elements without range checking
|
|
|
access to Vector elements with range checking.
|
|
|
:: Storable t | | => Int | index of the starting element
| -> Int | number of elements to extract
| -> Vector t | source
| -> Vector t | result
| takes a number of consecutive elements from a Vector
> subVector 2 3 (fromList [1..10])
3 |> [3.0,4.0,5.0] |
|
|
|
Reads a vector position:
> fromList [0..9] @> 7
7.0 |
|
|
creates a new Vector by joining a list of Vectors
> join [fromList [1..5], constant 1 3]
8 |> [1.0,2.0,3.0,4.0,5.0,1.0,1.0,1.0] |
|
|
transforms a complex vector into a real vector with alternating real and imaginary parts
|
|
|
transforms a real vector into a complex vector with alternating real and imaginary parts
|
|
|
map on Vectors
|
|
|
zipWith for Vectors
|
|
Produced by Haddock version 2.4.2 |