hTensor-0.8.0: Multidimensional arrays and simple tensor computations.

Portability portable provisional Alberto Ruiz

Numeric.LinearAlgebra.Array

Description

Simple multidimensional array with useful numeric instances.

Contractions only require equal dimension.

Synopsis

# Documentation

data None Source

Unespecified coordinate type. Contractions only require equal dimension.

Constructors

 None

Instances

 Eq None Show None Compat None Show (Idx None) Coord t => Show (Array t)

type Array t = NArray None tSource

Multidimensional array with unespecified coordinate type.

Arguments

 :: Coord t => [Int] dimensions -> [t] elements -> Array t

Construction of an Array from a list of dimensions and a list of elements in left to right order.

scalar :: Coord t => t -> NArray i tSource

Create a 0-dimensional structure.

index :: Coord t => Name -> [Array t] -> Array tSource

Create an Array from a list of parts (index = newIndex None).

(!) :: (Compat i, Coord t) => NArray i t -> [Char] -> NArray i tSource

Rename indices in alphabetical order (renameO) using single letter names.

(!>) :: (Compat i, Coord t) => NArray i t -> [Char] -> NArray i tSource

Explicit renaming of single letter index names.

For instance, t >@> "pi qj" changes index "p" to "i" and "q" to "j".

(~>) :: Coord t => NArray i t -> String -> NArray i tSource

reorder (transpose) dimensions of the array (with single letter names).

Operations are defined by named indices, so the transposed array is operationally equivalent to the original one.

(.*) :: (Coord a, Compat i) => NArray i a -> NArray i a -> NArray i aSource

Element by element product.

printA :: (Coord t, Compat i, PrintfArg t) => String -> NArray i t -> IO ()Source

Print the array as a nested table with the desired format (e.g. %7.2f) (see also formatArray, and formatScaled).