multilinear-0.3.0.0: Comprehensive and efficient (multi)linear algebra implementation.

Copyright(c) Artur M. Brodzki 2018
LicenseBSD3
Maintainerartur@brodzki.org
Stabilityexperimental
PortabilityWindows/POSIX
Safe HaskellNone
LanguageHaskell2010

Multilinear.Tensor

Contents

Description

  • This module provides convenient constructors that generate a arbitrary finitely- or infinitely-dimensional tensors.
  • Finitely-dimensional tensors provide much greater performance than inifitely-dimensional
Synopsis

Generators

fromIndices Source #

Arguments

:: (Num a, Unbox a) 
=> (String, [Int])

Upper indices names (one character per index) and its sizes

-> (String, [Int])

Lower indices names (one character per index) and its sizes

-> ([Int] -> [Int] -> a)

Generator function (f [u1,u2,...] [d1,d2,...] returns a tensor element at t [u1,u2,...] [d1,d2,...])

-> Tensor a

Generated tensor

Generate tensor as functions of its indices

generate Source #

Arguments

:: (Num a, Unbox a) 
=> (String, [Int])

Upper indices names (one character per index) and its sizes

-> (String, [Int])

Lower indices names (one character per index) and its sizes

-> ([Int] -> [Int] -> Tensor a)

Generator function (f [u1,u2,...] [d1,d2,...] returns a tensor element at t [u1,u2,...] [d1,d2,...])

-> Tensor a

Generated tensor

Generate tensor composed of other tensors

const Source #

Arguments

:: (Num a, Unbox a) 
=> (String, [Int])

Upper indices names (one character per index) and its sizes

-> (String, [Int])

Lower indices names (one character per index) and its sizes

-> a

Tensor elements value

-> Tensor a

Generated tensor

Generate tensor with all components equal to v

randomDouble Source #

Arguments

:: ContGen d 
=> (String, [Int])

Upper indices names (one character per index) and its sizes

-> (String, [Int])

Lower indices names (one character per index) and its sizes

-> d

Continuous probability distribution (as from Statistics.Distribution)

-> IO (Tensor Double)

Generated tensor

Generate tensor with random real components with given probability distribution. The tensor is wrapped in the IO monad.

Available probability distributions:

randomDoubleSeed Source #

Arguments

:: (ContGen d, PrimMonad m) 
=> (String, [Int])

Upper indices names (one character per index) and its sizes

-> (String, [Int])

Lower indices names (one character per index) and its sizes

-> d

Continuous probability distribution (as from Statistics.Distribution)

-> Int

Randomness seed

-> m (Tensor Double)

Generated tensor

Generate tensor with random real components with given probability distribution and given seed. The tensor is wrapped in a monad.

Available probability distributions:

randomInt Source #

Arguments

:: DiscreteGen d 
=> (String, [Int])

Upper indices names (one character per index) and its sizes

-> (String, [Int])

Lower indices names (one character per index) and its sizes

-> d

Discrete probability distribution (as from Statistics.Distribution)

-> IO (Tensor Int)

Generated tensor

Generate tensor with random integer components with given probability distribution. The tensor is wrapped in the IO monad.

Available probability distributions:

randomIntSeed Source #

Arguments

:: (DiscreteGen d, PrimMonad m) 
=> (String, [Int])

Index name (one character)

-> (String, [Int])

Number of elements

-> d

Discrete probability distribution (as from Statistics.Distribution)

-> Int

Randomness seed

-> m (Tensor Int)

Generated tensor

Generate tensor with random integer components with given probability distribution and given seed. The tensor is wrapped in a monad.

Available probability distributions: