haskell-eigen-util-0.1.0.4: Some utility functions for haskell-eigen library

Safe HaskellNone
LanguageHaskell2010

Data.Eigen.Util

Synopsis

Documentation

Basic operations on rows and columns on rows and columns on rows and columns on rows and columns

rowAdd :: Elem a b => Int -> (a, Int) -> Matrix a b -> Matrix a b Source #

rowAdd r1 = r1 + k * r2

rowsAdd :: Elem a b => [Int] -> [a] -> Matrix a b -> Matrix a b Source #

Adds a list of given rows with a list weights to the first row in the list. - Note that first value in the list of weights is ignored

colAdd :: Elem a b => Int -> (a, Int) -> Matrix a b -> Matrix a b Source #

colAdd c1 = c1 + k * c2

colsAdd :: Elem a b => [Int] -> [a] -> Matrix a b -> Matrix a b Source #

Adds a list of given columns with a list weights to the first column in the list. - Note that first value in the list of weights is ignored

scaleRow :: Elem a b => Int -> a -> Matrix a b -> Matrix a b Source #

scale a row by a factor

scaleCol :: Elem a b => Int -> a -> Matrix a b -> Matrix a b Source #

scale a column by a factor

Matrix creation from list

fromList' :: Elem a b => Int -> [a] -> Matrix a b Source #

Alternative implementation of fromList. It accepts a flatten list of -- elements and number of columns. -- No tests are performed to check if number of elements in list are sufficient. -

stacking functions

hstack :: Elem a b => [Matrix a b] -> Matrix a b Source #

Stack matrices horizontallly

vstack :: Elem a b => [Matrix a b] -> Matrix a b Source #

Stack given matrices vertically. It uses the following property -- vstack [a, b, c ..] = ( hstack [a',b',c'.. ] )' where M' is transpose of -- matrix M. -- -- TODO: This is computationally inefficient than implementing is directly like -- hstack.

Function to manipulate matrices

delRow :: Elem a b => Int -> Matrix a b -> Matrix a b Source #

delete a row

delRows :: Elem a b => [Int] -> Matrix a b -> Matrix a b Source #

delete list of given rows

delCol :: Elem a b => Int -> Matrix a b -> Matrix a b Source #

delete a column

delCols :: Elem a b => [Int] -> Matrix a b -> Matrix a b Source #

delete list of given columns

Kronecker product of two matrix

kronecker :: Elem a b => Matrix a b -> Matrix a b -> Matrix a b Source #

Kronecker matric multiplication.

Display matrix

pprint :: (PrintfArg a, Elem a b) => Matrix a b -> String Source #

Pretty print the matrix

pprintIO :: (PrintfArg a, Elem a b) => Matrix a b -> IO () Source #

print matrix in IO monad