Safe Haskell | Safe-Infered |
---|

This module provides wrappers for CvMat type. This is still preliminary as the type of the matrix isn't coded in the haskell type.

- class Exists a where
- data Matrix a
- emptyMatrix :: Exists (Matrix a) => Args (Matrix a) -> Matrix a
- fromFunction :: (Storable t, Exists (Matrix t), Args (Matrix t) ~ (Int, Int)) => (Int, Int) -> ((Int, Int) -> t) -> Matrix t
- fromList :: forall t. (Storable t, Exists (Matrix t), Args (Matrix t) ~ (Int, Int)) => (Int, Int) -> [t] -> Matrix t
- toList :: Storable a => Matrix a -> [a]
- toRows :: forall t. Storable t => Matrix t -> [[t]]
- toCols :: forall t. Storable t => Matrix t -> [[t]]
- get :: forall t. Storable t => Matrix t -> Int -> Int -> IO t
- put :: forall t. Storable t => Matrix t -> Int -> Int -> t -> IO ()
- withMatPtr :: Matrix x -> (Ptr C'CvMat -> IO a) -> IO a
- transpose :: (Exists (Matrix a), Args (Matrix a) ~ Size (Matrix a)) => Matrix a -> Matrix a
- mxm :: (Exists (Matrix a), Args (Matrix a) ~ Size (Matrix a)) => Matrix a -> Matrix a -> Matrix a
- rodrigues2 :: (Exists (Matrix a), Args (Matrix a) ~ Size (Matrix a)) => Matrix a -> Matrix a
- identity :: (Num a, Sized (Matrix a), Args (Matrix a) ~ (Int, Int), Size (Matrix a) ~ (Int, Int), Storable a, Exists (Matrix a)) => Matrix a -> Matrix a

# Documentation

Exists (Matrix Double) | |

Exists (Matrix Float) | |

Exists (Matrix Int) | |

Exists (Matrix (Double, Double)) | |

Exists (Matrix (Float, Float)) | |

Exists (Matrix (Int, Int)) | |

Exists (Matrix (CFloat, CFloat)) | |

Exists (Matrix (Float, Float, Float)) | |

Exists (Matrix (CFloat, CFloat, CFloat)) | |

Exists (Matrix (Int, Int, Int, Int)) | |

Exists (Matrix (CInt, CInt, CInt, CInt)) |

(Show t, Storable t, ~ * (Size (Matrix t)) (Int, Int)) => Show (Matrix t) | |

Sized (Matrix a) | |

Exists (Matrix Double) | |

Exists (Matrix Float) | |

Exists (Matrix Int) | |

Exists (Matrix (Double, Double)) | |

Exists (Matrix (Float, Float)) | |

Exists (Matrix (Int, Int)) | |

Exists (Matrix (CFloat, CFloat)) | |

Exists (Matrix (Float, Float, Float)) | |

Exists (Matrix (CFloat, CFloat, CFloat)) | |

Exists (Matrix (Int, Int, Int, Int)) | |

Exists (Matrix (CInt, CInt, CInt, CInt)) |

emptyMatrix :: Exists (Matrix a) => Args (Matrix a) -> Matrix aSource

Create an empty matrix of given dimensions

fromFunction :: (Storable t, Exists (Matrix t), Args (Matrix t) ~ (Int, Int)) => (Int, Int) -> ((Int, Int) -> t) -> Matrix tSource

Generate a matrix from a index function

fromList :: forall t. (Storable t, Exists (Matrix t), Args (Matrix t) ~ (Int, Int)) => (Int, Int) -> [t] -> Matrix tSource

toRows :: forall t. Storable t => Matrix t -> [[t]]Source

Convert matrix to rows represented as nested lists

toCols :: forall t. Storable t => Matrix t -> [[t]]Source

Convert matrix to cols represented as nested lists

put :: forall t. Storable t => Matrix t -> Int -> Int -> t -> IO ()Source

Write an element to a matrix

transpose :: (Exists (Matrix a), Args (Matrix a) ~ Size (Matrix a)) => Matrix a -> Matrix aSource

Transpose a matrix. Does not do complex conjugation for complex matrices

mxm :: (Exists (Matrix a), Args (Matrix a) ~ Size (Matrix a)) => Matrix a -> Matrix a -> Matrix aSource

Ordinary matrix multiplication