forsyde-atom-0.3.0.0: Shallow-embedded DSL for modeling cyber-physical systems
Safe HaskellSafe
LanguageHaskell2010

ForSyDe.Atom.Skel.FastVector.Cube

Synopsis

Documentation

type Cube a = Vector (Vector (Vector a)) Source #

Cube is simply a type synonym for vector of vectors. This means that any function on Vector works also on Cube.

pretty Source #

Arguments

:: Show a 
=> String

separator string

-> Cube a

input cube

-> IO () 

Prints out to the terminal a cube in a readable format, where all elements are right-aligned and separated by a custom separator.

>>> let m = cube 2 2 2 [1,2,3,3,100,4,12,32]
>>> pretty "|" m
--------
1|2
3|3
--------
100| 4
 12|32
--------

size :: Cube a -> (Int, Int, Int) Source #

See size.

cube Source #

Arguments

:: Int

number of columns (X dimension) = x

-> Int

number of rows (Y dimension) = y

-> Int

depth (Z dimension) = z

-> [a]

list of values; length = x * y * z

-> Cube a

Cube of values; size = (x,y,z)

See cube.

fromCube Source #

Arguments

:: Cube a

size = (x,y)

-> [a]

length = x * y

unit Source #

Arguments

:: a 
-> Cube a

size = (1,1)

See unit.

fanout :: a -> Cube a Source #

See fanout.

transpose Source #

Arguments

:: Cube a

dimensions (Z,Y,X)

-> Cube a

dimensions (Y,X,Z)

transpose' Source #

Arguments

:: Cube a

dimensions (Y,X,Z)

-> Cube a

dimensions (Z,Y,X)

farm11 Source #

Arguments

:: (a -> b) 
-> Cube a

size = (xa,ya)

-> Cube b

size = (xa,ya)

See farm11.

farm21 Source #

Arguments

:: (a -> b -> c) 
-> Cube a

size = (xa,ya)

-> Cube b

size = (xb,yb)

-> Cube c

size = (minimum [xa,xb], minimum [ya,yb])

See farm21.

farm31 Source #

Arguments

:: (a -> b -> c -> d) 
-> Cube a

size = (xa,ya)

-> Cube b

size = (xb,yb)

-> Cube c

size = (xc,yc)

-> Cube d

size = (minimum [xa,xb,xc], minimum [ya,yb,yc])

See farm31.

reduce :: (a -> a -> a) -> Cube a -> a Source #

See reduce.

get Source #

Arguments

:: Int

X index starting from zero

-> Int

Y index starting from zero

-> Int

Z index starting from zero

-> Cube a 
-> Maybe a 

See get.

take Source #

Arguments

:: Int

X index starting from zero

-> Int

Y index starting from zero

-> Int
index starting from zero
-> Cube a 
-> Cube a 

See take.

drop Source #

Arguments

:: Int

X index starting from zero

-> Int

Y index starting from zero

-> Int

Z index starting from zero

-> Cube a 
-> Cube a 

See drop.