summaryrefslogtreecommitdiff
path: root/packages/base/src/Numeric/LinearAlgebra/Devel.hs
blob: 4d5b5cbefbe21bafd1578375b3945a69c83af5ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
--------------------------------------------------------------------------------
{- |
Module      :  Numeric.HMatrix.Devel
Copyright   :  (c) Alberto Ruiz 2014
License     :  BSD3
Maintainer  :  Alberto Ruiz
Stability   :  provisional

The library can be easily extended using the tools in this module.

-}
--------------------------------------------------------------------------------

module Numeric.LinearAlgebra.Devel(
    -- * FFI helpers
    -- | Sample usage, to upload a perspective matrix to a shader.
    --
    -- @ glUniformMatrix4fv 0 1 (fromIntegral gl_TRUE) \`appMatrix\` perspective 0.01 100 (pi\/2) (4\/3)
    -- @
    module Internal.Foreign,

    -- * FFI tools
    -- | Illustrative usage examples can be found
    --   in the @examples\/devel@ folder included in the package.
    
    createVector, createMatrix,
    vec, mat, omat,
    app1, app2, app3, app4,
    app5, app6, app7, app8, app9, app10,
    MatrixOrder(..), orderOf, cmat, fmat,
    matrixFromVector,
    unsafeFromForeignPtr,
    unsafeToForeignPtr,
    check, (//),
    at', atM', fi, ti,

    -- * ST
    -- | In-place manipulation inside the ST monad.
    -- See examples\/inplace.hs in the distribution.
    
    -- ** Mutable Vectors
    STVector, newVector, thawVector, freezeVector, runSTVector,
    readVector, writeVector, modifyVector, liftSTVector,
    -- ** Mutable Matrices
    STMatrix, newMatrix, thawMatrix, freezeMatrix, runSTMatrix,
    readMatrix, writeMatrix, modifyMatrix, liftSTMatrix,
    -- ** Unsafe functions
    newUndefinedVector,
    unsafeReadVector, unsafeWriteVector,
    unsafeThawVector, unsafeFreezeVector,
    newUndefinedMatrix,
    unsafeReadMatrix, unsafeWriteMatrix,
    unsafeThawMatrix, unsafeFreezeMatrix,

    -- * Special maps and zips
    mapVectorWithIndex, zipVector, zipVectorWith, unzipVector, unzipVectorWith,
    mapVectorM, mapVectorM_, mapVectorWithIndexM, mapVectorWithIndexM_,
    foldLoop, foldVector, foldVectorG, foldVectorWithIndex,
    mapMatrixWithIndex, mapMatrixWithIndexM, mapMatrixWithIndexM_,
    liftMatrix, liftMatrix2, liftMatrix2Auto,

    -- * Sparse representation
    CSR(..), fromCSR, mkCSR,
    GMatrix(..),

    -- * Misc
    toByteString, fromByteString

) where

import Internal.Tools
import Internal.Foreign
import Internal.Devel
import Internal.ST
import Internal.Vector
import Internal.Matrix
import Internal.Element
import Internal.Sparse
import Data.Vector.Storable (unsafeToForeignPtr, unsafeFromForeignPtr )