nuha-0.3.0.0: Multidimensional arrays, Linear algebra, Numerical analysis
Copyright(c) Johannes Kropp
LicenseBSD 3-Clause
MaintainerJohannes Kropp <jodak932@gmail.com>
Safe HaskellNone
LanguageHaskell2010

Math.Nuha.Types

Description

 
Synopsis

Documentation

data Holor a Source #

Datatype for a holor which is basically a multidimensional array. Sometimes in literature the word tensor is used instead, but this is not correct because a tensor has additional properties that do not apply for multidimensional arrays in general. For an explanation of holors see https://en.wikipedia.org/wiki/Parry_Moon#Holors

Most often a holor is used as the type for a vector or matrix. Holors as row vectors have shape [1,n] and column vectors [m,1]. Matrices are of shape [m,n]. A holor with a single element has shape [1,1]. Note that the length of the shape is always at least two.

The indexing of the holor entries starts with 0 in each dimension.

Constructors

Holor 

Fields

  • hShape :: ![Int]

    Shape of the holor. The dimension is the length of the shape

  • hStrides :: ![Int]

    Step sizes for each dimension, needed for indexing

  • hValues :: !(Vector a)

    Values of the holor in row-major order

Instances

Instances details
(Eq a, Unbox a) => Eq (Holor a) Source # 
Instance details

Defined in Math.Nuha.Types

Methods

(==) :: Holor a -> Holor a -> Bool #

(/=) :: Holor a -> Holor a -> Bool #

(Ord a, Unbox a) => Ord (Holor a) Source #

Ordering is only relevant on the holor values (i.e. independent of shape)

Instance details

Defined in Math.Nuha.Types

Methods

compare :: Holor a -> Holor a -> Ordering #

(<) :: Holor a -> Holor a -> Bool #

(<=) :: Holor a -> Holor a -> Bool #

(>) :: Holor a -> Holor a -> Bool #

(>=) :: Holor a -> Holor a -> Bool #

max :: Holor a -> Holor a -> Holor a #

min :: Holor a -> Holor a -> Holor a #

(Show a, Unbox a) => Show (Holor a) Source # 
Instance details

Defined in Math.Nuha.Types

Methods

showsPrec :: Int -> Holor a -> ShowS #

show :: Holor a -> String #

showList :: [Holor a] -> ShowS #

data Error Source #

Sum type of various errors that can be thrown in non trivial algorithms

Instances

Instances details
Eq Error Source # 
Instance details

Defined in Math.Nuha.Types

Methods

(==) :: Error -> Error -> Bool #

(/=) :: Error -> Error -> Bool #

Show Error Source # 
Instance details

Defined in Math.Nuha.Types

Methods

showsPrec :: Int -> Error -> ShowS #

show :: Error -> String #

showList :: [Error] -> ShowS #

type T2 a = (a, a) Source #

2-tuple

type T3 a = (a, a, a) Source #

3-tuple

type T4 a = (a, a, a, a) Source #

4-tuple

type T22 a = T2 (T2 a) Source #

2,2-tuple

type T32 a = T3 (T2 a) Source #

3,2-tuple

type T42 a = T4 (T2 a) Source #

4,2-tuple

type T23 a = T2 (T3 a) Source #

2,3-tuple

type T33 a = T3 (T3 a) Source #

3,3-tuple

type T43 a = T4 (T3 a) Source #

4,3-tuple

type T24 a = T2 (T4 a) Source #

2,4-tuple

type T34 a = T3 (T4 a) Source #

3,4-tuple

type T44 a = T4 (T4 a) Source #

4,4-tuple