Matrix Mirror

Matrix Mirror - Matrix Mirror - 消息

#1 已发布: 2016/9/9 09:29:52
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: 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.08 KiB)已下载 1427 次。
#2 已发布: 2016/9/9 11:06:05
Radovan Omorjan

Radovan Omorjan

325个赞和1个踩,共2,052个帖子。

组: 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 已发布: 2016/9/9 12:33:23
Martin Kraska

Martin Kraska

1,362个赞,共2,276个帖子。

组: 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.
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
1位用户喜欢此帖子
frapuano 2016/9/9 14:23:00
#4 已发布: 2016/9/10 03:38:55
Mike Kaganski

Mike Kaganski

184个赞,共434个帖子。

组: 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位用户喜欢此帖子
NDTM Amarasekera 2016/9/11 15:38:00
  • 有新帖
  • 无新帖