Matrix Mirror

Matrix Mirror - Matrix Mirror - Messages

#1 Posted: 9/9/2016 9:29:52 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Smath does not support reverse cols order in "submatrix".
Alternately, here is the module. Read more in the attached.

Jean

Matrix Mirror.gif

Utilities Matrix Mirror Exercise.sm (19 KiB) downloaded 44 time(s).
#2 Posted: 9/9/2016 11:06:05 AM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

I think this is remedied as well with the recent vector indices.
Moreover, I think we can forget about submatrix() function now

http://smath.info/cloud/worksheet/uRMs2euU

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#3 Posted: 9/9/2016 12:33:23 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

You even don't have to wait for the vector indices, at least for the mirror.

See here

index2.PNG

The mirror implementation is straightforward to understand (transpose, reverse, transpose)

The diagonal is a nasty indexing trick, which is that far from paper and pencil notation that it can't be recommended unless you want to obfuscate your algorithm (then best use excel). You just square the row/column index range elements to access the diagonal elements in linear indexing.
This, however, uses the vector index feature.
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 users liked this post
frapuano 9/9/2016 2:23:00 PM
#4 Posted: 9/10/2016 3:38:55 AM
Mike Kaganski

Mike Kaganski

184 likes in 434 posts.

Group: User

Wrote

The diagonal is a nasty indexing trick, which is that far from paper and pencil notation that it can't be recommended unless you want to obfuscate your algorithm (then best use excel). You just square the row/column index range elements to access the diagonal elements in linear indexing.
This, however, uses the vector index feature.



diagonal(M):el(M,(range(0,(rows(M)-1)))*(rows(M)+1)+1)

diag.png
С уважением, Михаил Каганский
1 users liked this post
NDTM Amarasekera 9/11/2016 3:38:00 PM
  • New Posts New Posts
  • No New Posts No New Posts