Support Multidimentional
Well, this part is pending, support multidimensional matrix, sadly i'm lack of knowlodge of python to work here, i try search but no lucky.
ex:
a(1,1,1)=1
a(1,2,1)=2
a(3,1,1)=3
a of 3 dims.
well my problem in python is how acces to other dimentions without use this Array[a][b][c], to automated this i think we need some mere flexible access.
SymPy tensors is probably the way to go, but I haven't looked at it yet.
I saw this upstream: https://github.com/sympy/sympy/pull/11800, so looks like its do-able now/soonish.
http://docs.sympy.org/latest/modules/tensor/array.html
well my problem in python is how acces to other dimentions without use this Array[a][b][c], to automated this i think we need some mere flexible access.
It's advisable to use 1-dim arrays as internal data structure, and then establish a conversion criterion from the multidimensional index to the 1-dim indexing. It's more efficient and easier to handle than nested lists.
Another alternative: a dictionary of indices mapping to the values.
Thanks @Upabjojr you're very welcome to help us here if you'd like!
My feeling is this task might be easier after we have a better communication mechanism between Octave and Python ("Pytave project").
But some things work already:
>> syms x
>> Q = sym('Array([[[1, 2], [3, 4]], [[5, 6], [7, 8]]])')
Q = (sym) [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]
>> A = x*Q
A = (sym) [[[x, 2*x], [3*x, 4*x]], [[5*x, 6*x], [7*x, 8*x]]]
char(A)
ans = ImmutableDenseNDimArray(Tuple(Symbol('x'), Mul(Integer(2), Symbol('x')), Mul(Integer(3), Symbol('x')), Mul(Integer(4), Symbol('x')), Mul(Integer(5), Symbol('x')), Mul(Integer(6), Symbol('x')), Mul(Integer(7), Symbol('x')), Mul(Integer(8), Symbol('x'))), Tuple(Integer(2), Integer(2), Integer(2)))
Note, actually is possible in Sympy access to elements in this way:
a = Array(............)
a[(1, 2, 3, 4)] = val
a[(4, 2, 3, 1)]
there you can set and get data with tuples.