# API reference

This is the official API reference of `CellArrays`

. Note that it can also be queried interactively from the Julia REPL using the help mode:

```
julia> using CellArrays
julia>?
help?> CellArrays
```

`CellArray`

type and basic constructors

`CellArrays.CellArray`

— Type`CellArray{T<:Cell,N,B,T_array} <: AbstractArray{T,N} where Cell <: Union{Number, SArray, FieldArray}`

`N`

-dimensional array with elements of type `T`

, where `T`

are `Cells`

of type Number, SArray or FieldArray. `B`

defines the blocklength, which refers to the amount of values of a same `Cell`

field that are stored contigously (`B=1`

means array of struct like storage; `B=prod(dims)`

means array struct of array like storage; `B=0`

is an alias for `B=prod(dims)`

, enabling better peformance thanks to more specialized dispatch). `T_array`

defines the array type used for storage.

```
CellArray{T,N,B}(T_arraykind, undef, dims)
CellArray{T,B}(T_arraykind, undef, dims)
CellArray{T}(T_arraykind, undef, dims)
```

Construct an uninitialized `N`

-dimensional `CellArray`

containing `Cells`

of type `T`

which are stored in an array of kind `T_arraykind`

.

Best performance on GPUs is in general obtained with `B=0`

as set by default. `B=1`

migth give better performance in certain cases. Other values of `B`

do with the current implementation not lead to optimal performance on GPU.

See also: `CPUCellArray`

, `CuCellArray`

, `ROCCellArray`

## Convenience type aliases and constructors

#### Index

#### Documentation

`CellArrays.CPUCellArray`

— Type`CPUCellArray{T<:Cell,N,B,T_elem} <: AbstractArray{T,N} where Cell <: Union{Number, SArray, FieldArray}`

`N`

-dimensional CellArray with cells of type `T`

, blocklength `B`

, and `T_array`

being an `Array`

of element type `T_elem`

: alias for `CellArray{T,N,B,Array{T_elem,CellArrays._N}}`

.

```
CPUCellArray{T,B}(undef, dims)
CPUCellArray{T}(undef, dims)
```

Construct an uninitialized `N`

-dimensional `CellArray`

containing `Cells`

of type `T`

which are stored in an array of kind `Array`

.

See also: `CellArray`

, `CuCellArray`

, `ROCCellArray`

## Functions – additional to standard `AbstractArray`

functionality

#### Index

#### Documentation

`CellArrays.blocklength`

— Method`blocklength(A)`

Return the blocklength of CellArray `A`

.

`CellArrays.cellsize`

— Method```
cellsize(A)
cellsize(A, dim)
```

Return a tuple containing the dimensions of `A`

or return only a specific dimension, specified by `dim`

.

`CellArrays.field`

— Method`field(A, indices)`

Return an array view of the field of CellArray `A`

designated with `indices`

(modifying the view will modify `A`

). The view's dimensionality and size are equal to `A`

's. The operation is not supported if parameter `B`

of `A`

is neither `0`

nor `1`

.

**Arguments**

`indices::Int|NTuple{N,Int}`

: the`indices`

that designate the field in accordance with`A`

's cell type.