-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Some utility functions for haskell-eigen library -- -- Please see README.md @package haskell-eigen-util @version 0.1.0.0 module Data.Eigen.Util -- | rowAdd row r1 = k1 * row r1 + k2 * row r2 rowAdd :: Elem a b => (a, Int) -> (a, Int) -> Matrix a b -> Matrix a b -- | colAdd col c1 = k1 * col c1 + k2 * col c2 colAdd :: Elem a b => (a, Int) -> (a, Int) -> Matrix a b -> Matrix a b -- | scale a row by a factor scaleRow :: Elem a b => Int -> a -> Matrix a b -> Matrix a b -- | scale a column by a factor scaleCol :: Elem a b => Int -> a -> Matrix a b -> Matrix a b -- | 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. fromList' :: Elem a b => Int -> [a] -> Matrix a b -- | Stack matrices horizontallly hstack :: Elem a b => [Matrix a b] -> Matrix a b -- | 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. vstack :: Elem a b => [Matrix a b] -> Matrix a b -- | delete a row delRow :: Elem a b => Int -> Matrix a b -> Matrix a b -- | delete list of given rows delRows :: Elem a b => [Int] -> Matrix a b -> Matrix a b -- | delete a column delCol :: Elem a b => Int -> Matrix a b -> Matrix a b -- | delete list of given columns delCols :: Elem a b => [Int] -> Matrix a b -> Matrix a b -- | Kronecker matric multiplication. kronecker :: Elem a b => Matrix a b -> Matrix a b -> Matrix a b