Observation about "augment"

Observation about "augment" - Observation about "augment" - 消息

#1 已发布: 2017/7/2 12:56:33
Jean Giraud

Jean Giraud

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

组: User

In many ways, Smath is hard to manage.
Few days ago, "augment, stack" were reported to be slow.
Yes they are and are not. Observe "augment" 2 cols [2380 rows]
~ 6 minutes compared to within program Orient(M) 0.016 sec [1/14500].
Most interesting !

Jean

Rotate Breather [Quaternion].sm (278.48 KiB)已下载 1246 次。
#2 已发布: 2017/7/3 04:40:06
Martin_B

Martin_B

22个赞,共84个帖子。

组: User

Is it really stack/augment, which is "slow"?

There are some functions, which are not evaluated at once, like "norme".
Symbolic evaluation of M*zoom*gamma takes 11s.
Maybe that's the real reason why it takes minutes.

augment_screen.PNG
#3 已发布: 2017/7/3 05:28:43
Davide Carpi

Davide Carpi

1,443个赞,共2,936个帖子。

组: Moderator

Wrote

Is it really stack/augment, which is "slow"?

There are some functions, which are not evaluated at once, like "norme".
Symbolic evaluation of M*zoom*gamma takes 11s.
Maybe that's the real reason why it takes minutes.



Correct. You can see the difference in performances using the function Orient(M), where the product M*zoom*gamma is done at once and the numerical evaluation forced for all the matrix elements before any manipulation of his shape (col/augment).
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#4 已发布: 2017/7/3 09:02:41
Jean Giraud

Jean Giraud

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

组: User

Wrote

Is it really stack/augment, which is "slow"?

There are some functions, which are not evaluated at once, like "norme".
Symbolic evaluation of M*zoom*gamma takes 11s.
Maybe that's the real reason why it takes minutes.



__________________________________________________________

After this message, I will re-post the latest version [refactored/augmented].

You are not right about "norme", it is a peanut calculation stored as a new vector.
But it is calculated after "rotate(n,v)", stored as new vector as well.
My point was that calculation suites execute much faster when included in program.
That was explained by MathSoft wrt their Mathcad(s) ... Tom G. [expert in programming]
confirmed this assertion well proved by experimenting.
Many of those CAS functions are borrowed from various codes. Roughly, one can figure how
they rank in speed [machine code, objects, program, modular].

Orient(M) => 0.015 sec [same: numeric/symbolic]

Numeric ... eval(augment(col(M*zoom*γ,1),col(M*zoom*γ,2))) => 2 sec
As a remark: "stack(,,) is much faster than "augment(,,).

Thanks for your interest ... cheers: Jean
#5 已发布: 2017/7/3 09:39:42
Martin_B

Martin_B

22个赞,共84个帖子。

组: User

Wrote


My point was that calculation suites execute much faster when included in program.


15% faster?! (0,475/0,418)
augment_screen2.PNG
#6 已发布: 2017/7/3 10:10:08
Jean Giraud

Jean Giraud

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

组: User

... you are right: my timing of Orient(M) is just the timing to setup the program.
It must be compared as per your: augment(col(N:=eval(M*zoom*γ),1),col(N,2))

Thanks for that pertinent remark ! ... cheers, Jean
  • 有新帖
  • 无新帖