
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 0based.
 Constructors  DV   storageOf :: !!(ForeignPtr e)  a pointer to the storage region
 offsetOf :: !!Int  an offset (in elements, not bytes) to the first element in the vector.
 lengthOf :: !!Int  the length of the vector
 strideOf :: !!Int  the stride (in elements, not bytes) between elements.
 isConj :: !!Bool  indicates whether or not the vector is conjugated


 Instances  


module BLAS.Vector 

module BLAS.Tensor 

Conversion to and from ForeignPtrs.



fromForeignPtr fptr offset n inc c creates a vector view of a
region in memory starting at the given offset and having dimension n,
with a stride of inc, and with isConj set to c.



Gets the tuple (fptr,offset,n,inc,c), where n is the dimension and
inc is the stride of the vector, and c indicates whether or not the
vector is conjugated.


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 passedin 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 rangechecked.



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 rangechecked.



Same as subvectorWithStride but arguments are not rangechecked.



Cast the access type to Imm.



Cast the access type to Mut.


Produced by Haddock version 2.3.0 