hblas-0.1.0.0: BLAS and Lapack bindings for OpenBLAS

Safe HaskellNone
LanguageHaskell2010

Numerical.HBLAS.MatrixTypes

Synopsis

Documentation

data Orientation Source

PSA, the matrix data types used in the hOpenBLAS binding should not be regarded as being general purpose matrices.

They are designed to exactly express only the matrices which are valid inputs for BLAS. When applicable, such matrices should be easily mapped to and from other matrix libraries. That said, the BLAS and LAPACK matrix formats capture a rich and very expressive subset of Dense Matrix formats.

The primary and hence default format is Dense Row and Column Major Matrices, but support will be added for other formats that BLAS and LAPACK provide operations for.

A guiding rule of thumb for this package is that there are no generic abstractions provided, merely machinery to ensure all uses of BLAS and LAPACK operations can be used in their full generality in a human friendly type safe fashion. It is the role of a higher leve library to provide any generic operations.

Constructors

Row 
Column 

type family TransposeF x :: Orientation Source

Instances

data DenseMatrix :: Orientation -> * -> * where Source

DenseMatrix is for dense row or column major matrices

Constructors

DenseMatrix :: SOrientation ornt -> !Int -> !Int -> !Int -> !(Vector elem) -> DenseMatrix ornt elem 

Instances

(Show el, Storable el) => Show (DenseMatrix Column el) 
(Show el, Storable el) => Show (DenseMatrix Row el) 

data MutDenseMatrix :: * -> Orientation -> * -> * where Source

MDenseMatrix

Constructors

MutableDenseMatrix :: SOrientation ornt -> !Int -> !Int -> !Int -> !(MVector s elem) -> MutDenseMatrix s ornt elem 

uncheckedDenseMatrixIndex :: Storable elem => DenseMatrix or elem -> (Int, Int) -> elem Source

uncheckedDenseMatrixIndexM :: (Monad m, Storable elem) => DenseMatrix or elem -> (Int, Int) -> m elem Source

swap :: (a, b) -> (b, a) Source

mapDenseMatrix :: (Storable a, Storable b) => (a -> b) -> DenseMatrix or a -> DenseMatrix or b Source

imapDenseMatrix :: (Storable a, Storable b) => ((Int, Int) -> a -> b) -> DenseMatrix or a -> DenseMatrix or b Source

uncheckedDenseMatrixNextTuple :: DenseMatrix or elem -> (Int, Int) -> Maybe (Int, Int) Source

In Matrix format memory order enumeration of the index tuples, for good locality 2dim map

uncheckedDenseMatrixSlice :: Storable elem => DenseMatrix or elem -> (Int, Int) -> (Int, Int) -> DenseMatrix or elem Source

transposeDenseMatrix :: (inor ~ TransposeF outor, outor ~ TransposeF inor) => DenseMatrix inor elem -> DenseMatrix outor elem Source

tranposeMatrix does a shallow transpose that swaps the format and the x y params, but changes nothing in the memory layout. Most applications where transpose is used in a computation need a deep, copying, tranpose operation