hmatrix-0.20.2: Numeric Linear Algebra
Copyright(c) Alberto Ruiz 2015
LicenseBSD3
MaintainerAlberto Ruiz
Stabilityprovisional
Safe HaskellNone
LanguageHaskell2010

Numeric.LinearAlgebra.Data

Description

This module provides functions for creation and manipulation of vectors and matrices, IO, and other utilities.

Synopsis

Elements

type R = Double Source #

type C = Complex Double Source #

type I = CInt Source #

type Z = Int64 Source #

type (./.) x (n :: Nat) = Mod n x infixr 5 Source #

Vector

1D arrays are storable vectors directly reexported from the vector package.

fromList :: Storable a => [a] -> Vector a #

toList :: Storable a => Vector a -> [a] Source #

(|>) :: Storable a => Int -> [a] -> Vector a infixl 9 Source #

Create a vector from a list of elements and explicit dimension. The input list is truncated if it is too long, so it may safely be used, for instance, with infinite lists.

>>> 5 |> [1..]
[1.0,2.0,3.0,4.0,5.0]
it :: (Enum a, Num a, Foreign.Storable.Storable a) => Vector a

vector :: [R] -> Vector R Source #

Create a real vector.

>>> vector [1..5]
[1.0,2.0,3.0,4.0,5.0]
it :: Vector R

range :: Int -> Vector I Source #

>>> range 5
[0,1,2,3,4]
it :: Vector I

idxs :: [Int] -> Vector I Source #

Create a vector of indexes, useful for matrix extraction using (??)

Matrix

The main data type of hmatrix is a 2D dense array defined on top of a storable vector. The internal representation is suitable for direct interface with standard numeric libraries.

(><) :: Storable a => Int -> Int -> [a] -> Matrix a Source #

Create a matrix from a list of elements

>>> (2><3) [2, 4, 7+2*iC,   -3, 11, 0]
(2><3)
 [       2.0 :+ 0.0,  4.0 :+ 0.0, 7.0 :+ 2.0
 , (-3.0) :+ (-0.0), 11.0 :+ 0.0, 0.0 :+ 0.0 ]

The input list is explicitly truncated, so that it can safely be used with lists that are too long (like infinite lists).

>>> (2><3)[1..]
(2><3)
 [ 1.0, 2.0, 3.0
 , 4.0, 5.0, 6.0 ]

This is the format produced by the instances of Show (Matrix a), which can also be used for input.

matrix Source #

Arguments

:: Int

number of columns

-> [R]

elements in row order

-> Matrix R 

Create a real matrix.

>>> matrix 5 [1..15]
(3><5)
 [  1.0,  2.0,  3.0,  4.0,  5.0
 ,  6.0,  7.0,  8.0,  9.0, 10.0
 , 11.0, 12.0, 13.0, 14.0, 15.0 ]

tr :: Transposable m mt => m -> mt Source #

conjugate transpose

tr' :: Transposable m mt => m -> mt Source #

transpose

Dimensions

size :: Container c t => c t -> IndexOf c Source #

>>> size $ vector [1..10]
10
>>> size $ (2><5)[1..10::Double]
(2,5)

rows :: Matrix t -> Int Source #

cols :: Matrix t -> Int Source #

Conversion from/to lists

fromLists :: Element t => [[t]] -> Matrix t Source #

Creates a Matrix from a list of lists (considered as rows).

>>> fromLists [[1,2],[3,4],[5,6]]
(3><2)
 [ 1.0, 2.0
 , 3.0, 4.0
 , 5.0, 6.0 ]

toLists :: Element t => Matrix t -> [[t]] Source #

the inverse of fromLists

row :: [Double] -> Matrix Double Source #

create a single row real matrix from a list

>>> row [2,3,1,8]
(1><4)
 [ 2.0, 3.0, 1.0, 8.0 ]

col :: [Double] -> Matrix Double Source #

create a single column real matrix from a list

>>> col [7,-2,4]
(3><1)
 [  7.0
 , -2.0
 ,  4.0 ]

Conversions vector/matrix

flatten :: Element t => Matrix t -> Vector t Source #

Creates a vector by concatenation of rows. If the matrix is ColumnMajor, this operation requires a transpose.

>>> flatten (ident 3)
[1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0]
it :: (Num t, Element t) => Vector t

reshape :: Storable t => Int -> Vector t -> Matrix t Source #

Creates a matrix from a vector by grouping the elements in rows with the desired number of columns. (GNU-Octave groups by columns. To do it you can define reshapeF r = tr' . reshape r where r is the desired number of rows.)

>>> reshape 4 (fromList [1..12])
(3><4)
 [ 1.0,  2.0,  3.0,  4.0
 , 5.0,  6.0,  7.0,  8.0
 , 9.0, 10.0, 11.0, 12.0 ]

asRow :: Storable a => Vector a -> Matrix a Source #

creates a 1-row matrix from a vector

>>> asRow (fromList [1..5])
 (1><5)
  [ 1.0, 2.0, 3.0, 4.0, 5.0 ]

asColumn :: Storable a => Vector a -> Matrix a Source #

creates a 1-column matrix from a vector

>>> asColumn (fromList [1..5])
(5><1)
 [ 1.0
 , 2.0
 , 3.0
 , 4.0
 , 5.0 ]

fromRows :: Element t => [Vector t] -> Matrix t Source #

Create a matrix from a list of vectors. All vectors must have the same dimension, or dimension 1, which is are automatically expanded.

toRows :: Element t => Matrix t -> [Vector t] Source #

extracts the rows of a matrix as a list of vectors

fromColumns :: Element t => [Vector t] -> Matrix t Source #

Creates a matrix from a list of vectors, as columns

toColumns :: Element t => Matrix t -> [Vector t] Source #

Creates a list of vectors from the columns of a matrix

Indexing

atIndex :: Container c e => c e -> IndexOf c -> e Source #

generic indexing function

>>> vector [1,2,3] `atIndex` 1
2.0
>>> matrix 3 [0..8] `atIndex` (2,0)
6.0

class Indexable c t | c -> t, t -> c where Source #

Alternative indexing function.

>>> vector [1..10] ! 3
4.0

On a matrix it gets the k-th row as a vector:

>>> matrix 5 [1..15] ! 1
[6.0,7.0,8.0,9.0,10.0]
it :: Vector Double
>>> matrix 5 [1..15] ! 1 ! 3
9.0

Methods

(!) :: c -> Int -> t infixl 9 Source #

Instances

Instances details
Indexable (Vector I) I Source # 
Instance details

Defined in Internal.Util

Methods

(!) :: Vector I -> Int -> I Source #

Indexable (Vector Z) Z Source # 
Instance details

Defined in Internal.Util

Methods

(!) :: Vector Z -> Int -> Z Source #

Indexable (Vector Double) Double Source # 
Instance details

Defined in Internal.Util

Methods

(!) :: Vector Double -> Int -> Double Source #

Indexable (Vector Float) Float Source # 
Instance details

Defined in Internal.Util

Methods

(!) :: Vector Float -> Int -> Float Source #

Element t => Indexable (Matrix t) (Vector t) Source # 
Instance details

Defined in Internal.Util

Methods

(!) :: Matrix t -> Int -> Vector t Source #

Indexable (Vector (Complex Double)) (Complex Double) Source # 
Instance details

Defined in Internal.Util

Methods

(!) :: Vector (Complex Double) -> Int -> Complex Double Source #

Indexable (Vector (Complex Float)) (Complex Float) Source # 
Instance details

Defined in Internal.Util

Methods

(!) :: Vector (Complex Float) -> Int -> Complex Float Source #

(Storable t, Indexable (Vector t) t) => Indexable (Vector (Mod m t)) (Mod m t) Source # 
Instance details

Defined in Internal.Modular

Methods

(!) :: Vector (Mod m t) -> Int -> Mod m t Source #

Construction

scalar :: Container c e => e -> c e Source #

create a structure with a single element

>>> let v = fromList [1..3::Double]
>>> v / scalar (norm2 v)
fromList [0.2672612419124244,0.5345224838248488,0.8017837257372732]

class Konst e d (c :: Type -> Type) | d -> c, c -> d where Source #

Methods

konst :: e -> d -> c e Source #

>>> konst 7 3 :: Vector Float
fromList [7.0,7.0,7.0]
>>> konst i (3::Int,4::Int)
(3><4)
 [ 0.0 :+ 1.0, 0.0 :+ 1.0, 0.0 :+ 1.0, 0.0 :+ 1.0
 , 0.0 :+ 1.0, 0.0 :+ 1.0, 0.0 :+ 1.0, 0.0 :+ 1.0
 , 0.0 :+ 1.0, 0.0 :+ 1.0, 0.0 :+ 1.0, 0.0 :+ 1.0 ]

Instances

Instances details
Container Vector e => Konst e Int Vector Source # 
Instance details

Defined in Internal.Numeric

Methods

konst :: e -> Int -> Vector e Source #

(Num e, Container Vector e) => Konst e (Int, Int) Matrix Source # 
Instance details

Defined in Internal.Numeric

Methods

konst :: e -> (Int, Int) -> Matrix e Source #

class Build d f (c :: Type -> Type) e | d -> c, c -> d, f -> e, f -> d, f -> c, c e -> f, d e -> f where Source #

Methods

build :: d -> f -> c e Source #

>>> build 5 (**2) :: Vector Double
[0.0,1.0,4.0,9.0,16.0]
it :: Vector Double

Hilbert matrix of order N:

>>> let hilb n = build (n,n) (\i j -> 1/(i+j+1)) :: Matrix Double
>>> putStr . dispf 2 $ hilb 3
3x3
1.00  0.50  0.33
0.50  0.33  0.25
0.33  0.25  0.20

Instances

Instances details
Container Vector e => Build Int (e -> e) Vector e Source # 
Instance details

Defined in Internal.Container

Methods

build :: Int -> (e -> e) -> Vector e Source #

(Num e, Container Vector e) => Build (Int, Int) (e -> e -> e) Matrix e Source # 
Instance details

Defined in Internal.Container

Methods

build :: (Int, Int) -> (e -> e -> e) -> Matrix e Source #

assoc Source #

Arguments

:: Container c e 
=> IndexOf c

size

-> e

default value

-> [(IndexOf c, e)]

association list

-> c e

result

Create a structure from an association list

>>> assoc 5 0 [(3,7),(1,4)] :: Vector Double
fromList [0.0,4.0,0.0,7.0,0.0]
>>> assoc (2,3) 0 [((0,2),7),((1,0),2*i-3)] :: Matrix (Complex Double)
(2><3)
 [    0.0 :+ 0.0, 0.0 :+ 0.0, 7.0 :+ 0.0
 , (-3.0) :+ 2.0, 0.0 :+ 0.0, 0.0 :+ 0.0 ]

accum Source #

Arguments

:: Container c e 
=> c e

initial structure

-> (e -> e -> e)

update function

-> [(IndexOf c, e)]

association list

-> c e

result

Modify a structure using an update function

>>> accum (ident 5) (+) [((1,1),5),((0,3),3)] :: Matrix Double
(5><5)
 [ 1.0, 0.0, 0.0, 3.0, 0.0
 , 0.0, 6.0, 0.0, 0.0, 0.0
 , 0.0, 0.0, 1.0, 0.0, 0.0
 , 0.0, 0.0, 0.0, 1.0, 0.0
 , 0.0, 0.0, 0.0, 0.0, 1.0 ]

computation of histogram:

>>> accum (konst 0 7) (+) (map (flip (,) 1) [4,5,4,1,5,2,5]) :: Vector Double
fromList [0.0,1.0,1.0,0.0,2.0,3.0,0.0]

linspace :: (Fractional e, Container Vector e) => Int -> (e, e) -> Vector e Source #

Creates a real vector containing a range of values:

>>> linspace 5 (-3,7::Double)
[-3.0,-0.5,2.0,4.5,7.0]
it :: Vector Double
>>> linspace 5 (8,3:+2) :: Vector (Complex Double)
[8.0 :+ 0.0,6.75 :+ 0.5,5.5 :+ 1.0,4.25 :+ 1.5,3.0 :+ 2.0]
it :: Vector (Complex Double)

Logarithmic spacing can be defined as follows:

logspace n (a,b) = 10 ** linspace n (a,b)

Diagonal

ident :: (Num a, Element a) => Int -> Matrix a Source #

creates the identity matrix of given dimension

diag :: (Num a, Element a) => Vector a -> Matrix a Source #

Creates a square matrix with a given diagonal.

diagl :: [Double] -> Matrix Double Source #

create a real diagonal matrix from a list

>>> diagl [1,2,3]
(3><3)
 [ 1.0, 0.0, 0.0
 , 0.0, 2.0, 0.0
 , 0.0, 0.0, 3.0 ]

diagRect :: Storable t => t -> Vector t -> Int -> Int -> Matrix t Source #

creates a rectangular diagonal matrix:

>>> diagRect 7 (fromList [10,20,30]) 4 5 :: Matrix Double
(4><5)
 [ 10.0,  7.0,  7.0, 7.0, 7.0
 ,  7.0, 20.0,  7.0, 7.0, 7.0
 ,  7.0,  7.0, 30.0, 7.0, 7.0
 ,  7.0,  7.0,  7.0, 7.0, 7.0 ]

takeDiag :: Element t => Matrix t -> Vector t Source #

extracts the diagonal from a rectangular matrix

Vector extraction

subVector Source #

Arguments

:: Storable t 
=> Int

index of the starting element

-> Int

number of elements to extract

-> Vector t

source

-> Vector t

result

takes a number of consecutive elements from a Vector

>>> subVector 2 3 (fromList [1..10])
[3.0,4.0,5.0]
it :: (Enum t, Num t, Foreign.Storable.Storable t) => Vector t

takesV :: Storable t => [Int] -> Vector t -> [Vector t] Source #

Extract consecutive subvectors of the given sizes.

>>> takesV [3,4] (linspace 10 (1,10::Double))
[[1.0,2.0,3.0],[4.0,5.0,6.0,7.0]]
it :: [Vector Double]

vjoin :: Storable t => [Vector t] -> Vector t Source #

concatenate a list of vectors

>>> vjoin [fromList [1..5::Double], konst 1 3]
[1.0,2.0,3.0,4.0,5.0,1.0,1.0,1.0]
it :: Vector Double

Matrix extraction

data Extractor Source #

Specification of indexes for the operator ??.

Constructors

All 
Range Int Int Int 
Pos (Vector I) 
PosCyc (Vector I) 
Take Int 
TakeLast Int 
Drop Int 
DropLast Int 

Instances

Instances details
Show Extractor Source # 
Instance details

Defined in Internal.Element

Methods

showsPrec :: Int -> Extractor -> ShowS

show :: Extractor -> String

showList :: [Extractor] -> ShowS

(??) :: Element t => Matrix t -> (Extractor, Extractor) -> Matrix t infixl 9 Source #

General matrix slicing.

>>> m
(4><5)
 [  0,  1,  2,  3,  4
 ,  5,  6,  7,  8,  9
 , 10, 11, 12, 13, 14
 , 15, 16, 17, 18, 19 ]
>>> m ?? (Take 3, DropLast 2)
(3><3)
 [  0,  1,  2
 ,  5,  6,  7
 , 10, 11, 12 ]
>>> m ?? (Pos (idxs[2,1]), All)
(2><5)
 [ 10, 11, 12, 13, 14
 ,  5,  6,  7,  8,  9 ]
>>> m ?? (PosCyc (idxs[-7,80]), Range 4 (-2) 0)
(2><3)
 [ 9, 7, 5
 , 4, 2, 0 ]

(?) :: Element t => Matrix t -> [Int] -> Matrix t infixl 9 Source #

extract rows

>>> (20><4) [1..] ? [2,1,1]
(3><4)
 [ 9.0, 10.0, 11.0, 12.0
 , 5.0,  6.0,  7.0,  8.0
 , 5.0,  6.0,  7.0,  8.0 ]

(¿) :: Element t => Matrix t -> [Int] -> Matrix t infixl 9 Source #

extract columns

(unicode 0x00bf, inverted question mark, Alt-Gr ?)

>>> (3><4) [1..] ¿ [3,0]
(3><2)
 [  4.0, 1.0
 ,  8.0, 5.0
 , 12.0, 9.0 ]

fliprl :: Element t => Matrix t -> Matrix t Source #

Reverse columns

flipud :: Element t => Matrix t -> Matrix t Source #

Reverse rows

subMatrix Source #

Arguments

:: Element a 
=> (Int, Int)

(r0,c0) starting position

-> (Int, Int)

(rt,ct) dimensions of submatrix

-> Matrix a

input matrix

-> Matrix a

result

reference to a rectangular slice of a matrix (no data copy)

takeRows :: Element t => Int -> Matrix t -> Matrix t Source #

dropRows :: Element t => Int -> Matrix t -> Matrix t Source #

takeColumns :: Element t => Int -> Matrix t -> Matrix t Source #

dropColumns :: Element t => Int -> Matrix t -> Matrix t Source #

remap :: Element t => Matrix I -> Matrix I -> Matrix t -> Matrix t Source #

Extract elements from positions given in matrices of rows and columns.

>>> r
(3><3)
 [ 1, 1, 1
 , 1, 2, 2
 , 1, 2, 3 ]
>>> c
(3><3)
 [ 0, 1, 5
 , 2, 2, 1
 , 4, 4, 1 ]
>>> m
(4><6)
 [  0,  1,  2,  3,  4,  5
 ,  6,  7,  8,  9, 10, 11
 , 12, 13, 14, 15, 16, 17
 , 18, 19, 20, 21, 22, 23 ]
>>> remap r c m
(3><3)
 [  6,  7, 11
 ,  8, 14, 13
 , 10, 16, 19 ]

The indexes are autoconformable.

>>> c'
(3><1)
 [ 1
 , 2
 , 4 ]
>>> remap r c' m
(3><3)
 [  7,  7,  7
 ,  8, 14, 14
 , 10, 16, 22 ]

Block matrix

fromBlocks :: Element t => [[Matrix t]] -> Matrix t Source #

Create a matrix from blocks given as a list of lists of matrices.

Single row-column components are automatically expanded to match the corresponding common row and column:

disp = putStr . dispf 2
>>> disp $ fromBlocks [[ident 5, 7, row[10,20]], [3, diagl[1,2,3], 0]]
8x10
1  0  0  0  0  7  7  7  10  20
0  1  0  0  0  7  7  7  10  20
0  0  1  0  0  7  7  7  10  20
0  0  0  1  0  7  7  7  10  20
0  0  0  0  1  7  7  7  10  20
3  3  3  3  3  1  0  0   0   0
3  3  3  3  3  0  2  0   0   0
3  3  3  3  3  0  0  3   0   0

(|||) :: Element t => Matrix t -> Matrix t -> Matrix t infixl 3 Source #

horizontal concatenation

>>> ident 3 ||| konst 7 (3,4)
(3><7)
 [ 1.0, 0.0, 0.0, 7.0, 7.0, 7.0, 7.0
 , 0.0, 1.0, 0.0, 7.0, 7.0, 7.0, 7.0
 , 0.0, 0.0, 1.0, 7.0, 7.0, 7.0, 7.0 ]

(===) :: Element t => Matrix t -> Matrix t -> Matrix t infixl 2 Source #

vertical concatenation

diagBlock :: (Element t, Num t) => [Matrix t] -> Matrix t Source #

create a block diagonal matrix

>>> disp 2 $ diagBlock [konst 1 (2,2), konst 2 (3,5), col [5,7]]
7x8
1  1  0  0  0  0  0  0
1  1  0  0  0  0  0  0
0  0  2  2  2  2  2  0
0  0  2  2  2  2  2  0
0  0  2  2  2  2  2  0
0  0  0  0  0  0  0  5
0  0  0  0  0  0  0  7
>>> diagBlock [(0><4)[], konst 2 (2,3)]  :: Matrix Double
(2><7)
 [ 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 2.0
 , 0.0, 0.0, 0.0, 0.0, 2.0, 2.0, 2.0 ]

repmat :: Element t => Matrix t -> Int -> Int -> Matrix t Source #

creates matrix by repetition of a matrix a given number of rows and columns

>>> repmat (ident 2) 2 3
(4><6)
 [ 1.0, 0.0, 1.0, 0.0, 1.0, 0.0
 , 0.0, 1.0, 0.0, 1.0, 0.0, 1.0
 , 1.0, 0.0, 1.0, 0.0, 1.0, 0.0
 , 0.0, 1.0, 0.0, 1.0, 0.0, 1.0 ]

toBlocks :: Element t => [Int] -> [Int] -> Matrix t -> [[Matrix t]] Source #

Partition a matrix into blocks with the given numbers of rows and columns. The remaining rows and columns are discarded.

toBlocksEvery :: Element t => Int -> Int -> Matrix t -> [[Matrix t]] Source #

Fully partition a matrix into blocks of the same size. If the dimensions are not a multiple of the given size the last blocks will be smaller.

Mapping functions

conj :: Container c e => c e -> c e Source #

complex conjugate

cmap :: (Element b, Container c e) => (e -> b) -> c e -> c b Source #

like fmap (cannot implement instance Functor because of Element class constraint)

cmod :: (Integral e, Container c e) => e -> c e -> c e Source #

mod for integer arrays

>>> cmod 3 (range 5)
fromList [0,1,2,0,1]

step :: (Ord e, Container c e) => c e -> c e Source #

A more efficient implementation of cmap (\x -> if x>0 then 1 else 0)

>>> step $ linspace 5 (-1,1::Double)
5 |> [0.0,0.0,0.0,1.0,1.0]

cond Source #

Arguments

:: (Ord e, Container c e, Container c x) 
=> c e

a

-> c e

b

-> c x

l

-> c x

e

-> c x

g

-> c x

result

Element by element version of case compare a b of {LT -> l; EQ -> e; GT -> g}.

Arguments with any dimension = 1 are automatically expanded:

>>> cond ((1><4)[1..]) ((3><1)[1..]) 0 100 ((3><4)[1..]) :: Matrix Double
(3><4)
[ 100.0,   2.0,   3.0,  4.0
,   0.0, 100.0,   7.0,  8.0
,   0.0,   0.0, 100.0, 12.0 ]
>>> let chop x = cond (abs x) 1E-6 0 0 x

Find elements

find :: Container c e => (e -> Bool) -> c e -> [IndexOf c] Source #

Find index of elements which satisfy a predicate

>>> find (>0) (ident 3 :: Matrix Double)
[(0,0),(1,1),(2,2)]

maxIndex :: Container c e => c e -> IndexOf c Source #

index of maximum element

minIndex :: Container c e => c e -> IndexOf c Source #

index of minimum element

maxElement :: Container c e => c e -> e Source #

value of maximum element

minElement :: Container c e => c e -> e Source #

value of minimum element

sortVector :: (Ord t, Element t) => Vector t -> Vector t Source #

sortIndex :: (Ord t, Element t) => Vector t -> Vector I Source #

>>> m <- randn 4 10
>>> disp 2 m
4x10
-0.31   0.41   0.43  -0.19  -0.17  -0.23  -0.17  -1.04  -0.07  -1.24
 0.26   0.19   0.14   0.83  -1.54  -0.09   0.37  -0.63   0.71  -0.50
-0.11  -0.10  -1.29  -1.40  -1.04  -0.89  -0.68   0.35  -1.46   1.86
 1.04  -0.29   0.19  -0.75  -2.20  -0.01   1.06   0.11  -2.09  -1.58
>>> disp 2 $ m ?? (All, Pos $ sortIndex (m!1))
4x10
-0.17  -1.04  -1.24  -0.23   0.43   0.41  -0.31  -0.17  -0.07  -0.19
-1.54  -0.63  -0.50  -0.09   0.14   0.19   0.26   0.37   0.71   0.83
-1.04   0.35   1.86  -0.89  -1.29  -0.10  -0.11  -0.68  -1.46  -1.40
-2.20   0.11  -1.58  -0.01   0.19  -0.29   1.04   1.06  -2.09  -0.75

Sparse

type AssocMatrix = [(IndexOf Matrix, Double)] Source #

mkDiagR :: Int -> Int -> Vector Double -> GMatrix Source #

IO

disp :: Int -> Matrix Double -> IO () Source #

print a real matrix with given number of digits after the decimal point

>>> disp 5 $ ident 2 / 3
2x2
0.33333  0.00000
0.00000  0.33333

loadMatrix :: FilePath -> IO (Matrix Double) Source #

load a matrix from an ASCII file formatted as a 2D table.

loadMatrix' :: FilePath -> IO (Maybe (Matrix Double)) Source #

saveMatrix Source #

Arguments

:: FilePath 
-> String

"printf" format (e.g. "%.2f", "%g", etc.)

-> Matrix Double 
-> IO () 

save a matrix as a 2D ASCII table

latexFormat Source #

Arguments

:: String

type of braces: "matrix", "bmatrix", "pmatrix", etc.

-> String

Formatted matrix, with elements separated by spaces and newlines

-> String 

Tool to display matrices with latex syntax.

>>> latexFormat "bmatrix" (dispf 2 $ ident 2)
"\\begin{bmatrix}\n1  &  0\n\\\\\n0  &  1\n\\end{bmatrix}"

dispf :: Int -> Matrix Double -> String Source #

Show a matrix with a given number of decimal places.

>>> dispf 2 (1/3 + ident 3)
"3x3\n1.33  0.33  0.33\n0.33  1.33  0.33\n0.33  0.33  1.33\n"
>>> putStr . dispf 2 $ (3><4)[1,1.5..]
3x4
1.00  1.50  2.00  2.50
3.00  3.50  4.00  4.50
5.00  5.50  6.00  6.50
>>> putStr . unlines . tail . lines . dispf 2 . asRow $ linspace 10 (0,1)
0.00  0.11  0.22  0.33  0.44  0.56  0.67  0.78  0.89  1.00

disps :: Int -> Matrix Double -> String Source #

Show a matrix with "autoscaling" and a given number of decimal places.

>>> putStr . disps 2 $ 120 * (3><4) [1..]
3x4  E3
 0.12  0.24  0.36  0.48
 0.60  0.72  0.84  0.96
 1.08  1.20  1.32  1.44

dispcf :: Int -> Matrix (Complex Double) -> String Source #

Pretty print a complex matrix with at most n decimal digits.

format :: Element t => String -> (t -> String) -> Matrix t -> String Source #

Creates a string from a matrix given a separator and a function to show each entry. Using this function the user can easily define any desired display function:

import Text.Printf(printf)
disp = putStr . format "  " (printf "%.2f")

dispDots :: Int -> Matrix Double -> IO () Source #

dispBlanks :: Int -> Matrix Double -> IO () Source #

dispShort :: Int -> Int -> Int -> Matrix Double -> IO () Source #

Element conversion

class Convert t where Source #

Methods

real :: Complexable c => c (RealOf t) -> c t Source #

complex :: Complexable c => c t -> c (ComplexOf t) Source #

single :: Complexable c => c t -> c (SingleOf t) Source #

double :: Complexable c => c t -> c (DoubleOf t) Source #

toComplex :: (Complexable c, RealElement t) => (c t, c t) -> c (Complex t) Source #

fromComplex :: (Complexable c, RealElement t) => c (Complex t) -> (c t, c t) Source #

Instances

Instances details
Convert Double Source # 
Instance details

Defined in Internal.Numeric

Methods

real :: Complexable c => c (RealOf Double) -> c Double Source #

complex :: Complexable c => c Double -> c (ComplexOf Double) Source #

single :: Complexable c => c Double -> c (SingleOf Double) Source #

double :: Complexable c => c Double -> c (DoubleOf Double) Source #

toComplex :: (Complexable c, RealElement Double) => (c Double, c Double) -> c (Complex Double) Source #

fromComplex :: (Complexable c, RealElement Double) => c (Complex Double) -> (c Double, c Double) Source #

Convert Float Source # 
Instance details

Defined in Internal.Numeric

Methods

real :: Complexable c => c (RealOf Float) -> c Float Source #

complex :: Complexable c => c Float -> c (ComplexOf Float) Source #

single :: Complexable c => c Float -> c (SingleOf Float) Source #

double :: Complexable c => c Float -> c (DoubleOf Float) Source #

toComplex :: (Complexable c, RealElement Float) => (c Float, c Float) -> c (Complex Float) Source #

fromComplex :: (Complexable c, RealElement Float) => c (Complex Float) -> (c Float, c Float) Source #

Convert (Complex Double) Source # 
Instance details

Defined in Internal.Numeric

Methods

real :: Complexable c => c (RealOf (Complex Double)) -> c (Complex Double) Source #

complex :: Complexable c => c (Complex Double) -> c (ComplexOf (Complex Double)) Source #

single :: Complexable c => c (Complex Double) -> c (SingleOf (Complex Double)) Source #

double :: Complexable c => c (Complex Double) -> c (DoubleOf (Complex Double)) Source #

toComplex :: (Complexable c, RealElement (Complex Double)) => (c (Complex Double), c (Complex Double)) -> c (Complex (Complex Double)) Source #

fromComplex :: (Complexable c, RealElement (Complex Double)) => c (Complex (Complex Double)) -> (c (Complex Double), c (Complex Double)) Source #

Convert (Complex Float) Source # 
Instance details

Defined in Internal.Numeric

Methods

real :: Complexable c => c (RealOf (Complex Float)) -> c (Complex Float) Source #

complex :: Complexable c => c (Complex Float) -> c (ComplexOf (Complex Float)) Source #

single :: Complexable c => c (Complex Float) -> c (SingleOf (Complex Float)) Source #

double :: Complexable c => c (Complex Float) -> c (DoubleOf (Complex Float)) Source #

toComplex :: (Complexable c, RealElement (Complex Float)) => (c (Complex Float), c (Complex Float)) -> c (Complex (Complex Float)) Source #

fromComplex :: (Complexable c, RealElement (Complex Float)) => c (Complex (Complex Float)) -> (c (Complex Float), c (Complex Float)) Source #

roundVector :: Vector Double -> Vector Double Source #

fromInt :: Container c e => c I -> c e Source #

>>> fromInt ((2><2) [0..3]) :: Matrix (Complex Double)
(2><2)
[ 0.0 :+ 0.0, 1.0 :+ 0.0
, 2.0 :+ 0.0, 3.0 :+ 0.0 ]

toInt :: Container c e => c e -> c I Source #

fromZ :: Container c e => c Z -> c e Source #

toZ :: Container c e => c e -> c Z Source #

Misc

arctan2 :: (Fractional e, Container c e) => c e -> c e -> c e Source #

separable :: Element t => (Vector t -> Vector t) -> Matrix t -> Matrix t Source #

matrix computation implemented as separated vector operations by rows and columns.

fromArray2D :: Storable e => Array (Int, Int) e -> Matrix e Source #

data Complex a #

Constructors

!a :+ !a 

Instances

Instances details
MonadZip Complex 
Instance details

Defined in Data.Complex

Methods

mzip :: Complex a -> Complex b -> Complex (a, b)

mzipWith :: (a -> b -> c) -> Complex a -> Complex b -> Complex c

munzip :: Complex (a, b) -> (Complex a, Complex b)

Foldable1 Complex 
Instance details

Defined in Data.Foldable1

Methods

fold1 :: Semigroup m => Complex m -> m

foldMap1 :: Semigroup m => (a -> m) -> Complex a -> m

foldMap1' :: Semigroup m => (a -> m) -> Complex a -> m

toNonEmpty :: Complex a -> NonEmpty a

maximum :: Ord a => Complex a -> a

minimum :: Ord a => Complex a -> a

head :: Complex a -> a

last :: Complex a -> a

foldrMap1 :: (a -> b) -> (a -> b -> b) -> Complex a -> b

foldlMap1' :: (a -> b) -> (b -> a -> b) -> Complex a -> b

foldlMap1 :: (a -> b) -> (b -> a -> b) -> Complex a -> b

foldrMap1' :: (a -> b) -> (a -> b -> b) -> Complex a -> b

Eq1 Complex 
Instance details

Defined in Data.Functor.Classes

Methods

liftEq :: (a -> b -> Bool) -> Complex a -> Complex b -> Bool

Read1 Complex 
Instance details

Defined in Data.Functor.Classes

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Complex a)

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Complex a]

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Complex a)

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Complex a]

Show1 Complex 
Instance details

Defined in Data.Functor.Classes

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Complex a -> ShowS

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Complex a] -> ShowS

Applicative Complex 
Instance details

Defined in Data.Complex

Methods

pure :: a -> Complex a

(<*>) :: Complex (a -> b) -> Complex a -> Complex b

liftA2 :: (a -> b -> c) -> Complex a -> Complex b -> Complex c

(*>) :: Complex a -> Complex b -> Complex b

(<*) :: Complex a -> Complex b -> Complex a

Functor Complex 
Instance details

Defined in Data.Complex

Methods

fmap :: (a -> b) -> Complex a -> Complex b

(<$) :: a -> Complex b -> Complex a

Monad Complex 
Instance details

Defined in Data.Complex

Methods

(>>=) :: Complex a -> (a -> Complex b) -> Complex b

(>>) :: Complex a -> Complex b -> Complex b

return :: a -> Complex a

MonadFix Complex 
Instance details

Defined in Data.Complex

Methods

mfix :: (a -> Complex a) -> Complex a

Foldable Complex 
Instance details

Defined in Data.Complex

Methods

fold :: Monoid m => Complex m -> m

foldMap :: Monoid m => (a -> m) -> Complex a -> m

foldMap' :: Monoid m => (a -> m) -> Complex a -> m

foldr :: (a -> b -> b) -> b -> Complex a -> b

foldr' :: (a -> b -> b) -> b -> Complex a -> b

foldl :: (b -> a -> b) -> b -> Complex a -> b

foldl' :: (b -> a -> b) -> b -> Complex a -> b

foldr1 :: (a -> a -> a) -> Complex a -> a

foldl1 :: (a -> a -> a) -> Complex a -> a

toList :: Complex a -> [a]

null :: Complex a -> Bool

length :: Complex a -> Int

elem :: Eq a => a -> Complex a -> Bool

maximum :: Ord a => Complex a -> a

minimum :: Ord a => Complex a -> a

sum :: Num a => Complex a -> a

product :: Num a => Complex a -> a

Traversable Complex 
Instance details

Defined in Data.Complex

Methods

traverse :: Applicative f => (a -> f b) -> Complex a -> f (Complex b)

sequenceA :: Applicative f => Complex (f a) -> f (Complex a)

mapM :: Monad m => (a -> m b) -> Complex a -> m (Complex b)

sequence :: Monad m => Complex (m a) -> m (Complex a)

Generic1 Complex 
Instance details

Defined in Data.Complex

Associated Types

type Rep1 Complex 
Instance details

Defined in Data.Complex

type Rep1 Complex = D1 ('MetaData "Complex" "Data.Complex" "base" 'False) (C1 ('MetaCons ":+" ('InfixI 'NotAssociative 6) 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) Par1 :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) Par1))

Methods

from1 :: Complex a -> Rep1 Complex a

to1 :: Rep1 Complex a -> Complex a

Domain C M Source # 
Instance details

Defined in Numeric.LinearAlgebra.Static

Methods

mul :: forall (m :: Nat) (k :: Nat) (n :: Nat). (KnownNat m, KnownNat k, KnownNat n) => M m k -> M k n -> M m n Source #

app :: forall (m :: Nat) (n :: Nat). (KnownNat m, KnownNat n) => M m n -> C n -> C m Source #

dot :: forall (n :: Nat). KnownNat n => C n -> C n -> Source #

cross :: C 3 -> C 3 -> C 3 Source #

diagR :: forall (m :: Nat) (n :: Nat) (k :: Nat). (KnownNat m, KnownNat n, KnownNat k) => -> C k -> M m n Source #

dvmap :: forall (n :: Nat). KnownNat n => ( -> ) -> C n -> C n Source #

dmmap :: forall (n :: Nat) (m :: Nat). (KnownNat m, KnownNat n) => ( -> ) -> M n m -> M n m Source #

outer :: forall (n :: Nat) (m :: Nat). (KnownNat m, KnownNat n) => C n -> C m -> M n m Source #

zipWithVector :: forall (n :: Nat). KnownNat n => ( -> -> ) -> C n -> C n -> C n Source #

det :: forall (n :: Nat). KnownNat n => M n n -> Source #

invlndet :: forall (n :: Nat). KnownNat n => M n n -> (M n n, (, )) Source #

expm :: forall (n :: Nat). KnownNat n => M n n -> M n n Source #

sqrtm :: forall (n :: Nat). KnownNat n => M n n -> M n n Source #

inv :: forall (n :: Nat). KnownNat n => M n n -> M n n Source #

Container Vector (Complex Double) Source # 
Instance details

Defined in Internal.Numeric

Methods

conj' :: Vector (Complex Double) -> Vector (Complex Double)

size' :: Vector (Complex Double) -> IndexOf Vector

scalar' :: Complex Double -> Vector (Complex Double)

scale' :: Complex Double -> Vector (Complex Double) -> Vector (Complex Double)

addConstant :: Complex Double -> Vector (Complex Double) -> Vector (Complex Double)

add' :: Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double)

sub :: Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double)

mul :: Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double)

equal :: Vector (Complex Double) -> Vector (Complex Double) -> Bool

cmap' :: Element b => (Complex Double -> b) -> Vector (Complex Double) -> Vector b

konst' :: Complex Double -> IndexOf Vector -> Vector (Complex Double)

build' :: IndexOf Vector -> ArgOf Vector (Complex Double) -> Vector (Complex Double)

atIndex' :: Vector (Complex Double) -> IndexOf Vector -> Complex Double

minIndex' :: Vector (Complex Double) -> IndexOf Vector

maxIndex' :: Vector (Complex Double) -> IndexOf Vector

minElement' :: Vector (Complex Double) -> Complex Double

maxElement' :: Vector (Complex Double) -> Complex Double

sumElements' :: Vector (Complex Double) -> Complex Double

prodElements' :: Vector (Complex Double) -> Complex Double

step' :: Vector (Complex Double) -> Vector (Complex Double)

ccompare' :: Vector (Complex Double) -> Vector (Complex Double) -> Vector I

cselect' :: Vector I -> Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double)

find' :: (Complex Double -> Bool) -> Vector (Complex Double) -> [IndexOf Vector]

assoc' :: IndexOf Vector -> Complex Double -> [(IndexOf Vector, Complex Double)] -> Vector (Complex Double)

accum' :: Vector (Complex Double) -> (Complex Double -> Complex Double -> Complex Double) -> [(IndexOf Vector, Complex Double)] -> Vector (Complex Double)

scaleRecip :: Complex Double -> Vector (Complex Double) -> Vector (Complex Double)

divide :: Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double)

arctan2' :: Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double)

cmod' :: Complex Double -> Vector (Complex Double) -> Vector (Complex Double)

fromInt' :: Vector I -> Vector (Complex Double)

toInt' :: Vector (Complex Double) -> Vector I

fromZ' :: Vector Z -> Vector (Complex Double)

toZ' :: Vector (Complex Double) -> Vector Z

Container Vector (Complex Float) Source # 
Instance details

Defined in Internal.Numeric

Methods

conj' :: Vector (Complex Float) -> Vector (Complex Float)

size' :: Vector (Complex Float) -> IndexOf Vector

scalar' :: Complex Float -> Vector (Complex Float)

scale' :: Complex Float -> Vector (Complex Float) -> Vector (Complex Float)

addConstant :: Complex Float -> Vector (Complex Float) -> Vector (Complex Float)

add' :: Vector (Complex Float) -> Vector (Complex Float) -> Vector (Complex Float)

sub :: Vector (Complex Float) -> Vector (Complex Float) -> Vector (Complex Float)

mul :: Vector (Complex Float) -> Vector (Complex Float) -> Vector (Complex Float)

equal :: Vector (Complex Float) -> Vector (Complex Float) -> Bool

cmap' :: Element b => (Complex Float -> b) -> Vector (Complex Float) -> Vector b

konst' :: Complex Float -> IndexOf Vector -> Vector (Complex Float)

build' :: IndexOf Vector -> ArgOf Vector (Complex Float) -> Vector (Complex Float)

atIndex' :: Vector (Complex Float) -> IndexOf Vector -> Complex Float

minIndex' :: Vector (Complex Float) -> IndexOf Vector

maxIndex' :: Vector (Complex Float) -> IndexOf Vector

minElement' :: Vector (Complex Float) -> Complex Float

maxElement' :: Vector (Complex Float) -> Complex Float

sumElements' :: Vector (Complex Float) -> Complex Float

prodElements' :: Vector (Complex Float) -> Complex Float

step' :: Vector (Complex Float) -> Vector (Complex Float)

ccompare' :: Vector (Complex Float) -> Vector (Complex Float) -> Vector I

cselect' :: Vector I -> Vector (Complex Float) -> Vector (Complex Float) -> Vector (Complex Float) -> Vector (Complex Float)

find' :: (Complex Float -> Bool) -> Vector (Complex Float) -> [IndexOf Vector]

assoc' :: IndexOf Vector -> Complex Float -> [(IndexOf Vector, Complex Float)] -> Vector (Complex Float)

accum' :: Vector (Complex Float) -> (Complex Float -> Complex Float -> Complex Float) -> [(IndexOf Vector, Complex Float)] -> Vector (Complex Float)

scaleRecip :: Complex Float -> Vector (Complex Float) -> Vector (Complex Float)

divide :: Vector (Complex Float) -> Vector (Complex Float) -> Vector (Complex Float)

arctan2' :: Vector (Complex Float) -> Vector (Complex Float) -> Vector (Complex Float)

cmod' :: Complex Float -> Vector (Complex Float) -> Vector (Complex Float)

fromInt' :: Vector I -> Vector (Complex Float)

toInt' :: Vector (Complex Float) -> Vector I

fromZ' :: Vector Z -> Vector (Complex Float)

toZ' :: Vector (Complex Float) -> Vector Z

Unbox a => Vector Vector (Complex a) 
Instance details

Defined in Data.Vector.Unboxed.Base

Methods

basicUnsafeFreeze :: Mutable Vector s (Complex a) -> ST s (Vector (Complex a))

basicUnsafeThaw :: Vector (Complex a) -> ST s (Mutable Vector s (Complex a))

basicLength :: Vector (Complex a) -> Int

basicUnsafeSlice :: Int -> Int -> Vector (Complex a) -> Vector (Complex a)

basicUnsafeIndexM :: Vector (Complex a) -> Int -> Box (Complex a)

basicUnsafeCopy :: Mutable Vector s (Complex a) -> Vector (Complex a) -> ST s ()

elemseq :: Vector (Complex a) -> Complex a -> b -> b

Unbox a => MVector MVector (Complex a) 
Instance details

Defined in Data.Vector.Unboxed.Base

Methods

basicLength :: MVector s (Complex a) -> Int

basicUnsafeSlice :: Int -> Int -> MVector s (Complex a) -> MVector s (Complex a)

basicOverlaps :: MVector s (Complex a) -> MVector s (Complex a) -> Bool

basicUnsafeNew :: Int -> ST s (MVector s (Complex a))

basicInitialize :: MVector s (Complex a) -> ST s ()

basicUnsafeReplicate :: Int -> Complex a -> ST s (MVector s (Complex a))

basicUnsafeRead :: MVector s (Complex a) -> Int -> ST s (Complex a)

basicUnsafeWrite :: MVector s (Complex a) -> Int -> Complex a -> ST s ()

basicClear :: MVector s (Complex a) -> ST s ()

basicSet :: MVector s (Complex a) -> Complex a -> ST s ()

basicUnsafeCopy :: MVector s (Complex a) -> MVector s (Complex a) -> ST s ()

basicUnsafeMove :: MVector s (Complex a) -> MVector s (Complex a) -> ST s ()

basicUnsafeGrow :: MVector s (Complex a) -> Int -> ST s (MVector s (Complex a))

KnownNat n => Sized (C n) Vector Source # 
Instance details

Defined in Internal.Static

Methods

konst :: -> C n Source #

unwrap :: C n -> Vector Source #

fromList :: [] -> C n Source #

extract :: C n -> Vector Source #

create :: Vector -> Maybe (C n) Source #

size :: C n -> IndexOf Vector Source #

(KnownNat m, KnownNat n) => Sized (M m n) Matrix Source # 
Instance details

Defined in Internal.Static

Methods

konst :: -> M m n Source #

unwrap :: M m n -> Matrix Source #

fromList :: [] -> M m n Source #

extract :: M m n -> Matrix Source #

create :: Matrix -> Maybe (M m n) Source #

size :: M m n -> IndexOf Matrix Source #

Binary a => Binary (Complex a) 
Instance details

Defined in Data.Binary.Class

Methods

put :: Complex a -> Put

get :: Get (Complex a)

putList :: [Complex a] -> Put

NFData a => NFData (Complex a) 
Instance details

Defined in Control.DeepSeq

Methods

rnf :: Complex a -> ()

Data a => Data (Complex a) 
Instance details

Defined in Data.Complex

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Complex a -> c (Complex a)

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Complex a)

toConstr :: Complex a -> Constr

dataTypeOf :: Complex a -> DataType

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Complex a))

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Complex a))

gmapT :: (forall b. Data b => b -> b) -> Complex a -> Complex a

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Complex a -> r

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Complex a -> r

gmapQ :: (forall d. Data d => d -> u) -> Complex a -> [u]

gmapQi :: Int -> (forall d. Data d => d -> u) -> Complex a -> u

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Complex a -> m (Complex a)

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Complex a -> m (Complex a)

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Complex a -> m (Complex a)

RealFloat a => Floating (Complex a) 
Instance details

Defined in Data.Complex

Methods

pi :: Complex a

exp :: Complex a -> Complex a

log :: Complex a -> Complex a

sqrt :: Complex a -> Complex a

(**) :: Complex a -> Complex a -> Complex a

logBase :: Complex a -> Complex a -> Complex a

sin :: Complex a -> Complex a

cos :: Complex a -> Complex a

tan :: Complex a -> Complex a

asin :: Complex a -> Complex a

acos :: Complex a -> Complex a

atan :: Complex a -> Complex a

sinh :: Complex a -> Complex a

cosh :: Complex a -> Complex a

tanh :: Complex a -> Complex a

asinh :: Complex a -> Complex a

acosh :: Complex a -> Complex a

atanh :: Complex a -> Complex a

log1p :: Complex a -> Complex a

expm1 :: Complex a -> Complex a

log1pexp :: Complex a -> Complex a

log1mexp :: Complex a -> Complex a

Floating (Vector (Complex Double)) 
Instance details

Defined in Numeric.Vector

Methods

pi :: Vector (Complex Double)

exp :: Vector (Complex Double) -> Vector (Complex Double)

log :: Vector (Complex Double) -> Vector (Complex Double)

sqrt :: Vector (Complex Double) -> Vector (Complex Double)

(**) :: Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double)

logBase :: Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double)

sin :: Vector (Complex Double) -> Vector (Complex Double)

cos :: Vector (Complex Double) -> Vector (Complex Double)

tan :: Vector (Complex Double) -> Vector (Complex Double)

asin :: Vector (Complex Double) -> Vector (Complex Double)

acos :: Vector (Complex Double) -> Vector (Complex Double)

atan :: Vector (Complex Double) -> Vector (Complex Double)

sinh :: Vector (Complex Double) -> Vector (Complex Double)

cosh :: Vector (Complex Double) -> Vector (Complex Double)

tanh :: Vector (Complex Double) -> Vector (Complex Double)

asinh :: Vector (Complex Double) -> Vector (Complex Double)

acosh :: Vector (Complex Double) -> Vector (Complex Double)

atanh :: Vector (Complex Double) -> Vector (Complex Double)

log1p :: Vector (Complex Double) -> Vector (Complex Double)

expm1 :: Vector (Complex Double) -> Vector (Complex Double)

log1pexp :: Vector (Complex Double) -> Vector (Complex Double)

log1mexp :: Vector (Complex Double) -> Vector (Complex Double)

Floating (Vector (Complex Float)) 
Instance details

Defined in Numeric.Vector

Methods

pi :: Vector (Complex Float)

exp :: Vector (Complex Float) -> Vector (Complex Float)

log :: Vector (Complex Float) -> Vector (Complex Float)

sqrt :: Vector (Complex Float) -> Vector (Complex Float)

(**) :: Vector (Complex Float) -> Vector (Complex Float) -> Vector (Complex Float)

logBase :: Vector (Complex Float) -> Vector (Complex Float) -> Vector (Complex Float)

sin :: Vector (Complex Float) -> Vector (Complex Float)

cos :: Vector (Complex Float) -> Vector (Complex Float)

tan :: Vector (Complex Float) -> Vector (Complex Float)

asin :: Vector (Complex Float) -> Vector (Complex Float)

acos :: Vector (Complex Float) -> Vector (Complex Float)

atan :: Vector (Complex Float) -> Vector (Complex Float)

sinh :: Vector (Complex Float) -> Vector (Complex Float)

cosh :: Vector (Complex Float) -> Vector (Complex Float)

tanh :: Vector (Complex Float) -> Vector (Complex Float)

asinh :: Vector (Complex Float) -> Vector (Complex Float)

acosh :: Vector (Complex Float) -> Vector (Complex Float)

atanh :: Vector (Complex Float) -> Vector (Complex Float)

log1p :: Vector (Complex Float) -> Vector (Complex Float)

expm1 :: Vector (Complex Float) -> Vector (Complex Float)

log1pexp :: Vector (Complex Float) -> Vector (Complex Float)

log1mexp :: Vector (Complex Float) -> Vector (Complex Float)

Storable a => Storable (Complex a) 
Instance details

Defined in Data.Complex

Methods

sizeOf :: Complex a -> Int

alignment :: Complex a -> Int

peekElemOff :: Ptr (Complex a) -> Int -> IO (Complex a)

pokeElemOff :: Ptr (Complex a) -> Int -> Complex a -> IO ()

peekByteOff :: Ptr b -> Int -> IO (Complex a)

pokeByteOff :: Ptr b -> Int -> Complex a -> IO ()

peek :: Ptr (Complex a) -> IO (Complex a)

poke :: Ptr (Complex a) -> Complex a -> IO ()

Generic (Complex a) 
Instance details

Defined in Data.Complex

Associated Types

type Rep (Complex a) 
Instance details

Defined in Data.Complex

type Rep (Complex a) = D1 ('MetaData "Complex" "Data.Complex" "base" 'False) (C1 ('MetaCons ":+" ('InfixI 'NotAssociative 6) 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a)))

Methods

from :: Complex a -> Rep (Complex a) x

to :: Rep (Complex a) x -> Complex a

RealFloat a => Num (Complex a) 
Instance details

Defined in Data.Complex

Methods

(+) :: Complex a -> Complex a -> Complex a

(-) :: Complex a -> Complex a -> Complex a

(*) :: Complex a -> Complex a -> Complex a

negate :: Complex a -> Complex a

abs :: Complex a -> Complex a

signum :: Complex a -> Complex a

fromInteger :: Integer -> Complex a

Num (Vector (Complex Double)) 
Instance details

Defined in Numeric.Vector

Methods

(+) :: Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double)

(-) :: Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double)

(*) :: Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double)

negate :: Vector (Complex Double) -> Vector (Complex Double)

abs :: Vector (Complex Double) -> Vector (Complex Double)

signum :: Vector (Complex Double) -> Vector (Complex Double)

fromInteger :: Integer -> Vector (Complex Double)

Num (Vector (Complex Float)) 
Instance details

Defined in Numeric.Vector

Methods

(+) :: Vector (Complex Float) -> Vector (Complex Float) -> Vector (Complex Float)

(-) :: Vector (Complex Float) -> Vector (Complex Float) -> Vector (Complex Float)

(*) :: Vector (Complex Float) -> Vector (Complex Float) -> Vector (Complex Float)

negate :: Vector (Complex Float) -> Vector (Complex Float)

abs :: Vector (Complex Float) -> Vector (Complex Float)

signum :: Vector (Complex Float) -> Vector (Complex Float)

fromInteger :: Integer -> Vector (Complex Float)

Read a => Read (Complex a) 
Instance details

Defined in Data.Complex

Methods

readsPrec :: Int -> ReadS (Complex a)

readList :: ReadS [Complex a]

readPrec :: ReadPrec (Complex a)

readListPrec :: ReadPrec [Complex a]

RealFloat a => Fractional (Complex a) 
Instance details

Defined in Data.Complex

Methods

(/) :: Complex a -> Complex a -> Complex a

recip :: Complex a -> Complex a

fromRational :: Rational -> Complex a

Show a => Show (Complex a) 
Instance details

Defined in Data.Complex

Methods

showsPrec :: Int -> Complex a -> ShowS

show :: Complex a -> String

showList :: [Complex a] -> ShowS

Eq a => Eq (Complex a) 
Instance details

Defined in Data.Complex

Methods

(==) :: Complex a -> Complex a -> Bool

(/=) :: Complex a -> Complex a -> Bool

Field (Complex Double) Source # 
Instance details

Defined in Internal.Algorithms

Methods

svd' :: Matrix (Complex Double) -> (Matrix (Complex Double), Vector Double, Matrix (Complex Double))

thinSVD' :: Matrix (Complex Double) -> (Matrix (Complex Double), Vector Double, Matrix (Complex Double))

sv' :: Matrix (Complex Double) -> Vector Double

luPacked' :: Matrix (Complex Double) -> (Matrix (Complex Double), [Int])

luSolve' :: (Matrix (Complex Double), [Int]) -> Matrix (Complex Double) -> Matrix (Complex Double)

mbLinearSolve' :: Matrix (Complex Double) -> Matrix (Complex Double) -> Maybe (Matrix (Complex Double))

linearSolve' :: Matrix (Complex Double) -> Matrix (Complex Double) -> Matrix (Complex Double)

cholSolve' :: Matrix (Complex Double) -> Matrix (Complex Double) -> Matrix (Complex Double)

triSolve' :: UpLo -> Matrix (Complex Double) -> Matrix (Complex Double) -> Matrix (Complex Double)

triDiagSolve' :: Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double) -> Matrix (Complex Double) -> Matrix (Complex Double)

ldlPacked' :: Matrix (Complex Double) -> (Matrix (Complex Double), [Int])

ldlSolve' :: (Matrix (Complex Double), [Int]) -> Matrix (Complex Double) -> Matrix (Complex Double)

linearSolveSVD' :: Matrix (Complex Double) -> Matrix (Complex Double) -> Matrix (Complex Double)

linearSolveLS' :: Matrix (Complex Double) -> Matrix (Complex Double) -> Matrix (Complex Double)

eig' :: Matrix (Complex Double) -> (Vector (Complex Double), Matrix (Complex Double))

geig' :: Matrix (Complex Double) -> Matrix (Complex Double) -> (Vector (Complex Double), Vector (Complex Double), Matrix (Complex Double))

eigSH'' :: Matrix (Complex Double) -> (Vector Double, Matrix (Complex Double))

eigOnly :: Matrix (Complex Double) -> Vector (Complex Double)

geigOnly :: Matrix (Complex Double) -> Matrix (Complex Double) -> (Vector (Complex Double), Vector (Complex Double))

eigOnlySH :: Matrix (Complex Double) -> Vector Double

cholSH' :: Matrix (Complex Double) -> Matrix (Complex Double)

mbCholSH' :: Matrix (Complex Double) -> Maybe (Matrix (Complex Double))

qr' :: Matrix (Complex Double) -> (Matrix (Complex Double), Vector (Complex Double))

qrgr' :: Int -> (Matrix (Complex Double), Vector (Complex Double)) -> Matrix (Complex Double)

hess' :: Matrix (Complex Double) -> (Matrix (Complex Double), Matrix (Complex Double))

schur' :: Matrix (Complex Double) -> (Matrix (Complex Double), Matrix (Complex Double))

Element (Complex Double) Source # 
Instance details

Defined in Internal.Matrix

Methods

constantD :: Complex Double -> Int -> Vector (Complex Double)

extractR :: MatrixOrder -> Matrix (Complex Double) -> CInt -> Vector CInt -> CInt -> Vector CInt -> IO (Matrix (Complex Double))

setRect :: Int -> Int -> Matrix (Complex Double) -> Matrix (Complex Double) -> IO ()

sortI :: Vector (Complex Double) -> Vector CInt

sortV :: Vector (Complex Double) -> Vector (Complex Double)

compareV :: Vector (Complex Double) -> Vector (Complex Double) -> Vector CInt

selectV :: Vector CInt -> Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double)

remapM :: Matrix CInt -> Matrix CInt -> Matrix (Complex Double) -> Matrix (Complex Double)

rowOp :: Int -> Complex Double -> Int -> Int -> Int -> Int -> Matrix (Complex Double) -> IO ()

gemm :: Vector (Complex Double) -> Matrix (Complex Double) -> Matrix (Complex Double) -> Matrix (Complex Double) -> IO ()

reorderV :: Vector CInt -> Vector CInt -> Vector (Complex Double) -> Vector (Complex Double)

Element (Complex Float) Source # 
Instance details

Defined in Internal.Matrix

Methods

constantD :: Complex Float -> Int -> Vector (Complex Float)

extractR :: MatrixOrder -> Matrix (Complex Float) -> CInt -> Vector CInt -> CInt -> Vector CInt -> IO (Matrix (Complex Float))

setRect :: Int -> Int -> Matrix (Complex Float) -> Matrix (Complex Float) -> IO ()

sortI :: Vector (Complex Float) -> Vector CInt

sortV :: Vector (Complex Float) -> Vector (Complex Float)

compareV :: Vector (Complex Float) -> Vector (Complex Float) -> Vector CInt

selectV :: Vector CInt -> Vector (Complex Float) -> Vector (Complex Float) -> Vector (Complex Float) -> Vector (Complex Float)

remapM :: Matrix CInt -> Matrix CInt -> Matrix (Complex Float) -> Matrix (Complex Float)

rowOp :: Int -> Complex Float -> Int -> Int -> Int -> Int -> Matrix (Complex Float) -> IO ()

gemm :: Vector (Complex Float) -> Matrix (Complex Float) -> Matrix (Complex Float) -> Matrix (Complex Float) -> IO ()

reorderV :: Vector CInt -> Vector CInt -> Vector (Complex Float) -> Vector (Complex Float)

Convert (Complex Double) Source # 
Instance details

Defined in Internal.Numeric

Methods

real :: Complexable c => c (RealOf (Complex Double)) -> c (Complex Double) Source #

complex :: Complexable c => c (Complex Double) -> c (ComplexOf (Complex Double)) Source #

single :: Complexable c => c (Complex Double) -> c (SingleOf (Complex Double)) Source #

double :: Complexable c => c (Complex Double) -> c (DoubleOf (Complex Double)) Source #

toComplex :: (Complexable c, RealElement (Complex Double)) => (c (Complex Double), c (Complex Double)) -> c (Complex (Complex Double)) Source #

fromComplex :: (Complexable c, RealElement (Complex Double)) => c (Complex (Complex Double)) -> (c (Complex Double), c (Complex Double)) Source #

Convert (Complex Float) Source # 
Instance details

Defined in Internal.Numeric

Methods

real :: Complexable c => c (RealOf (Complex Float)) -> c (Complex Float) Source #

complex :: Complexable c => c (Complex Float) -> c (ComplexOf (Complex Float)) Source #

single :: Complexable c => c (Complex Float) -> c (SingleOf (Complex Float)) Source #

double :: Complexable c => c (Complex Float) -> c (DoubleOf (Complex Float)) Source #

toComplex :: (Complexable c, RealElement (Complex Float)) => (c (Complex Float), c (Complex Float)) -> c (Complex (Complex Float)) Source #

fromComplex :: (Complexable c, RealElement (Complex Float)) => c (Complex (Complex Float)) -> (c (Complex Float), c (Complex Float)) Source #

Numeric (Complex Double) Source # 
Instance details

Defined in Internal.Numeric

Numeric (Complex Float) Source # 
Instance details

Defined in Internal.Numeric

Product (Complex Double) Source # 
Instance details

Defined in Internal.Numeric

Methods

multiply :: Matrix (Complex Double) -> Matrix (Complex Double) -> Matrix (Complex Double)

absSum :: Vector (Complex Double) -> RealOf (Complex Double)

norm1 :: Vector (Complex Double) -> RealOf (Complex Double)

norm2 :: Vector (Complex Double) -> RealOf (Complex Double)

normInf :: Vector (Complex Double) -> RealOf (Complex Double)

Product (Complex Float) Source # 
Instance details

Defined in Internal.Numeric

Methods

multiply :: Matrix (Complex Float) -> Matrix (Complex Float) -> Matrix (Complex Float)

absSum :: Vector (Complex Float) -> RealOf (Complex Float)

norm1 :: Vector (Complex Float) -> RealOf (Complex Float)

norm2 :: Vector (Complex Float) -> RealOf (Complex Float)

normInf :: Vector (Complex Float) -> RealOf (Complex Float)

Normed (Matrix C) Source # 
Instance details

Defined in Internal.Util

Normed (Vector (Complex Float)) Source # 
Instance details

Defined in Internal.Util

Methods

norm_0 :: Vector (Complex Float) -> R Source #

norm_1 :: Vector (Complex Float) -> R Source #

norm_2 :: Vector (Complex Float) -> R Source #

norm_Inf :: Vector (Complex Float) -> R Source #

Normed (Vector C) Source # 
Instance details

Defined in Internal.Util

Prim a => Prim (Complex a)

Since: primitive-0.9.0.0

Instance details

Defined in Data.Primitive.Types

Methods

sizeOfType# :: Proxy (Complex a) -> Int# Source #

sizeOf# :: Complex a -> Int# Source #

alignmentOfType# :: Proxy (Complex a) -> Int# Source #

alignment# :: Complex a -> Int# Source #

indexByteArray# :: ByteArray# -> Int# -> Complex a Source #

readByteArray# :: MutableByteArray# s -> Int# -> State# s -> (# State# s, Complex a #) Source #

writeByteArray# :: MutableByteArray# s -> Int# -> Complex a -> State# s -> State# s Source #

setByteArray# :: MutableByteArray# s -> Int# -> Int# -> Complex a -> State# s -> State# s Source #

indexOffAddr# :: Addr# -> Int# -> Complex a Source #

readOffAddr# :: Addr# -> Int# -> State# s -> (# State# s, Complex a #) Source #

writeOffAddr# :: Addr# -> Int# -> Complex a -> State# s -> State# s Source #

setOffAddr# :: Addr# -> Int# -> Int# -> Complex a -> State# s -> State# s Source #

Unbox a => Unbox (Complex a) 
Instance details

Defined in Data.Vector.Unboxed.Base

Indexable (Vector (Complex Double)) (Complex Double) Source # 
Instance details

Defined in Internal.Util

Methods

(!) :: Vector (Complex Double) -> Int -> Complex Double Source #

Indexable (Vector (Complex Float)) (Complex Float) Source # 
Instance details

Defined in Internal.Util

Methods

(!) :: Vector (Complex Float) -> Int -> Complex Float Source #

type Rep1 Complex 
Instance details

Defined in Data.Complex

type Rep1 Complex = D1 ('MetaData "Complex" "Data.Complex" "base" 'False) (C1 ('MetaCons ":+" ('InfixI 'NotAssociative 6) 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) Par1 :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) Par1))
newtype MVector s (Complex a) 
Instance details

Defined in Data.Vector.Unboxed.Base

newtype MVector s (Complex a) = MV_Complex (MVector s (a, a))
type Rep (Complex a) 
Instance details

Defined in Data.Complex

type Rep (Complex a) = D1 ('MetaData "Complex" "Data.Complex" "base" 'False) (C1 ('MetaCons ":+" ('InfixI 'NotAssociative 6) 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a)))
type DoubleOf (Complex a) Source # 
Instance details

Defined in Internal.Numeric

type RealOf (Complex Double) Source # 
Instance details

Defined in Internal.Numeric

type RealOf (Complex Double) = Double
type RealOf (Complex Float) Source # 
Instance details

Defined in Internal.Numeric

type RealOf (Complex Float) = Float
type SingleOf (Complex a) Source # 
Instance details

Defined in Internal.Numeric

newtype Vector (Complex a) 
Instance details

Defined in Data.Vector.Unboxed.Base

newtype Vector (Complex a) = V_Complex (Vector (a, a))

magnitude :: RealFloat a => Complex a -> a #

phase :: RealFloat a => Complex a -> a #

cis :: Floating a => a -> Complex a #

conjugate :: Num a => Complex a -> Complex a #

mkPolar :: Floating a => a -> a -> Complex a #

polar :: RealFloat a => Complex a -> (a, a) #

imagPart :: Complex a -> a #

realPart :: Complex a -> a #

data Mod (n :: Nat) t Source #

Wrapper with a phantom integer for statically checked modular arithmetic.

Instances

Instances details
KnownNat m => Container Vector (Mod m I) Source # 
Instance details

Defined in Internal.Modular

Methods

conj' :: Vector (Mod m I) -> Vector (Mod m I)

size' :: Vector (Mod m I) -> IndexOf Vector

scalar' :: Mod m I -> Vector (Mod m I)

scale' :: Mod m I -> Vector (Mod m I) -> Vector (Mod m I)

addConstant :: Mod m I -> Vector (Mod m I) -> Vector (Mod m I)

add' :: Vector (Mod m I) -> Vector (Mod m I) -> Vector (Mod m I)

sub :: Vector (Mod m I) -> Vector (Mod m I) -> Vector (Mod m I)

mul :: Vector (Mod m I) -> Vector (Mod m I) -> Vector (Mod m I)

equal :: Vector (Mod m I) -> Vector (Mod m I) -> Bool

cmap' :: Element b => (Mod m I -> b) -> Vector (Mod m I) -> Vector b

konst' :: Mod m I -> IndexOf Vector -> Vector (Mod m I)

build' :: IndexOf Vector -> ArgOf Vector (Mod m I) -> Vector (Mod m I)

atIndex' :: Vector (Mod m I) -> IndexOf Vector -> Mod m I

minIndex' :: Vector (Mod m I) -> IndexOf Vector

maxIndex' :: Vector (Mod m I) -> IndexOf Vector

minElement' :: Vector (Mod m I) -> Mod m I

maxElement' :: Vector (Mod m I) -> Mod m I

sumElements' :: Vector (Mod m I) -> Mod m I

prodElements' :: Vector (Mod m I) -> Mod m I

step' :: Vector (Mod m I) -> Vector (Mod m I)

ccompare' :: Vector (Mod m I) -> Vector (Mod m I) -> Vector I

cselect' :: Vector I -> Vector (Mod m I) -> Vector (Mod m I) -> Vector (Mod m I) -> Vector (Mod m I)

find' :: (Mod m I -> Bool) -> Vector (Mod m I) -> [IndexOf Vector]

assoc' :: IndexOf Vector -> Mod m I -> [(IndexOf Vector, Mod m I)] -> Vector (Mod m I)

accum' :: Vector (Mod m I) -> (Mod m I -> Mod m I -> Mod m I) -> [(IndexOf Vector, Mod m I)] -> Vector (Mod m I)

scaleRecip :: Mod m I -> Vector (Mod m I) -> Vector (Mod m I)

divide :: Vector (Mod m I) -> Vector (Mod m I) -> Vector (Mod m I)

arctan2' :: Vector (Mod m I) -> Vector (Mod m I) -> Vector (Mod m I)

cmod' :: Mod m I -> Vector (Mod m I) -> Vector (Mod m I)

fromInt' :: Vector I -> Vector (Mod m I)

toInt' :: Vector (Mod m I) -> Vector I

fromZ' :: Vector Z -> Vector (Mod m I)

toZ' :: Vector (Mod m I) -> Vector Z

KnownNat m => Container Vector (Mod m Z) Source # 
Instance details

Defined in Internal.Modular

Methods

conj' :: Vector (Mod m Z) -> Vector (Mod m Z)

size' :: Vector (Mod m Z) -> IndexOf Vector

scalar' :: Mod m Z -> Vector (Mod m Z)

scale' :: Mod m Z -> Vector (Mod m Z) -> Vector (Mod m Z)

addConstant :: Mod m Z -> Vector (Mod m Z) -> Vector (Mod m Z)

add' :: Vector (Mod m Z) -> Vector (Mod m Z) -> Vector (Mod m Z)

sub :: Vector (Mod m Z) -> Vector (Mod m Z) -> Vector (Mod m Z)

mul :: Vector (Mod m Z) -> Vector (Mod m Z) -> Vector (Mod m Z)

equal :: Vector (Mod m Z) -> Vector (Mod m Z) -> Bool

cmap' :: Element b => (Mod m Z -> b) -> Vector (Mod m Z) -> Vector b

konst' :: Mod m Z -> IndexOf Vector -> Vector (Mod m Z)

build' :: IndexOf Vector -> ArgOf Vector (Mod m Z) -> Vector (Mod m Z)

atIndex' :: Vector (Mod m Z) -> IndexOf Vector -> Mod m Z

minIndex' :: Vector (Mod m Z) -> IndexOf Vector

maxIndex' :: Vector (Mod m Z) -> IndexOf Vector

minElement' :: Vector (Mod m Z) -> Mod m Z

maxElement' :: Vector (Mod m Z) -> Mod m Z

sumElements' :: Vector (Mod m Z) -> Mod m Z

prodElements' :: Vector (Mod m Z) -> Mod m Z

step' :: Vector (Mod m Z) -> Vector (Mod m Z)

ccompare' :: Vector (Mod m Z) -> Vector (Mod m Z) -> Vector I

cselect' :: Vector I -> Vector (Mod m Z) -> Vector (Mod m Z) -> Vector (Mod m Z) -> Vector (Mod m Z)

find' :: (Mod m Z -> Bool) -> Vector (Mod m Z) -> [IndexOf Vector]

assoc' :: IndexOf Vector -> Mod m Z -> [(IndexOf Vector, Mod m Z)] -> Vector (Mod m Z)

accum' :: Vector (Mod m Z) -> (Mod m Z -> Mod m Z -> Mod m Z) -> [(IndexOf Vector, Mod m Z)] -> Vector (Mod m Z)

scaleRecip :: Mod m Z -> Vector (Mod m Z) -> Vector (Mod m Z)

divide :: Vector (Mod m Z) -> Vector (Mod m Z) -> Vector (Mod m Z)

arctan2' :: Vector (Mod m Z) -> Vector (Mod m Z) -> Vector (Mod m Z)

cmod' :: Mod m Z -> Vector (Mod m Z) -> Vector (Mod m Z)

fromInt' :: Vector I -> Vector (Mod m Z)

toInt' :: Vector (Mod m Z) -> Vector I

fromZ' :: Vector Z -> Vector (Mod m Z)

toZ' :: Vector (Mod m Z) -> Vector Z

KnownNat m => Num (Vector (Mod m I)) Source # 
Instance details

Defined in Internal.Modular

Methods

(+) :: Vector (Mod m I) -> Vector (Mod m I) -> Vector (Mod m I)

(-) :: Vector (Mod m I) -> Vector (Mod m I) -> Vector (Mod m I)

(*) :: Vector (Mod m I) -> Vector (Mod m I) -> Vector (Mod m I)

negate :: Vector (Mod m I) -> Vector (Mod m I)

abs :: Vector (Mod m I) -> Vector (Mod m I)

signum :: Vector (Mod m I) -> Vector (Mod m I)

fromInteger :: Integer -> Vector (Mod m I)

KnownNat m => Num (Vector (Mod m Z)) Source # 
Instance details

Defined in Internal.Modular

Methods

(+) :: Vector (Mod m Z) -> Vector (Mod m Z) -> Vector (Mod m Z)

(-) :: Vector (Mod m Z) -> Vector (Mod m Z) -> Vector (Mod m Z)

(*) :: Vector (Mod m Z) -> Vector (Mod m Z) -> Vector (Mod m Z)

negate :: Vector (Mod m Z) -> Vector (Mod m Z)

abs :: Vector (Mod m Z) -> Vector (Mod m Z)

signum :: Vector (Mod m Z) -> Vector (Mod m Z)

fromInteger :: Integer -> Vector (Mod m Z)

KnownNat m => Testable (Matrix (Mod m I)) Source # 
Instance details

Defined in Internal.Modular

Methods

checkT :: Matrix (Mod m I) -> (Bool, IO ()) Source #

ioCheckT :: Matrix (Mod m I) -> IO (Bool, IO ()) Source #

KnownNat m => Normed (Vector (Mod m I)) Source # 
Instance details

Defined in Internal.Modular

Methods

norm_0 :: Vector (Mod m I) -> R Source #

norm_1 :: Vector (Mod m I) -> R Source #

norm_2 :: Vector (Mod m I) -> R Source #

norm_Inf :: Vector (Mod m I) -> R Source #

KnownNat m => Normed (Vector (Mod m Z)) Source # 
Instance details

Defined in Internal.Modular

Methods

norm_0 :: Vector (Mod m Z) -> R Source #

norm_1 :: Vector (Mod m Z) -> R Source #

norm_2 :: Vector (Mod m Z) -> R Source #

norm_Inf :: Vector (Mod m Z) -> R Source #

(Storable t, Indexable (Vector t) t) => Indexable (Vector (Mod m t)) (Mod m t) Source # 
Instance details

Defined in Internal.Modular

Methods

(!) :: Vector (Mod m t) -> Int -> Mod m t Source #

NFData t => NFData (Mod n t) Source # 
Instance details

Defined in Internal.Modular

Methods

rnf :: Mod n t -> ()

(Integral t, Enum t, KnownNat m) => Enum (Mod m t) Source # 
Instance details

Defined in Internal.Modular

Methods

succ :: Mod m t -> Mod m t

pred :: Mod m t -> Mod m t

toEnum :: Int -> Mod m t

fromEnum :: Mod m t -> Int

enumFrom :: Mod m t -> [Mod m t]

enumFromThen :: Mod m t -> Mod m t -> [Mod m t]

enumFromTo :: Mod m t -> Mod m t -> [Mod m t]

enumFromThenTo :: Mod m t -> Mod m t -> Mod m t -> [Mod m t]

Storable t => Storable (Mod n t) Source # 
Instance details

Defined in Internal.Modular

Methods

sizeOf :: Mod n t -> Int

alignment :: Mod n t -> Int

peekElemOff :: Ptr (Mod n t) -> Int -> IO (Mod n t)

pokeElemOff :: Ptr (Mod n t) -> Int -> Mod n t -> IO ()

peekByteOff :: Ptr b -> Int -> IO (Mod n t)

pokeByteOff :: Ptr b -> Int -> Mod n t -> IO ()

peek :: Ptr (Mod n t) -> IO (Mod n t)

poke :: Ptr (Mod n t) -> Mod n t -> IO ()

(Integral t, KnownNat n) => Num (Mod n t) Source # 
Instance details

Defined in Internal.Modular

Methods

(+) :: Mod n t -> Mod n t -> Mod n t

(-) :: Mod n t -> Mod n t -> Mod n t

(*) :: Mod n t -> Mod n t -> Mod n t

negate :: Mod n t -> Mod n t

abs :: Mod n t -> Mod n t

signum :: Mod n t -> Mod n t

fromInteger :: Integer -> Mod n t

(Integral t, Show t, Eq t, KnownNat m) => Fractional (Mod m t) Source #

this instance is only valid for prime m

Instance details

Defined in Internal.Modular

Methods

(/) :: Mod m t -> Mod m t -> Mod m t

recip :: Mod m t -> Mod m t

fromRational :: Rational -> Mod m t

(Integral t, KnownNat m) => Integral (Mod m t) Source # 
Instance details

Defined in Internal.Modular

Methods

quot :: Mod m t -> Mod m t -> Mod m t

rem :: Mod m t -> Mod m t -> Mod m t

div :: Mod m t -> Mod m t -> Mod m t

mod :: Mod m t -> Mod m t -> Mod m t

quotRem :: Mod m t -> Mod m t -> (Mod m t, Mod m t)

divMod :: Mod m t -> Mod m t -> (Mod m t, Mod m t)

toInteger :: Mod m t -> Integer

(Integral t, Real t, KnownNat m) => Real (Mod m t) Source # 
Instance details

Defined in Internal.Modular

Methods

toRational :: Mod m t -> Rational

Show t => Show (Mod n t) Source # 
Instance details

Defined in Internal.Modular

Methods

showsPrec :: Int -> Mod n t -> ShowS

show :: Mod n t -> String

showList :: [Mod n t] -> ShowS

(Eq t, KnownNat m) => Eq (Mod m t) Source # 
Instance details

Defined in Internal.Modular

Methods

(==) :: Mod m t -> Mod m t -> Bool

(/=) :: Mod m t -> Mod m t -> Bool

(Ord t, KnownNat m) => Ord (Mod m t) Source # 
Instance details

Defined in Internal.Modular

Methods

compare :: Mod m t -> Mod m t -> Ordering

(<) :: Mod m t -> Mod m t -> Bool

(<=) :: Mod m t -> Mod m t -> Bool

(>) :: Mod m t -> Mod m t -> Bool

(>=) :: Mod m t -> Mod m t -> Bool

max :: Mod m t -> Mod m t -> Mod m t

min :: Mod m t -> Mod m t -> Mod m t

KnownNat m => Element (Mod m I) Source # 
Instance details

Defined in Internal.Modular

Methods

constantD :: Mod m I -> Int -> Vector (Mod m I)

extractR :: MatrixOrder -> Matrix (Mod m I) -> CInt -> Vector CInt -> CInt -> Vector CInt -> IO (Matrix (Mod m I))

setRect :: Int -> Int -> Matrix (Mod m I) -> Matrix (Mod m I) -> IO ()

sortI :: Vector (Mod m I) -> Vector CInt

sortV :: Vector (Mod m I) -> Vector (Mod m I)

compareV :: Vector (Mod m I) -> Vector (Mod m I) -> Vector CInt

selectV :: Vector CInt -> Vector (Mod m I) -> Vector (Mod m I) -> Vector (Mod m I) -> Vector (Mod m I)

remapM :: Matrix CInt -> Matrix CInt -> Matrix (Mod m I) -> Matrix (Mod m I)

rowOp :: Int -> Mod m I -> Int -> Int -> Int -> Int -> Matrix (Mod m I) -> IO ()

gemm :: Vector (Mod m I) -> Matrix (Mod m I) -> Matrix (Mod m I) -> Matrix (Mod m I) -> IO ()

reorderV :: Vector CInt -> Vector CInt -> Vector (Mod m I) -> Vector (Mod m I)

KnownNat m => Element (Mod m Z) Source # 
Instance details

Defined in Internal.Modular

Methods

constantD :: Mod m Z -> Int -> Vector (Mod m Z)

extractR :: MatrixOrder -> Matrix (Mod m Z) -> CInt -> Vector CInt -> CInt -> Vector CInt -> IO (Matrix (Mod m Z))

setRect :: Int -> Int -> Matrix (Mod m Z) -> Matrix (Mod m Z) -> IO ()

sortI :: Vector (Mod m Z) -> Vector CInt

sortV :: Vector (Mod m Z) -> Vector (Mod m Z)

compareV :: Vector (Mod m Z) -> Vector (Mod m Z) -> Vector CInt

selectV :: Vector CInt -> Vector (Mod m Z) -> Vector (Mod m Z) -> Vector (Mod m Z) -> Vector (Mod m Z)

remapM :: Matrix CInt -> Matrix CInt -> Matrix (Mod m Z) -> Matrix (Mod m Z)

rowOp :: Int -> Mod m Z -> Int -> Int -> Int -> Int -> Matrix (Mod m Z) -> IO ()

gemm :: Vector (Mod m Z) -> Matrix (Mod m Z) -> Matrix (Mod m Z) -> Matrix (Mod m Z) -> IO ()

reorderV :: Vector CInt -> Vector CInt -> Vector (Mod m Z) -> Vector (Mod m Z)

KnownNat m => Numeric (Mod m I) Source # 
Instance details

Defined in Internal.Modular

KnownNat m => Numeric (Mod m Z) Source # 
Instance details

Defined in Internal.Modular

KnownNat m => Product (Mod m I) Source # 
Instance details

Defined in Internal.Modular

Methods

multiply :: Matrix (Mod m I) -> Matrix (Mod m I) -> Matrix (Mod m I)

absSum :: Vector (Mod m I) -> RealOf (Mod m I)

norm1 :: Vector (Mod m I) -> RealOf (Mod m I)

norm2 :: Vector (Mod m I) -> RealOf (Mod m I)

normInf :: Vector (Mod m I) -> RealOf (Mod m I)

KnownNat m => Product (Mod m Z) Source # 
Instance details

Defined in Internal.Modular

Methods

multiply :: Matrix (Mod m Z) -> Matrix (Mod m Z) -> Matrix (Mod m Z)

absSum :: Vector (Mod m Z) -> RealOf (Mod m Z)

norm1 :: Vector (Mod m Z) -> RealOf (Mod m Z)

norm2 :: Vector (Mod m Z) -> RealOf (Mod m Z)

normInf :: Vector (Mod m Z) -> RealOf (Mod m Z)

type RealOf (Mod n I) Source # 
Instance details

Defined in Internal.Modular

type RealOf (Mod n I) = I
type RealOf (Mod n Z) Source # 
Instance details

Defined in Internal.Modular

type RealOf (Mod n Z) = Z

data Vector a #

Instances

Instances details
NFData1 Vector 
Instance details

Defined in Data.Vector.Storable

Methods

liftRnf :: (a -> ()) -> Vector a -> ()

LSDiv Vector Source # 
Instance details

Defined in Internal.Container

Methods

linSolve :: Field t => Matrix t -> Vector t -> Vector t

Complexable Vector Source # 
Instance details

Defined in Internal.Conversion

Methods

toComplex' :: RealElement e => (Vector e, Vector e) -> Vector (Complex e)

fromComplex' :: RealElement e => Vector (Complex e) -> (Vector e, Vector e)

comp' :: RealElement e => Vector e -> Vector (Complex e)

single' :: Precision a b => Vector b -> Vector a

double' :: Precision a b => Vector a -> Vector b

Container Vector I Source # 
Instance details

Defined in Internal.Numeric

Container Vector Z Source # 
Instance details

Defined in Internal.Numeric

Container Vector Double Source # 
Instance details

Defined in Internal.Numeric

Methods

conj' :: Vector Double -> Vector Double

size' :: Vector Double -> IndexOf Vector

scalar' :: Double -> Vector Double

scale' :: Double -> Vector Double -> Vector Double

addConstant :: Double -> Vector Double -> Vector Double

add' :: Vector Double -> Vector Double -> Vector Double

sub :: Vector Double -> Vector Double -> Vector Double

mul :: Vector Double -> Vector Double -> Vector Double

equal :: Vector Double -> Vector Double -> Bool

cmap' :: Element b => (Double -> b) -> Vector Double -> Vector b

konst' :: Double -> IndexOf Vector -> Vector Double

build' :: IndexOf Vector -> ArgOf Vector Double -> Vector Double

atIndex' :: Vector Double -> IndexOf Vector -> Double

minIndex' :: Vector Double -> IndexOf Vector

maxIndex' :: Vector Double -> IndexOf Vector

minElement' :: Vector Double -> Double

maxElement' :: Vector Double -> Double

sumElements' :: Vector Double -> Double

prodElements' :: Vector Double -> Double

step' :: Vector Double -> Vector Double

ccompare' :: Vector Double -> Vector Double -> Vector I

cselect' :: Vector I -> Vector Double -> Vector Double -> Vector Double -> Vector Double

find' :: (Double -> Bool) -> Vector Double -> [IndexOf Vector]

assoc' :: IndexOf Vector -> Double -> [(IndexOf Vector, Double)] -> Vector Double

accum' :: Vector Double -> (Double -> Double -> Double) -> [(IndexOf Vector, Double)] -> Vector Double

scaleRecip :: Double -> Vector Double -> Vector Double

divide :: Vector Double -> Vector Double -> Vector Double

arctan2' :: Vector Double -> Vector Double -> Vector Double

cmod' :: Double -> Vector Double -> Vector Double

fromInt' :: Vector I -> Vector Double

toInt' :: Vector Double -> Vector I

fromZ' :: Vector Z -> Vector Double

toZ' :: Vector Double -> Vector Z

Container Vector Float Source # 
Instance details

Defined in Internal.Numeric

Methods

conj' :: Vector Float -> Vector Float

size' :: Vector Float -> IndexOf Vector

scalar' :: Float -> Vector Float

scale' :: Float -> Vector Float -> Vector Float

addConstant :: Float -> Vector Float -> Vector Float

add' :: Vector Float -> Vector Float -> Vector Float

sub :: Vector Float -> Vector Float -> Vector Float

mul :: Vector Float -> Vector Float -> Vector Float

equal :: Vector Float -> Vector Float -> Bool

cmap' :: Element b => (Float -> b) -> Vector Float -> Vector b

konst' :: Float -> IndexOf Vector -> Vector Float

build' :: IndexOf Vector -> ArgOf Vector Float -> Vector Float

atIndex' :: Vector Float -> IndexOf Vector -> Float

minIndex' :: Vector Float -> IndexOf Vector

maxIndex' :: Vector Float -> IndexOf Vector

minElement' :: Vector Float -> Float

maxElement' :: Vector Float -> Float

sumElements' :: Vector Float -> Float

prodElements' :: Vector Float -> Float

step' :: Vector Float -> Vector Float

ccompare' :: Vector Float -> Vector Float -> Vector I

cselect' :: Vector I -> Vector Float -> Vector Float -> Vector Float -> Vector Float

find' :: (Float -> Bool) -> Vector Float -> [IndexOf Vector]

assoc' :: IndexOf Vector -> Float -> [(IndexOf Vector, Float)] -> Vector Float

accum' :: Vector Float -> (Float -> Float -> Float) -> [(IndexOf Vector, Float)] -> Vector Float

scaleRecip :: Float -> Vector Float -> Vector Float

divide :: Vector Float -> Vector Float -> Vector Float

arctan2' :: Vector Float -> Vector Float -> Vector Float

cmod' :: Float -> Vector Float -> Vector Float

fromInt' :: Vector I -> Vector Float

toInt' :: Vector Float -> Vector I

fromZ' :: Vector Z -> Vector Float

toZ' :: Vector Float -> Vector Z

Container Vector t => Linear t Vector Source # 
Instance details

Defined in Internal.Numeric

Methods

scale :: t -> Vector t -> Vector t Source #

Storable a => Vector Vector a 
Instance details

Defined in Data.Vector.Storable

Methods

basicUnsafeFreeze :: Mutable Vector s a -> ST s (Vector a)

basicUnsafeThaw :: Vector a -> ST s (Mutable Vector s a)

basicLength :: Vector a -> Int

basicUnsafeSlice :: Int -> Int -> Vector a -> Vector a

basicUnsafeIndexM :: Vector a -> Int -> Box a

basicUnsafeCopy :: Mutable Vector s a -> Vector a -> ST s ()

elemseq :: Vector a -> a -> b -> b

Container Vector e => Konst e Int Vector Source # 
Instance details

Defined in Internal.Numeric

Methods

konst :: e -> Int -> Vector e Source #

Container Vector (Complex Double) Source # 
Instance details

Defined in Internal.Numeric

Methods

conj' :: Vector (Complex Double) -> Vector (Complex Double)

size' :: Vector (Complex Double) -> IndexOf Vector

scalar' :: Complex Double -> Vector (Complex Double)

scale' :: Complex Double -> Vector (Complex Double) -> Vector (Complex Double)

addConstant :: Complex Double -> Vector (Complex Double) -> Vector (Complex Double)

add' :: Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double)

sub :: Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double)

mul :: Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double)

equal :: Vector (Complex Double) -> Vector (Complex Double) -> Bool

cmap' :: Element b => (Complex Double -> b) -> Vector (Complex Double) -> Vector b

konst' :: Complex Double -> IndexOf Vector -> Vector (Complex Double)

build' :: IndexOf Vector -> ArgOf Vector (Complex Double) -> Vector (Complex Double)

atIndex' :: Vector (Complex Double) -> IndexOf Vector -> Complex Double

minIndex' :: Vector (Complex Double) -> IndexOf Vector

maxIndex' :: Vector (Complex Double) -> IndexOf Vector

minElement' :: Vector (Complex Double) -> Complex Double

maxElement' :: Vector (Complex Double) -> Complex Double

sumElements' :: Vector (Complex Double) -> Complex Double

prodElements' :: Vector (Complex Double) -> Complex Double

step' :: Vector (Complex Double) -> Vector (Complex Double)

ccompare' :: Vector (Complex Double) -> Vector (Complex Double) -> Vector I

cselect' :: Vector I -> Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double)

find' :: (Complex Double -> Bool) -> Vector (Complex Double) -> [IndexOf Vector]

assoc' :: IndexOf Vector -> Complex Double -> [(IndexOf Vector, Complex Double)] -> Vector (Complex Double)

accum' :: Vector (Complex Double) -> (Complex Double -> Complex Double -> Complex Double) -> [(IndexOf Vector, Complex Double)] -> Vector (Complex Double)

scaleRecip :: Complex Double -> Vector (Complex Double) -> Vector (Complex Double)

divide :: Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double)

arctan2' :: Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double)

cmod' :: Complex Double -> Vector (Complex Double) -> Vector (Complex Double)

fromInt' :: Vector I -> Vector (Complex Double)

toInt' :: Vector (Complex Double) -> Vector I

fromZ' :: Vector Z -> Vector (Complex Double)

toZ' :: Vector (Complex Double) -> Vector Z

Container Vector (Complex Float) Source # 
Instance details

Defined in Internal.Numeric

Methods

conj' :: Vector (Complex Float) -> Vector (Complex Float)

size' :: Vector (Complex Float) -> IndexOf Vector

scalar' :: Complex Float -> Vector (Complex Float)

scale' :: Complex Float -> Vector (Complex Float) -> Vector (Complex Float)

addConstant :: Complex Float -> Vector (Complex Float) -> Vector (Complex Float)

add' :: Vector (Complex Float) -> Vector (Complex Float) -> Vector (Complex Float)

sub :: Vector (Complex Float) -> Vector (Complex Float) -> Vector (Complex Float)

mul :: Vector (Complex Float) -> Vector (Complex Float) -> Vector (Complex Float)

equal :: Vector (Complex Float) -> Vector (Complex Float) -> Bool

cmap' :: Element b => (Complex Float -> b) -> Vector (Complex Float) -> Vector b

konst' :: Complex Float -> IndexOf Vector -> Vector (Complex Float)

build' :: IndexOf Vector -> ArgOf Vector (Complex Float) -> Vector (Complex Float)

atIndex' :: Vector (Complex Float) -> IndexOf Vector -> Complex Float

minIndex' :: Vector (Complex Float) -> IndexOf Vector

maxIndex' :: Vector (Complex Float) -> IndexOf Vector

minElement' :: Vector (Complex Float) -> Complex Float

maxElement' :: Vector (Complex Float) -> Complex Float

sumElements' :: Vector (Complex Float) -> Complex Float

prodElements' :: Vector (Complex Float) -> Complex Float

step' :: Vector (Complex Float) -> Vector (Complex Float)

ccompare' :: Vector (Complex Float) -> Vector (Complex Float) -> Vector I

cselect' :: Vector I -> Vector (Complex Float) -> Vector (Complex Float) -> Vector (Complex Float) -> Vector (Complex Float)

find' :: (Complex Float -> Bool) -> Vector (Complex Float) -> [IndexOf Vector]

assoc' :: IndexOf Vector -> Complex Float -> [(IndexOf Vector, Complex Float)] -> Vector (Complex Float)

accum' :: Vector (Complex Float) -> (Complex Float -> Complex Float -> Complex Float) -> [(IndexOf Vector, Complex Float)] -> Vector (Complex Float)

scaleRecip :: Complex Float -> Vector (Complex Float) -> Vector (Complex Float)

divide :: Vector (Complex Float) -> Vector (Complex Float) -> Vector (Complex Float)

arctan2' :: Vector (Complex Float) -> Vector (Complex Float) -> Vector (Complex Float)

cmod' :: Complex Float -> Vector (Complex Float) -> Vector (Complex Float)

fromInt' :: Vector I -> Vector (Complex Float)

toInt' :: Vector (Complex Float) -> Vector I

fromZ' :: Vector Z -> Vector (Complex Float)

toZ' :: Vector (Complex Float) -> Vector Z

KnownNat n => Sized (C n) Vector Source # 
Instance details

Defined in Internal.Static

Methods

konst :: -> C n Source #

unwrap :: C n -> Vector Source #

fromList :: [] -> C n Source #

extract :: C n -> Vector Source #

create :: Vector -> Maybe (C n) Source #

size :: C n -> IndexOf Vector Source #

KnownNat n => Sized (R n) Vector Source # 
Instance details

Defined in Internal.Static

Methods

konst :: -> R n Source #

unwrap :: R n -> Vector Source #

fromList :: [] -> R n Source #

extract :: R n -> Vector Source #

create :: Vector -> Maybe (R n) Source #

size :: R n -> IndexOf Vector Source #

KnownNat m => Container Vector (Mod m I) Source # 
Instance details

Defined in Internal.Modular

Methods

conj' :: Vector (Mod m I) -> Vector (Mod m I)

size' :: Vector (Mod m I) -> IndexOf Vector

scalar' :: Mod m I -> Vector (Mod m I)

scale' :: Mod m I -> Vector (Mod m I) -> Vector (Mod m I)

addConstant :: Mod m I -> Vector (Mod m I) -> Vector (Mod m I)

add' :: Vector (Mod m I) -> Vector (Mod m I) -> Vector (Mod m I)

sub :: Vector (Mod m I) -> Vector (Mod m I) -> Vector (Mod m I)

mul :: Vector (Mod m I) -> Vector (Mod m I) -> Vector (Mod m I)

equal :: Vector (Mod m I) -> Vector (Mod m I) -> Bool

cmap' :: Element b => (Mod m I -> b) -> Vector (Mod m I) -> Vector b

konst' :: Mod m I -> IndexOf Vector -> Vector (Mod m I)

build' :: IndexOf Vector -> ArgOf Vector (Mod m I) -> Vector (Mod m I)

atIndex' :: Vector (Mod m I) -> IndexOf Vector -> Mod m I

minIndex' :: Vector (Mod m I) -> IndexOf Vector

maxIndex' :: Vector (Mod m I) -> IndexOf Vector

minElement' :: Vector (Mod m I) -> Mod m I

maxElement' :: Vector (Mod m I) -> Mod m I

sumElements' :: Vector (Mod m I) -> Mod m I

prodElements' :: Vector (Mod m I) -> Mod m I

step' :: Vector (Mod m I) -> Vector (Mod m I)

ccompare' :: Vector (Mod m I) -> Vector (Mod m I) -> Vector I

cselect' :: Vector I -> Vector (Mod m I) -> Vector (Mod m I) -> Vector (Mod m I) -> Vector (Mod m I)

find' :: (Mod m I -> Bool) -> Vector (Mod m I) -> [IndexOf Vector]

assoc' :: IndexOf Vector -> Mod m I -> [(IndexOf Vector, Mod m I)] -> Vector (Mod m I)

accum' :: Vector (Mod m I) -> (Mod m I -> Mod m I -> Mod m I) -> [(IndexOf Vector, Mod m I)] -> Vector (Mod m I)

scaleRecip :: Mod m I -> Vector (Mod m I) -> Vector (Mod m I)

divide :: Vector (Mod m I) -> Vector (Mod m I) -> Vector (Mod m I)

arctan2' :: Vector (Mod m I) -> Vector (Mod m I) -> Vector (Mod m I)

cmod' :: Mod m I -> Vector (Mod m I) -> Vector (Mod m I)

fromInt' :: Vector I -> Vector (Mod m I)

toInt' :: Vector (Mod m I) -> Vector I

fromZ' :: Vector Z -> Vector (Mod m I)

toZ' :: Vector (Mod m I) -> Vector Z

KnownNat m => Container Vector (Mod m Z) Source # 
Instance details

Defined in Internal.Modular

Methods

conj' :: Vector (Mod m Z) -> Vector (Mod m Z)

size' :: Vector (Mod m Z) -> IndexOf Vector

scalar' :: Mod m Z -> Vector (Mod m Z)

scale' :: Mod m Z -> Vector (Mod m Z) -> Vector (Mod m Z)

addConstant :: Mod m Z -> Vector (Mod m Z) -> Vector (Mod m Z)

add' :: Vector (Mod m Z) -> Vector (Mod m Z) -> Vector (Mod m Z)

sub :: Vector (Mod m Z) -> Vector (Mod m Z) -> Vector (Mod m Z)

mul :: Vector (Mod m Z) -> Vector (Mod m Z) -> Vector (Mod m Z)

equal :: Vector (Mod m Z) -> Vector (Mod m Z) -> Bool

cmap' :: Element b => (Mod m Z -> b) -> Vector (Mod m Z) -> Vector b

konst' :: Mod m Z -> IndexOf Vector -> Vector (Mod m Z)

build' :: IndexOf Vector -> ArgOf Vector (Mod m Z) -> Vector (Mod m Z)

atIndex' :: Vector (Mod m Z) -> IndexOf Vector -> Mod m Z

minIndex' :: Vector (Mod m Z) -> IndexOf Vector

maxIndex' :: Vector (Mod m Z) -> IndexOf Vector

minElement' :: Vector (Mod m Z) -> Mod m Z

maxElement' :: Vector (Mod m Z) -> Mod m Z

sumElements' :: Vector (Mod m Z) -> Mod m Z

prodElements' :: Vector (Mod m Z) -> Mod m Z

step' :: Vector (Mod m Z) -> Vector (Mod m Z)

ccompare' :: Vector (Mod m Z) -> Vector (Mod m Z) -> Vector I

cselect' :: Vector I -> Vector (Mod m Z) -> Vector (Mod m Z) -> Vector (Mod m Z) -> Vector (Mod m Z)

find' :: (Mod m Z -> Bool) -> Vector (Mod m Z) -> [IndexOf Vector]

assoc' :: IndexOf Vector -> Mod m Z -> [(IndexOf Vector, Mod m Z)] -> Vector (Mod m Z)

accum' :: Vector (Mod m Z) -> (Mod m Z -> Mod m Z -> Mod m Z) -> [(IndexOf Vector, Mod m Z)] -> Vector (Mod m Z)

scaleRecip :: Mod m Z -> Vector (Mod m Z) -> Vector (Mod m Z)

divide :: Vector (Mod m Z) -> Vector (Mod m Z) -> Vector (Mod m Z)

arctan2' :: Vector (Mod m Z) -> Vector (Mod m Z) -> Vector (Mod m Z)

cmod' :: Mod m Z -> Vector (Mod m Z) -> Vector (Mod m Z)

fromInt' :: Vector I -> Vector (Mod m Z)

toInt' :: Vector (Mod m Z) -> Vector I

fromZ' :: Vector Z -> Vector (Mod m Z)

toZ' :: Vector (Mod m Z) -> Vector Z

Container Vector e => Build Int (e -> e) Vector e Source # 
Instance details

Defined in Internal.Container

Methods

build :: Int -> (e -> e) -> Vector e Source #

(Binary a, Storable a) => Binary (Vector a) 
Instance details

Defined in Internal.Vector

Methods

put :: Vector a -> Put

get :: Get (Vector a)

putList :: [Vector a] -> Put

NFData (Vector a) 
Instance details

Defined in Data.Vector.Storable

Methods

rnf :: Vector a -> ()

Storable a => Monoid (Vector a) 
Instance details

Defined in Data.Vector.Storable

Methods

mempty :: Vector a

mappend :: Vector a -> Vector a -> Vector a

mconcat :: [Vector a] -> Vector a

Storable a => Semigroup (Vector a) 
Instance details

Defined in Data.Vector.Storable

Methods

(<>) :: Vector a -> Vector a -> Vector a

sconcat :: NonEmpty (Vector a) -> Vector a

stimes :: Integral b => b -> Vector a -> Vector a

(Data a, Storable a) => Data (Vector a) 
Instance details

Defined in Data.Vector.Storable

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Vector a -> c (Vector a)

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Vector a)

toConstr :: Vector a -> Constr

dataTypeOf :: Vector a -> DataType

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Vector a))

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Vector a))

gmapT :: (forall b. Data b => b -> b) -> Vector a -> Vector a

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Vector a -> r

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Vector a -> r

gmapQ :: (forall d. Data d => d -> u) -> Vector a -> [u]

gmapQi :: Int -> (forall d. Data d => d -> u) -> Vector a -> u

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Vector a -> m (Vector a)

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Vector a -> m (Vector a)

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Vector a -> m (Vector a)

Floating (Vector (Complex Double)) 
Instance details

Defined in Numeric.Vector

Methods

pi :: Vector (Complex Double)

exp :: Vector (Complex Double) -> Vector (Complex Double)

log :: Vector (Complex Double) -> Vector (Complex Double)

sqrt :: Vector (Complex Double) -> Vector (Complex Double)

(**) :: Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double)

logBase :: Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double)

sin :: Vector (Complex Double) -> Vector (Complex Double)

cos :: Vector (Complex Double) -> Vector (Complex Double)

tan :: Vector (Complex Double) -> Vector (Complex Double)

asin :: Vector (Complex Double) -> Vector (Complex Double)

acos :: Vector (Complex Double) -> Vector (Complex Double)

atan :: Vector (Complex Double) -> Vector (Complex Double)

sinh :: Vector (Complex Double) -> Vector (Complex Double)

cosh :: Vector (Complex Double) -> Vector (Complex Double)

tanh :: Vector (Complex Double) -> Vector (Complex Double)

asinh :: Vector (Complex Double) -> Vector (Complex Double)

acosh :: Vector (Complex Double) -> Vector (Complex Double)

atanh :: Vector (Complex Double) -> Vector (Complex Double)

log1p :: Vector (Complex Double) -> Vector (Complex Double)

expm1 :: Vector (Complex Double) -> Vector (Complex Double)

log1pexp :: Vector (Complex Double) -> Vector (Complex Double)

log1mexp :: Vector (Complex Double) -> Vector (Complex Double)

Floating (Vector (Complex Float)) 
Instance details

Defined in Numeric.Vector

Methods

pi :: Vector (Complex Float)

exp :: Vector (Complex Float) -> Vector (Complex Float)

log :: Vector (Complex Float) -> Vector (Complex Float)

sqrt :: Vector (Complex Float) -> Vector (Complex Float)

(**) :: Vector (Complex Float) -> Vector (Complex Float) -> Vector (Complex Float)

logBase :: Vector (Complex Float) -> Vector (Complex Float) -> Vector (Complex Float)

sin :: Vector (Complex Float) -> Vector (Complex Float)

cos :: Vector (Complex Float) -> Vector (Complex Float)

tan :: Vector (Complex Float) -> Vector (Complex Float)

asin :: Vector (Complex Float) -> Vector (Complex Float)

acos :: Vector (Complex Float) -> Vector (Complex Float)

atan :: Vector (Complex Float) -> Vector (Complex Float)

sinh :: Vector (Complex Float) -> Vector (Complex Float)

cosh :: Vector (Complex Float) -> Vector (Complex Float)

tanh :: Vector (Complex Float) -> Vector (Complex Float)

asinh :: Vector (Complex Float) -> Vector (Complex Float)

acosh :: Vector (Complex Float) -> Vector (Complex Float)

atanh :: Vector (Complex Float) -> Vector (Complex Float)

log1p :: Vector (Complex Float) -> Vector (Complex Float)

expm1 :: Vector (Complex Float) -> Vector (Complex Float)

log1pexp :: Vector (Complex Float) -> Vector (Complex Float)

log1mexp :: Vector (Complex Float) -> Vector (Complex Float)

Floating (Vector Double) 
Instance details

Defined in Numeric.Vector

Methods

pi :: Vector Double

exp :: Vector Double -> Vector Double

log :: Vector Double -> Vector Double

sqrt :: Vector Double -> Vector Double

(**) :: Vector Double -> Vector Double -> Vector Double

logBase :: Vector Double -> Vector Double -> Vector Double

sin :: Vector Double -> Vector Double

cos :: Vector Double -> Vector Double

tan :: Vector Double -> Vector Double

asin :: Vector Double -> Vector Double

acos :: Vector Double -> Vector Double

atan :: Vector Double -> Vector Double

sinh :: Vector Double -> Vector Double

cosh :: Vector Double -> Vector Double

tanh :: Vector Double -> Vector Double

asinh :: Vector Double -> Vector Double

acosh :: Vector Double -> Vector Double

atanh :: Vector Double -> Vector Double

log1p :: Vector Double -> Vector Double

expm1 :: Vector Double -> Vector Double

log1pexp :: Vector Double -> Vector Double

log1mexp :: Vector Double -> Vector Double

Floating (Vector Float) 
Instance details

Defined in Numeric.Vector

Methods

pi :: Vector Float

exp :: Vector Float -> Vector Float

log :: Vector Float -> Vector Float

sqrt :: Vector Float -> Vector Float

(**) :: Vector Float -> Vector Float -> Vector Float

logBase :: Vector Float -> Vector Float -> Vector Float

sin :: Vector Float -> Vector Float

cos :: Vector Float -> Vector Float

tan :: Vector Float -> Vector Float

asin :: Vector Float -> Vector Float

acos :: Vector Float -> Vector Float

atan :: Vector Float -> Vector Float

sinh :: Vector Float -> Vector Float

cosh :: Vector Float -> Vector Float

tanh :: Vector Float -> Vector Float

asinh :: Vector Float -> Vector Float

acosh :: Vector Float -> Vector Float

atanh :: Vector Float -> Vector Float

log1p :: Vector Float -> Vector Float

expm1 :: Vector Float -> Vector Float

log1pexp :: Vector Float -> Vector Float

log1mexp :: Vector Float -> Vector Float

Storable a => IsList (Vector a) 
Instance details

Defined in Data.Vector.Storable

Associated Types

type Item (Vector a) 
Instance details

Defined in Data.Vector.Storable

type Item (Vector a) = a

Methods

fromList :: [Item (Vector a)] -> Vector a

fromListN :: Int -> [Item (Vector a)] -> Vector a

toList :: Vector a -> [Item (Vector a)]

Num (Vector (Complex Double)) 
Instance details

Defined in Numeric.Vector

Methods

(+) :: Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double)

(-) :: Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double)

(*) :: Vector (Complex Double) -> Vector (Complex Double) -> Vector (Complex Double)

negate :: Vector (Complex Double) -> Vector (Complex Double)

abs :: Vector (Complex Double) -> Vector (Complex Double)

signum :: Vector (Complex Double) -> Vector (Complex Double)

fromInteger :: Integer -> Vector (Complex Double)

Num (Vector (Complex Float)) 
Instance details

Defined in Numeric.Vector

Methods

(+) :: Vector (Complex Float) -> Vector (Complex Float) -> Vector (Complex Float)

(-) :: Vector (Complex Float) -> Vector (Complex Float) -> Vector (Complex Float)

(*) :: Vector (Complex Float) -> Vector (Complex Float) -> Vector (Complex Float)

negate :: Vector (Complex Float) -> Vector (Complex Float)

abs :: Vector (Complex Float) -> Vector (Complex Float)

signum :: Vector (Complex Float) -> Vector (Complex Float)

fromInteger :: Integer -> Vector (Complex Float)

KnownNat m => Num (Vector (Mod m I)) 
Instance details

Defined in Internal.Modular

Methods

(+) :: Vector (Mod m I) -> Vector (Mod m I) -> Vector (Mod m I)

(-) :: Vector (Mod m I) -> Vector (Mod m I) -> Vector (Mod m I)

(*) :: Vector (Mod m I) -> Vector (Mod m I) -> Vector (Mod m I)

negate :: Vector (Mod m I) -> Vector (Mod m I)

abs :: Vector (Mod m I) -> Vector (Mod m I)

signum :: Vector (Mod m I) -> Vector (Mod m I)

fromInteger :: Integer -> Vector (Mod m I)

KnownNat m => Num (Vector (Mod m Z)) 
Instance details

Defined in Internal.Modular

Methods

(+) :: Vector (Mod m Z) -> Vector (Mod m Z) -> Vector (Mod m Z)

(-) :: Vector (Mod m Z) -> Vector (Mod m Z) -> Vector (Mod m Z)

(*) :: Vector (Mod m Z) -> Vector (Mod m Z) -> Vector (Mod m Z)

negate :: Vector (Mod m Z) -> Vector (Mod m Z)

abs :: Vector (Mod m Z) -> Vector (Mod m Z)

signum :: Vector (Mod m Z) -> Vector (Mod m Z)

fromInteger :: Integer -> Vector (Mod m Z)

Num (Vector I) 
Instance details

Defined in Numeric.Vector

Methods

(+) :: Vector I -> Vector I -> Vector I

(-) :: Vector I -> Vector I -> Vector I

(*) :: Vector I -> Vector I -> Vector I

negate :: Vector I -> Vector I

abs :: Vector I -> Vector I

signum :: Vector I -> Vector I

fromInteger :: Integer -> Vector I

Num (Vector Z) 
Instance details

Defined in Numeric.Vector

Methods

(+) :: Vector Z -> Vector Z -> Vector Z

(-) :: Vector Z -> Vector Z -> Vector Z

(*) :: Vector Z -> Vector Z -> Vector Z

negate :: Vector Z -> Vector Z

abs :: Vector Z -> Vector Z

signum :: Vector Z -> Vector Z

fromInteger :: Integer -> Vector Z

Num (Vector Double) 
Instance details

Defined in Numeric.Vector

Methods

(+) :: Vector Double -> Vector Double -> Vector Double

(-) :: Vector Double -> Vector Double -> Vector Double

(*) :: Vector Double -> Vector Double -> Vector Double

negate :: Vector Double -> Vector Double

abs :: Vector Double -> Vector Double

signum :: Vector Double -> Vector Double

fromInteger :: Integer -> Vector Double

Num (Vector Float) 
Instance details

Defined in Numeric.Vector

Methods

(+) :: Vector Float -> Vector Float -> Vector Float

(-) :: Vector Float -> Vector Float -> Vector Float

(*) :: Vector Float -> Vector Float -> Vector Float

negate :: Vector Float -> Vector Float

abs :: Vector Float -> Vector Float

signum :: Vector Float -> Vector Float

fromInteger :: Integer -> Vector Float

(Read a, Storable a) => Read (Vector a) 
Instance details

Defined in Data.Vector.Storable

Methods

readsPrec :: Int -> ReadS (Vector a)

readList :: ReadS [Vector a]

readPrec :: ReadPrec (Vector a)

readListPrec :: ReadPrec [Vector a]

(Container Vector a, Num (Vector a), Fractional a) => Fractional (Vector a) 
Instance details

Defined in Numeric.Vector

Methods

(/) :: Vector a -> Vector a -> Vector a

recip :: Vector a -> Vector a

fromRational :: Rational -> Vector a

(Show a, Storable a) => Show (Vector a) 
Instance details

Defined in Data.Vector.Storable

Methods

showsPrec :: Int -> Vector a -> ShowS

show :: Vector a -> String

showList :: [Vector a] -> ShowS

(Storable a, Eq a) => Eq (Vector a) 
Instance details

Defined in Data.Vector.Storable

Methods

(==) :: Vector a -> Vector a -> Bool

(/=) :: Vector a -> Vector a -> Bool

(Storable a, Ord a) => Ord (Vector a) 
Instance details

Defined in Data.Vector.Storable

Methods

compare :: Vector a -> Vector a -> Ordering

(<) :: Vector a -> Vector a -> Bool

(<=) :: Vector a -> Vector a -> Bool

(>) :: Vector a -> Vector a -> Bool

(>=) :: Vector a -> Vector a -> Bool

max :: Vector a -> Vector a -> Vector a

min :: Vector a -> Vector a -> Vector a

Storable t => TransArray (Vector t) Source # 
Instance details

Defined in Internal.Devel

Methods

apply :: Vector t -> (b -> IO r) -> Trans (Vector t) b -> IO r Source #

applyRaw :: Vector t -> (b -> IO r) -> TransRaw (Vector t) b -> IO r Source #

Container Vector t => Additive (Vector t) Source # 
Instance details

Defined in Internal.Numeric

Methods

add :: Vector t -> Vector t -> Vector t Source #

Normed (Vector (Complex Float)) Source # 
Instance details

Defined in Internal.Util

Methods

norm_0 :: Vector (Complex Float) -> R Source #

norm_1 :: Vector (Complex Float) -> R Source #

norm_2 :: Vector (Complex Float) -> R Source #

norm_Inf :: Vector (Complex Float) -> R Source #

KnownNat m => Normed (Vector (Mod m I)) Source # 
Instance details

Defined in Internal.Modular

Methods

norm_0 :: Vector (Mod m I) -> R Source #

norm_1 :: Vector (Mod m I) -> R Source #

norm_2 :: Vector (Mod m I) -> R Source #

norm_Inf :: Vector (Mod m I) -> R Source #

KnownNat m => Normed (Vector (Mod m Z)) Source # 
Instance details

Defined in Internal.Modular

Methods

norm_0 :: Vector (Mod m Z) -> R Source #

norm_1 :: Vector (Mod m Z) -> R Source #

norm_2 :: Vector (Mod m Z) -> R Source #

norm_Inf :: Vector (Mod m Z) -> R Source #

Normed (Vector C) Source # 
Instance details

Defined in Internal.Util

Normed (Vector I) Source # 
Instance details

Defined in Internal.Util

Normed (Vector R) Source # 
Instance details

Defined in Internal.Util

Normed (Vector Z) Source # 
Instance details

Defined in Internal.Util

Normed (Vector Float) Source # 
Instance details

Defined in Internal.Util

Methods

norm_0 :: Vector Float -> R Source #

norm_1 :: Vector Float -> R Source #

norm_2 :: Vector Float -> R Source #

norm_Inf :: Vector Float -> R Source #

Indexable (Vector I) I Source # 
Instance details

Defined in Internal.Util

Methods

(!) :: Vector I -> Int -> I Source #

Indexable (Vector Z) Z Source # 
Instance details

Defined in Internal.Util

Methods

(!) :: Vector Z -> Int -> Z Source #

Indexable (Vector Double) Double Source # 
Instance details

Defined in Internal.Util

Methods

(!) :: Vector Double -> Int -> Double Source #

Indexable (Vector Float) Float Source # 
Instance details

Defined in Internal.Util

Methods

(!) :: Vector Float -> Int -> Float Source #

Element t => Indexable (Matrix t) (Vector t) Source # 
Instance details

Defined in Internal.Util

Methods

(!) :: Matrix t -> Int -> Vector t Source #

Indexable (Vector (Complex Double)) (Complex Double) Source # 
Instance details

Defined in Internal.Util

Methods

(!) :: Vector (Complex Double) -> Int -> Complex Double Source #

Indexable (Vector (Complex Float)) (Complex Float) Source # 
Instance details

Defined in Internal.Util

Methods

(!) :: Vector (Complex Float) -> Int -> Complex Float Source #

(Storable t, Indexable (Vector t) t) => Indexable (Vector (Mod m t)) (Mod m t) Source # 
Instance details

Defined in Internal.Modular

Methods

(!) :: Vector (Mod m t) -> Int -> Mod m t Source #

type IndexOf Vector Source # 
Instance details

Defined in Internal.Numeric

type IndexOf Vector = Int
type Mutable Vector 
Instance details

Defined in Data.Vector.Storable

type Mutable Vector = MVector
type Item (Vector a) 
Instance details

Defined in Data.Vector.Storable

type Item (Vector a) = a
type Trans (Vector t) b Source # 
Instance details

Defined in Internal.Devel

type Trans (Vector t) b = CInt -> Ptr t -> b
type TransRaw (Vector t) b Source # 
Instance details

Defined in Internal.Devel

type TransRaw (Vector t) b = CInt -> Ptr t -> b

data Matrix t Source #

Matrix representation suitable for BLAS/LAPACK computations.

Instances

Instances details
LSDiv Matrix Source # 
Instance details

Defined in Internal.Container

Methods

linSolve :: Field t => Matrix t -> Matrix t -> Matrix t

Complexable Matrix Source # 
Instance details

Defined in Internal.Conversion

Methods

toComplex' :: RealElement e => (Matrix e, Matrix e) -> Matrix (Complex e)

fromComplex' :: RealElement e => Matrix (Complex e) -> (Matrix e, Matrix e)

comp' :: RealElement e => Matrix e -> Matrix (Complex e)

single' :: Precision a b => Matrix b -> Matrix a

double' :: Precision a b => Matrix a -> Matrix b

(Num a, Element a, Container Vector a) => Container Matrix a Source # 
Instance details

Defined in Internal.Numeric

Methods

conj' :: Matrix a -> Matrix a

size' :: Matrix a -> IndexOf Matrix

scalar' :: a -> Matrix a

scale' :: a -> Matrix a -> Matrix a

addConstant :: a -> Matrix a -> Matrix a

add' :: Matrix a -> Matrix a -> Matrix a

sub :: Matrix a -> Matrix a -> Matrix a

mul :: Matrix a -> Matrix a -> Matrix a

equal :: Matrix a -> Matrix a -> Bool

cmap' :: Element b => (a -> b) -> Matrix a -> Matrix b

konst' :: a -> IndexOf Matrix -> Matrix a

build' :: IndexOf Matrix -> ArgOf Matrix a -> Matrix a

atIndex' :: Matrix a -> IndexOf Matrix -> a

minIndex' :: Matrix a -> IndexOf Matrix

maxIndex' :: Matrix a -> IndexOf Matrix

minElement' :: Matrix a -> a

maxElement' :: Matrix a -> a

sumElements' :: Matrix a -> a

prodElements' :: Matrix a -> a

step' :: Matrix a -> Matrix a

ccompare' :: Matrix a -> Matrix a -> Matrix I

cselect' :: Matrix I -> Matrix a -> Matrix a -> Matrix a -> Matrix a

find' :: (a -> Bool) -> Matrix a -> [IndexOf Matrix]

assoc' :: IndexOf Matrix -> a -> [(IndexOf Matrix, a)] -> Matrix a

accum' :: Matrix a -> (a -> a -> a) -> [(IndexOf Matrix, a)] -> Matrix a

scaleRecip :: a -> Matrix a -> Matrix a

divide :: Matrix a -> Matrix a -> Matrix a

arctan2' :: Matrix a -> Matrix a -> Matrix a

cmod' :: a -> Matrix a -> Matrix a

fromInt' :: Matrix I -> Matrix a

toInt' :: Matrix a -> Matrix I

fromZ' :: Matrix Z -> Matrix a

toZ' :: Matrix a -> Matrix Z

Container Matrix t => Linear t Matrix Source # 
Instance details

Defined in Internal.Numeric

Methods

scale :: t -> Matrix t -> Matrix t Source #

(Num e, Container Vector e) => Konst e (Int, Int) Matrix Source # 
Instance details

Defined in Internal.Numeric

Methods

konst :: e -> (Int, Int) -> Matrix e Source #

(KnownNat m, KnownNat n) => Sized (M m n) Matrix Source # 
Instance details

Defined in Internal.Static

Methods

konst :: -> M m n Source #

unwrap :: M m n -> Matrix Source #

fromList :: [] -> M m n Source #

extract :: M m n -> Matrix Source #

create :: Matrix -> Maybe (M m n) Source #

size :: M m n -> IndexOf Matrix Source #

(KnownNat m, KnownNat n) => Sized (L m n) Matrix Source # 
Instance details

Defined in Internal.Static

Methods

konst :: -> L m n Source #

unwrap :: L m n -> Matrix Source #

fromList :: [] -> L m n Source #

extract :: L m n -> Matrix Source #

create :: Matrix -> Maybe (L m n) Source #

size :: L m n -> IndexOf Matrix Source #

(Binary a, Element a) => Binary (Matrix a) 
Instance details

Defined in Internal.Element

Methods

put :: Matrix a -> Put

get :: Get (Matrix a)

putList :: [Matrix a] -> Put

(Storable t, NFData t) => NFData (Matrix t) Source # 
Instance details

Defined in Internal.Matrix

Methods

rnf :: Matrix t -> ()

(Container Vector t, Eq t, Num (Vector t), Product t) => Monoid (Matrix t) 
Instance details

Defined in Numeric.Matrix

Methods

mempty :: Matrix t

mappend :: Matrix t -> Matrix t -> Matrix t

mconcat :: [Matrix t] -> Matrix t

(Container Vector t, Eq t, Num (Vector t), Product t) => Semigroup (Matrix t) 
Instance details

Defined in Numeric.Matrix

Methods

(<>) :: Matrix t -> Matrix t -> Matrix t

sconcat :: NonEmpty (Matrix t) -> Matrix t

stimes :: Integral b => b -> Matrix t -> Matrix t

(Floating a, Container Vector a, Floating (Vector a), Fractional (Matrix a)) => Floating (Matrix a) 
Instance details

Defined in Numeric.Matrix

Methods

pi :: Matrix a

exp :: Matrix a -> Matrix a

log :: Matrix a -> Matrix a

sqrt :: Matrix a -> Matrix a

(**) :: Matrix a -> Matrix a -> Matrix a

logBase :: Matrix a -> Matrix a -> Matrix a

sin :: Matrix a -> Matrix a

cos :: Matrix a -> Matrix a

tan :: Matrix a -> Matrix a

asin :: Matrix a -> Matrix a

acos :: Matrix a -> Matrix a

atan :: Matrix a -> Matrix a

sinh :: Matrix a -> Matrix a

cosh :: Matrix a -> Matrix a

tanh :: Matrix a -> Matrix a

asinh :: Matrix a -> Matrix a

acosh :: Matrix a -> Matrix a

atanh :: Matrix a -> Matrix a

log1p :: Matrix a -> Matrix a

expm1 :: Matrix a -> Matrix a

log1pexp :: Matrix a -> Matrix a

log1mexp :: Matrix a -> Matrix a

(Container Matrix a, Num a, Num (Vector a)) => Num (Matrix a) 
Instance details

Defined in Numeric.Matrix

Methods

(+) :: Matrix a -> Matrix a -> Matrix a

(-) :: Matrix a -> Matrix a -> Matrix a

(*) :: Matrix a -> Matrix a -> Matrix a

negate :: Matrix a -> Matrix a

abs :: Matrix a -> Matrix a

signum :: Matrix a -> Matrix a

fromInteger :: Integer -> Matrix a

(Element a, Read a) => Read (Matrix a) 
Instance details

Defined in Internal.Element

Methods

readsPrec :: Int -> ReadS (Matrix a)

readList :: ReadS [Matrix a]

readPrec :: ReadPrec (Matrix a)

readListPrec :: ReadPrec [Matrix a]

(Container Vector a, Fractional a, Fractional (Vector a), Num (Matrix a)) => Fractional (Matrix a) 
Instance details

Defined in Numeric.Matrix

Methods

(/) :: Matrix a -> Matrix a -> Matrix a

recip :: Matrix a -> Matrix a

fromRational :: Rational -> Matrix a

(Show a, Element a) => Show (Matrix a) 
Instance details

Defined in Internal.Element

Methods

showsPrec :: Int -> Matrix a -> ShowS

show :: Matrix a -> String

showList :: [Matrix a] -> ShowS

Container Matrix a => Eq (Matrix a) 
Instance details

Defined in Numeric.Matrix

Methods

(==) :: Matrix a -> Matrix a -> Bool

(/=) :: Matrix a -> Matrix a -> Bool

Storable t => TransArray (Matrix t) Source # 
Instance details

Defined in Internal.Matrix

Methods

apply :: Matrix t -> (b -> IO r) -> Trans (Matrix t) b -> IO r Source #

applyRaw :: Matrix t -> (b -> IO r) -> TransRaw (Matrix t) b -> IO r Source #

Container Matrix t => Additive (Matrix t) Source # 
Instance details

Defined in Internal.Numeric

Methods

add :: Matrix t -> Matrix t -> Matrix t Source #

KnownNat m => Testable (Matrix (Mod m I)) Source # 
Instance details

Defined in Internal.Modular

Methods

checkT :: Matrix (Mod m I) -> (Bool, IO ()) Source #

ioCheckT :: Matrix (Mod m I) -> IO (Bool, IO ()) Source #

Testable (Matrix I) Source # 
Instance details

Defined in Internal.Util

Methods

checkT :: Matrix I -> (Bool, IO ()) Source #

ioCheckT :: Matrix I -> IO (Bool, IO ()) Source #

Normed (Matrix C) Source # 
Instance details

Defined in Internal.Util

Normed (Matrix R) Source # 
Instance details

Defined in Internal.Util

(CTrans t, Container Vector t) => Transposable (Matrix t) (Matrix t) Source # 
Instance details

Defined in Internal.Numeric

Methods

tr :: Matrix t -> Matrix t Source #

tr' :: Matrix t -> Matrix t Source #

Element t => Indexable (Matrix t) (Vector t) Source # 
Instance details

Defined in Internal.Util

Methods

(!) :: Matrix t -> Int -> Vector t Source #

(Num e, Container Vector e) => Build (Int, Int) (e -> e -> e) Matrix e Source # 
Instance details

Defined in Internal.Container

Methods

build :: (Int, Int) -> (e -> e -> e) -> Matrix e Source #

type IndexOf Matrix Source # 
Instance details

Defined in Internal.Numeric

type IndexOf Matrix = (Int, Int)
type Trans (Matrix t) b Source # 
Instance details

Defined in Internal.Matrix

type Trans (Matrix t) b = CInt -> CInt -> CInt -> CInt -> Ptr t -> b
type TransRaw (Matrix t) b Source # 
Instance details

Defined in Internal.Matrix

type TransRaw (Matrix t) b = CInt -> CInt -> Ptr t -> b

data GMatrix Source #

General matrix with specialized internal representations for dense, sparse, diagonal, banded, and constant elements.

>>> let m = mkSparse [((0,999),1.0),((1,1999),2.0)]
>>> m
SparseR {gmCSR = CSR {csrVals = fromList [1.0,2.0],
                      csrCols = fromList [1000,2000],
                      csrRows = fromList [1,2,3],
                      csrNRows = 2,
                      csrNCols = 2000},
                      nRows = 2,
                      nCols = 2000}
>>> let m = mkDense (mat 2 [1..4])
>>> m
Dense {gmDense = (2><2)
 [ 1.0, 2.0
 , 3.0, 4.0 ], nRows = 2, nCols = 2}

Instances

Instances details
Show GMatrix Source # 
Instance details

Defined in Internal.Sparse

Methods

showsPrec :: Int -> GMatrix -> ShowS

show :: GMatrix -> String

showList :: [GMatrix] -> ShowS

Testable GMatrix Source # 
Instance details

Defined in Internal.CG

Methods

checkT :: GMatrix -> (Bool, IO ()) Source #

ioCheckT :: GMatrix -> IO (Bool, IO ()) Source #

Transposable GMatrix GMatrix Source # 
Instance details

Defined in Internal.Sparse

nRows :: GMatrix -> Int Source #

nCols :: GMatrix -> Int Source #