Copyright | (c) Justin Le 2018 |
---|---|

License | BSD3 |

Maintainer | justin@jle.im |

Stability | experimental |

Portability | non-portable |

Safe Haskell | None |

Language | Haskell2010 |

Conversions between statically sized types in
Numeric.LinearAlgebra.Static from *hmatrix* and *vector-sized*.

This module is intentionally minimal, exporting only functions that
cannot be written without "unsafe" operations. With these, however, you
can easily write other useful combinators by using type-safe operations
like `fmap`

, `map`

, `liftA2`

, `convert`

,
etc.

## Synopsis

- rVec :: KnownNat n => R n -> Vector n ℝ
- vecR :: Vector n ℝ -> R n
- cVec :: KnownNat n => C n -> Vector n ℂ
- vecC :: Vector n ℂ -> C n
- lRows :: forall m n. (KnownNat m, KnownNat n) => L m n -> Vector m (R n)
- rowsL :: forall m n. KnownNat n => Vector m (R n) -> L m n
- lCols :: forall m n. (KnownNat m, KnownNat n) => L m n -> Vector n (R m)
- colsL :: forall m n. KnownNat m => Vector n (R m) -> L m n
- lVec :: forall m n. (KnownNat m, KnownNat n) => L m n -> Vector (m * n) ℝ
- vecL :: forall m n. KnownNat n => Vector (m * n) ℝ -> L m n
- mRows :: forall m n. (KnownNat m, KnownNat n) => M m n -> Vector m (C n)
- rowsM :: forall m n. KnownNat n => Vector m (C n) -> M m n
- mCols :: forall m n. (KnownNat m, KnownNat n) => M m n -> Vector n (C m)
- colsM :: forall m n. KnownNat m => Vector n (C m) -> M m n
- mVec :: forall m n. (KnownNat m, KnownNat n) => M m n -> Vector (m * n) ℂ
- vecM :: forall m n. KnownNat n => Vector (m * n) ℂ -> M m n

# Vector

## Real

rVec :: KnownNat n => R n -> Vector n ℝ Source #

Convert an *hmatrix* vector (parameterized by its lenth) to
a *vector-sized* storable vector of `Double`

s.

vecR :: Vector n ℝ -> R n Source #

Convert a *vector-sized* storable vector to an *hmatrix* vector
(parameterized by its lenth).

## Complex

cVec :: KnownNat n => C n -> Vector n ℂ Source #

Convert an *hmatrix* complex vector (parameterized by its lenth) to
a *vector-sized* storable vector of 'Complex Double's, preserving the
length in the type.

vecC :: Vector n ℂ -> C n Source #

Convert a *vector-sized* storable vector to an *hmatrix* complex
vector (parameterized by its lenth), preserving the length in the type.

# Matrix

## Real

lRows :: forall m n. (KnownNat m, KnownNat n) => L m n -> Vector m (R n) Source #

Split an *hmatrix* matrix (parameterized by its dimensions) to
a *vector-sized* boxed vector of its rows (as *hmatrix* vectors).

rowsL :: forall m n. KnownNat n => Vector m (R n) -> L m n Source #

Join together a *vector-sized* boxed vector of *hmatrix* vectors to an
*hmatrix* matrix as its rows.

lCols :: forall m n. (KnownNat m, KnownNat n) => L m n -> Vector n (R m) Source #

Split an *hmatrix* matrix (parameterized by its dimensions) to
a *vector-sized* boxed vector of its columns (as *hmatrix* vectors).

colsL :: forall m n. KnownNat m => Vector n (R m) -> L m n Source #

Join together a *vector-sized* boxed vector of *hmatrix* vectors to an
*hmatrix* matrix as its columns.

lVec :: forall m n. (KnownNat m, KnownNat n) => L m n -> Vector (m * n) ℝ Source #

Flatten an *hmatrix* matrix into a *vector-sized* storable vector of
its items.

*Since: 0.1.1.0*

vecL :: forall m n. KnownNat n => Vector (m * n) ℝ -> L m n Source #

Shape a *vector-sized* storable vector of elements into an *hmatrix*
matrix.

*Since: 0.1.1.0*

## Complex

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

Split an *hmatrix* complex matrix (parameterized by its dimensions) to
a *vector-sized* boxed vector of its rows (as *hmatrix* complex
vectors).

rowsM :: forall m n. KnownNat n => Vector m (C n) -> M m n Source #

Join together a *vector-sized* boxed vector of *hmatrix* complex
vectors to an *hmatrix* complex matrix as its rows.

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

Split an *hmatrix* complex matrix (parameterized by its dimensions) to
a *vector-sized* boxed vector of its columns (as *hmatrix* complex
vectors).

colsM :: forall m n. KnownNat m => Vector n (C m) -> M m n Source #

Join together a *vector-sized* boxed vector of *hmatrix* complex
vectors to an *hmatrix* complex matrix as its columns.