summaryrefslogtreecommitdiff
path: root/lib/Numeric/LinearAlgebra/Data.hs
blob: a3639d5caea6d1ef35edf34cc586e38eb70ffb78 (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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
--------------------------------------------------------------------------------
{- |
Module      :  Numeric.LinearAlgebra.Data
Copyright   :  (c) Alberto Ruiz 2014
License     :  GPL

Maintainer  :  Alberto Ruiz
Stability   :  provisional

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

module Numeric.LinearAlgebra.Data(
    -- * Vector
    -- | 1D arrays are storable vectors from the vector package.
    
    Vector, (|>), dim, (@>),
    
    -- * Matrix
    Matrix, (><), size, (@@>), trans, ctrans,
    
    -- * Construction functions
   
    scalar, konst, build, assoc, accum, linspace, -- ones, zeros,

    -- * Data manipulation
    
    fromList, toList, subVector, takesV, vjoin,
         
    flatten, reshape, asRow, asColumn, row, col,

    fromRows, toRows, fromColumns, toColumns, fromLists, toLists,
    
    takeRows, dropRows, takeColumns, dropColumns, subMatrix, (?), (¿), fliprl, flipud,
    
    -- * Diagonal matrices
    
    ident, diag, diagl, diagRect, takeDiag,
   
    -- * Block matrices

    fromBlocks, (¦), (——), diagBlock, repmat, toBlocks, toBlocksEvery,

    -- * Mapping functions
   
    conj, cmap, step, cond,
    
    -- * Find elements
    
    find, maxIndex, minIndex, maxElement, minElement, atIndex,

    -- * Products
    
    (<>), (·), outer, kronecker, cross,
    sumElements, prodElements, absSum,
    optimiseMult,
    
    corr, conv, corrMin, corr2, conv2,
    
    (<\>),
    
    -- * Random arrays

    rand, randn, RandDist(..), randomVector, gaussianSample, uniformSample,
    
    -- * IO
    
    disp, dispf, disps, dispcf, vecdisp, latexFormat, format,
    loadMatrix, saveMatrix, fromFile, fileDimensions,
    readMatrix,
    fscanfVector, fprintfVector, freadVector, fwriteVector,

-- * Element conversion
    Convert(..),
    Complexable(),
    RealElement(),

    RealOf, ComplexOf, SingleOf, DoubleOf,

    IndexOf,
    
    module Data.Complex,

    -- * Misc
    scale, meanCov, arctan2,
    rows, cols,
    separable,
    fromArray2D

) where

import Data.Packed.Vector
import Data.Packed.Matrix
import Numeric.Container
import Numeric.LinearAlgebra.Util
import Data.Complex