Tensor

Generic multi-dimensional array template

Description: This template mainly serves as a base for creating various more specialized algebraic objects via encapsulation. Think of Tensor as a backend for e.g. Vector and Matrix.

T - element type, usually numeric (float or double)

dim - number of dimensions (tensor order): 0 - scalar, 1 - vector, 2 - matrix, 3 - 3D array, (higer dimensions are also possible).

sizes - tuple defining sizes for each dimension: 3 - 3-vector, 4,4 - 4x4 matrix, etc.

Data storage type (stack or heap) is statically selected: if given size(s) imply data size larger than MaxStaticTensorSize, data is allocated on heap (as dynamic array). Otherwise, data is allocated on stack (as static array).

template Tensor (
T
size_t dim
sizes...
) {}

Members

Structs

Tensor
struct Tensor
Undocumented in source.

Meta