|
Data.Packed.Internal.Matrix | Portability | portable (uses FFI) | Stability | provisional | Maintainer | Alberto Ruiz <aruiz@um.es> |
|
|
|
Description |
Internal matrix representation
|
|
Synopsis |
|
| | | | trans :: Matrix t -> Matrix t | | flatten :: Element t => Matrix t -> Vector t | | type Mt t s = Int -> Int -> Ptr t -> s | | toLists :: Element t => Matrix t -> [[t]] | | fromRows :: Element t => [Vector t] -> Matrix t | | toRows :: Element t => Matrix t -> [Vector t] | | fromColumns :: Element t => [Vector t] -> Matrix t | | toColumns :: Element t => Matrix t -> [Vector t] | | (@@>) :: Storable t => Matrix t -> (Int, Int) -> t | | reshape :: Element t => Int -> Vector t -> Matrix t | | liftMatrix :: (Element a, Element b) => (Vector a -> Vector b) -> Matrix a -> Matrix b | | liftMatrix2 :: (Element t, Element a, Element b) => (Vector a -> Vector b -> Vector t) -> Matrix a -> Matrix b -> Matrix t | | compat :: Matrix a -> Matrix b -> Bool | | class (Storable a, Floating a) => Element a where | | | (>|<) :: Element a => Int -> Int -> [a] -> Matrix a | | transdataR :: Int -> Vector Double -> Int -> Vector Double | | transdataC :: Int -> Vector (Complex Double) -> Int -> Vector (Complex Double) | | ctransR :: TMM | | ctransC :: TCMCM | | cmultiplyR :: Int -> Int -> Int -> Ptr Double -> Int -> Int -> Int -> Ptr Double -> Int -> Int -> Ptr Double -> IO Int | | cmultiplyC :: Int -> Int -> Int -> Ptr (Complex Double) -> Int -> Int -> Int -> Ptr (Complex Double) -> Int -> Int -> Ptr (Complex Double) -> IO Int | | multiply' :: Element a => MatrixOrder -> Matrix a -> Matrix a -> Matrix a | | multiply :: Element a => Matrix a -> Matrix a -> Matrix a | | subMatrixR :: (Int, Int) -> (Int, Int) -> Matrix Double -> Matrix Double | | c_submatrixR :: Int -> Int -> Int -> Int -> TMM | | subMatrixC :: (Int, Int) -> (Int, Int) -> Matrix (Complex Double) -> Matrix (Complex Double) | | subMatrix :: Element a => (Int, Int) -> (Int, Int) -> Matrix a -> Matrix a | | diagR :: Vector Double -> Matrix Double | | c_diagR :: TVM | | diagC :: Vector (Complex Double) -> Matrix (Complex Double) | | c_diagC :: TCVCM | | diag :: Element a => Vector a -> Matrix a | | constantR :: Double -> Int -> Vector Double | | cconstantR :: Ptr Double -> TV | | constantC :: Complex Double -> Int -> Vector (Complex Double) | | cconstantC :: Ptr (Complex Double) -> TCV | | constant :: Element a => a -> Int -> Vector a | | conj :: Vector (Complex Double) -> Vector (Complex Double) | | toComplex :: (Vector Double, Vector Double) -> Vector (Complex Double) | | fromComplex :: Vector (Complex Double) -> (Vector Double, Vector Double) | | comp :: Vector Double -> Vector (Complex Double) | | fromFile :: FilePath -> (Int, Int) -> IO (Matrix Double) | | c_gslReadMatrix :: Ptr CChar -> TM |
|
|
Documentation |
|
|
Constructors | | Instances | |
|
|
|
Matrix representation suitable for GSL and LAPACK computations.
| Constructors | | Instances | |
|
|
|
Matrix transpose.
|
|
|
Creates a vector by concatenation of rows
> flatten (ident 3)
9 |> [1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0] |
|
|
|
|
the inverse of Data.Packed.Matrix.fromLists
|
|
|
creates a Matrix from a list of vectors
|
|
|
extracts the rows of a matrix as a list of vectors
|
|
|
Creates a matrix from a list of vectors, as columns
|
|
|
Creates a list of vectors from the columns of a matrix
|
|
|
Reads a matrix position.
|
|
|
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 = trans . 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 ] |
|
|
application of a vector function on the flattened matrix elements
|
|
|
application of a vector function on the flattened matrices elements
|
|
|
|
|
Optimized matrix computations are provided for elements in the Element class.
| | Methods | | | Instances | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
matrix product
|
|
|
extraction of a submatrix from a real matrix
|
|
|
|
|
extraction of a submatrix from a complex matrix
|
|
|
:: Element a | | => (Int, Int) | (r0,c0) starting position
| -> (Int, Int) | (rt,ct) dimensions of submatrix
| -> Matrix a | input matrix
| -> Matrix a | result
| Extracts a submatrix from a matrix.
|
|
|
|
diagonal matrix from a real vector
|
|
|
|
|
diagonal matrix from a real vector
|
|
|
|
|
creates a square matrix with the given diagonal
|
|
|
|
|
|
|
|
|
|
|
creates a vector with a given number of equal components:
> constant 2 7
7 |> [2.0,2.0,2.0,2.0,2.0,2.0,2.0] |
|
|
obtains the complex conjugate of a complex vector
|
|
|
creates a complex vector from vectors with real and imaginary parts
|
|
|
the inverse of toComplex
|
|
|
converts a real vector into a complex representation (with zero imaginary parts)
|
|
|
loads a matrix efficiently from formatted ASCII text file (the number of rows and columns must be known in advance).
|
|
|
|
Produced by Haddock version 2.4.2 |