Observation about "augment"

Observation about "augment" - Observation about "augment" - Сообщения

#1 Опубликовано: 02.07.2017 12:56:33
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: 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 КиБ) скачан 72 раз(а).
#2 Опубликовано: 03.07.2017 04:40:06
Martin_B

Martin_B

21 сообщений из 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 Опубликовано: 03.07.2017 05:28:43
Davide Carpi

Davide Carpi

1417 сообщений из 2873 понравились пользователям.

Группа: 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 Опубликовано: 03.07.2017 09:02:41
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: 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 Опубликовано: 03.07.2017 09:39:42
Martin_B

Martin_B

21 сообщений из 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 Опубликовано: 03.07.2017 10:10:08
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: 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
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений