Four classes are provided:
Immutable ones are SymPy objects (they subclass Expr), mutable ones are not. The structure loosely reflects the matrix module.
In [1]: from sympy.tensor.array import *
In [2]: from sympy import *
In [3]: a = ImmutableDenseNDimArray(2, 3, 4, range(2*3*4))
In [4]: a
Out[4]: [[[0, 1, 2, 3], [4, 5, 6, 7], [8, 9, 10, 11]], [[12, 13, 14, 15], [16, 17, 18, 19], [20, 21, 22, 23]]]
In [5]: Matrix(2, 3, range(6))
Out[5]:
Matrix([
[0, 1, 2],
[3, 4, 5]])
Is there a reasonable default value for the dimensions (1-dimensional
I suppose)? If so, it's better to make it a keyword argument as Ondrej
suggests.