Line intersections

Line intersections - An example of translation of a function from Matlab to Smath - 消息

#41 已发布: 2018/2/19 06:36:00
MBe

MBe

2个赞,共21个帖子。

组: User

Hello Everybody,

Thanks to all of you for these extremely interesting postings.
I am barely able to fully understand them in depth... I need a bit of time to study them thoroughly.
Programming is like making music, and this is a symphony!!

Once again, thanks for all these good suggestions.

Marco
#42 已发布: 2018/2/20 01:08:59
Jean Giraud

Jean Giraud

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

组: User

Wrote

Still on line intersections.
Bug corrected: only lines with same number of points were accepted.
Now lines with different # of points will work.
Also some improvements in efficiency so that runtime is now
approx. -25%.



Marco, your Line Intersection is a piece of gold for Engineering works.
1. Trifolium
2. Dragilev implicit solve
3. Focus [suggested as next exercise]

Zillions thanks ... Jean

Maths InterX.r1 (2) Trifolium Copy.sm (103.5 KiB)已下载 1350 次。

#43 已发布: 2018/2/21 17:34:53
Andrey Ivashov

Andrey Ivashov

2,344个赞,共4,057个帖子。

组: Super Administrator

Wrote

Just take a look at the speed:
plotG_2.PNG



Wrote

For such uses it would be good if the augment and stack functions could expand scalar arguments (or more generally any arguments not matching the maximum number of rows or cols) to uniformly populated vectors of the required size).



This is what I've got after improving stack/augment (see SMath Studio 0.99.6626):

plotg_improved_1.PNG

Note, that I had to make height of the result matrix about 40 times larger to see the same time! This means that this syntax of stack/augment is about 40 times faster then without it.

Thank you!
6位用户喜欢此帖子
Radovan Omorjan 2018/2/21 18:38:00, frapuano 2018/2/21 18:58:00, sergio 2018/2/21 17:53:00, Davide Carpi 2018/2/22 06:14:00, MBe 2018/2/22 12:41:00, NDTM Amarasekera 2018/2/21 23:06:00
#44 已发布: 2018/2/22 12:55:14
Jean Giraud

Jean Giraud

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

组: User

Wrote

This is what I've got after improving stack/augment (see SMath Studio 0.99.6626):


Looks great, not reproducible 6179.
Could it conflict in other situations ?

  • 有新帖
  • 无新帖