Please implement a vector reversal function.
For example v=[1,2,3,4,5,6]
Then revvect(v)=[6,5,4,3,2,1]
Currently I can do this by
v2=[v1[5],v1[4],v1[3],v1[2],v1[1],v1[0],]
But that is slowing down the simulator excessively. It also has a limitation of vector length at about 4000, it gives errors above 4000, but even with 4000 elements the simulator freezes and no result in a half an hour.
I can reverse about 200 elements like this without freezing:
v2=[v1[5],v1[4],v1[3],v1[2],v1[1],v1[0],]
If I do 7 of these then the simulation takes 5minutes. An optimizer simulation takes over 24 hours.
I also tried to create a reversal matrix like this, that is a 90degree rotated identity matrix:
rev=[0,0,1;0,1,0;1,0,0] at the size of 40x40.
Then
r5=[rev*r[160:199],revr[120:159],revr[80:119],revr[40:79],revr[0:39]]
returns a simulation error "no appropriate function found..."
Last edit: Buenos 2021-10-18