massiv-0.4.2.0: Massiv (Массив) is an Array Library.

Copyright(c) Alexey Kuleshevich 2018-2019
LicenseBSD3
MaintainerAlexey Kuleshevich <lehins@yandex.ru>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Data.Massiv.Array.Numeric

Contents

Description

 
Synopsis

Num

(.+.) :: (Load r ix e, Numeric r e, MonadThrow m) => Array r ix e -> Array r ix e -> m (Array r ix e) infixl 6 Source #

Add two arrays together pointwise. Throws SizeMismatchException if arrays sizes do not match.

Since: 0.4.0

(.+) :: (Index ix, Numeric r e) => Array r ix e -> e -> Array r ix e infixl 6 Source #

Add a scalar to each element of the array. Array is on the left.

Since: 0.1.0

(+.) :: (Index ix, Numeric r e) => e -> Array r ix e -> Array r ix e infixl 6 Source #

Add a scalar to each element of the array. Array is on the right.

Since: 0.4.0

(.-.) :: (Load r ix e, Numeric r e, MonadThrow m) => Array r ix e -> Array r ix e -> m (Array r ix e) infixl 6 Source #

Subtract two arrays pointwise. Throws SizeMismatchException if arrays sizes do not match.

Since: 0.4.0

(.-) :: (Index ix, Numeric r e) => Array r ix e -> e -> Array r ix e infixl 6 Source #

Subtract a scalar from each element of the array. Array is on the left.

Since: 0.1.0

(-.) :: (Index ix, Numeric r e) => e -> Array r ix e -> Array r ix e infixl 6 Source #

Subtract a scalar from each element of the array. Array is on the right.

Since: 0.4.0

(.*.) :: (Load r ix e, Numeric r e, MonadThrow m) => Array r ix e -> Array r ix e -> m (Array r ix e) infixl 7 Source #

Multiply two arrays together pointwise.

Since: 0.4.0

(.*) :: (Index ix, Numeric r e) => Array r ix e -> e -> Array r ix e infixl 7 Source #

(*.) :: (Index ix, Numeric r e) => e -> Array r ix e -> Array r ix e infixl 7 Source #

(.^) :: (Index ix, Numeric r e) => Array r ix e -> Int -> Array r ix e infixr 8 Source #

(|*|) :: (Mutable r Ix2 e, Source r' Ix2 e, OuterSlice r Ix2 e, Source (R r) Ix1 e, Num e, MonadThrow m) => Array r Ix2 e -> Array r' Ix2 e -> m (Array r Ix2 e) Source #

Perform matrix multiplication. Inner dimensions must agree, otherwise SizeMismatchException.

multiplyTransposed :: (Manifest r Ix2 e, OuterSlice r Ix2 e, Source (R r) Ix1 e, Num e, MonadThrow m) => Array r Ix2 e -> Array r Ix2 e -> m (Array D Ix2 e) Source #

It is quite often that second matrix gets transposed before multiplication (eg. A * A'), but due to layout of data in memory it is more efficient to transpose the second array again.

identityMatrix :: Sz1 -> Array DL Ix2 Int Source #

Create an indentity matrix.

Example

Expand
>>> import Data.Massiv.Array
>>> identityMatrix 5
Array DL Seq (Sz (5 :. 5))
  [ [ 1, 0, 0, 0, 0 ]
  , [ 0, 1, 0, 0, 0 ]
  , [ 0, 0, 1, 0, 0 ]
  , [ 0, 0, 0, 1, 0 ]
  , [ 0, 0, 0, 0, 1 ]
  ]

Since: 0.3.6

negateA :: (Index ix, Numeric r e) => Array r ix e -> Array r ix e Source #

absA :: (Index ix, Numeric r e) => Array r ix e -> Array r ix e Source #

signumA :: (Index ix, Numeric r e) => Array r ix e -> Array r ix e Source #

fromIntegerA :: (Index ix, Num e) => Integer -> Array D ix e Source #

Integral

quotA :: (Source r1 ix e, Source r2 ix e, Integral e) => Array r1 ix e -> Array r2 ix e -> Array D ix e infixl 7 Source #

remA :: (Source r1 ix e, Source r2 ix e, Integral e) => Array r1 ix e -> Array r2 ix e -> Array D ix e infixl 7 Source #

divA :: (Source r1 ix e, Source r2 ix e, Integral e) => Array r1 ix e -> Array r2 ix e -> Array D ix e infixl 7 Source #

modA :: (Source r1 ix e, Source r2 ix e, Integral e) => Array r1 ix e -> Array r2 ix e -> Array D ix e infixl 7 Source #

quotRemA :: (Source r1 ix e, Source r2 ix e, Integral e) => Array r1 ix e -> Array r2 ix e -> (Array D ix e, Array D ix e) Source #

divModA :: (Source r1 ix e, Source r2 ix e, Integral e) => Array r1 ix e -> Array r2 ix e -> (Array D ix e, Array D ix e) Source #

Fractional

(./.) :: (Load r ix e, NumericFloat r e, MonadThrow m) => Array r ix e -> Array r ix e -> m (Array r ix e) infixl 7 Source #

(./) :: (Index ix, NumericFloat r e) => Array r ix e -> e -> Array r ix e infixl 7 Source #

(.^^) :: (Index ix, Numeric r e, Fractional e, Integral b) => Array r ix e -> b -> Array r ix e infixr 8 Source #

recipA :: (Index ix, NumericFloat r e) => Array r ix e -> Array r ix e Source #

Floating

piA :: (Index ix, Floating e) => Array D ix e Source #

expA :: (Index ix, NumericFloat r e) => Array r ix e -> Array r ix e Source #

logA :: (Index ix, NumericFloat r e) => Array r ix e -> Array r ix e Source #

sqrtA :: (Index ix, NumericFloat r e) => Array r ix e -> Array r ix e Source #

(.**) :: (Source r1 ix e, Source r2 ix e, Floating e) => Array r1 ix e -> Array r2 ix e -> Array D ix e Source #

logBaseA :: (Source r1 ix e, Source r2 ix e, Floating e) => Array r1 ix e -> Array r2 ix e -> Array D ix e Source #

sinA :: (Index ix, NumericFloat r e) => Array r ix e -> Array r ix e Source #

cosA :: (Index ix, NumericFloat r e) => Array r ix e -> Array r ix e Source #

tanA :: (Index ix, NumericFloat r e) => Array r ix e -> Array r ix e Source #

asinA :: (Index ix, NumericFloat r e) => Array r ix e -> Array r ix e Source #

acosA :: (Index ix, NumericFloat r e) => Array r ix e -> Array r ix e Source #

atanA :: (Index ix, NumericFloat r e) => Array r ix e -> Array r ix e Source #

sinhA :: (Index ix, NumericFloat r e) => Array r ix e -> Array r ix e Source #

coshA :: (Index ix, NumericFloat r e) => Array r ix e -> Array r ix e Source #

tanhA :: (Index ix, NumericFloat r e) => Array r ix e -> Array r ix e Source #

asinhA :: (Index ix, NumericFloat r e) => Array r ix e -> Array r ix e Source #

acoshA :: (Index ix, NumericFloat r e) => Array r ix e -> Array r ix e Source #

atanhA :: (Index ix, NumericFloat r e) => Array r ix e -> Array r ix e Source #

RealFrac

truncateA :: (Index ix, Numeric r e, RealFrac a, Integral e) => Array r ix a -> Array r ix e Source #

roundA :: (Index ix, Numeric r e, RealFrac a, Integral e) => Array r ix a -> Array r ix e Source #

ceilingA :: (Index ix, Numeric r e, RealFrac a, Integral e) => Array r ix a -> Array r ix e Source #

floorA :: (Index ix, Numeric r e, RealFrac a, Integral e) => Array r ix a -> Array r ix e Source #

RealFloat

atan2A :: (Load r ix e, Numeric r e, RealFloat e, MonadThrow m) => Array r ix e -> Array r ix e -> m (Array r ix e) Source #