|
Data.Vector.Dense.Internal | Stability | experimental | Maintainer | Patrick Perry <patperry@stanford.edu> |
|
|
|
|
|
Description |
|
|
Synopsis |
|
|
|
|
Vector data types
|
|
|
|
|
|
|
A dense vector. t is a type that will usually be Imm or Mut.
n is a phantom type for the dimension of the vector, and e is the
element type. A DVector x stores dim x elements. Indices into
the vector are 0-based.
| Constructors | DV | | fptr :: !(ForeignPtr e) | a pointer to the storage region
| offset :: !Int | an offset (in elements, not bytes) to the first element in the vector.
| len :: !Int | the length of the vector
| stride :: !Int | the stride (in elements, not bytes) between elements.
|
| C !(DVector t n e) | a conjugated vector
|
| Instances | |
|
|
module BLAS.Vector |
|
module BLAS.Tensor |
|
Conversion to and from ForeignPtrs.
|
|
|
fromForeignPtr fptr offset n inc creates a vector view of a
region in memory starting at the given offset and having dimension n,
with a stride of inc.
|
|
|
Gets the tuple (fptr,offset,n,inc), where n is the dimension and
inc is the stride of the vector. Note that this does not return the
conjugacy information of the vector. For that information, use isConj.
|
|
|
Indicates whether or not the vector has been conjugated. For
newly-created vectors, this will be False.
|
|
|
Gets the stride of the vector.
|
|
Creating new vectors
|
|
|
Creates a new vector with the given association list. Unspecified
indices will get initialized to zero.
|
|
|
Creates a new vector of the given length. The elements will be
uninitialized.
|
|
|
Creates a new vector of the given dimension with the given elements.
If the list has length less than the passed-in dimenson, the tail of
the vector will be uninitialized.
|
|
Special vectors
|
|
|
newBasis n i creates a vector of length n that is all zero except for
at position i, where it equal to one.
|
|
|
setBasis x i sets the ith coordinate of x to 1, and all other
coordinates to 0. If the vector has been scaled, it is possible that
readVector x i will not return exactly 1. See setElem.
|
|
Vector views
|
|
|
subvector x o n creates a subvector view of x starting at index o
and having length n.
|
|
|
subvectorWithStride s x o n creates a subvector view of x starting
at index o, having length n and stride s.
|
|
Casting vectors
|
|
|
Cast the phantom length type.
|
|
Unsafe operations
|
|
|
Same as newVector but indices are not range-checked.
|
|
|
Evaluate a function with a pointer to the value stored at the given
index. Note that the value may need to conjugated before using it. See
isConj.
|
|
|
Same as subvector but arguments are not range-checked.
|
|
|
Same as subvectorWithStride but arguments are not range-checked.
|
|
|
Cast the access type to Imm.
|
|
|
Cast the access type to Mut.
|
|
Produced by Haddock version 2.3.0 |