Observation about "augment"

Observation about "augment" - Observation about "augment" - Messages

#1 Posted: 7/2/2017 12:56:33 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: 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 KiB) downloaded 72 time(s).
#2 Posted: 7/3/2017 4:40:06 AM
Martin_B

Martin_B

21 likes in 84 posts.

Group: 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 Posted: 7/3/2017 5:28:43 AM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: 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 Posted: 7/3/2017 9:02:41 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: 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 Posted: 7/3/2017 9:39:42 AM
Martin_B

Martin_B

21 likes in 84 posts.

Group: 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 Posted: 7/3/2017 10:10:08 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: 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
  • New Posts New Posts
  • No New Posts No New Posts