vectorize() with IPluginLowLevelEvaluation functions

vectorize() with IPluginLowLevelEvaluation functions - Mensajes

#1 Publicado: 29/3/2016 20:54:04
Mike Kaganski

Mike Kaganski

184 me gusta en 434 mensajes.

Grupo: User

scr5.png

(Last line with error is just to demonstrate that without vectorize(), the error is the same as with vectorize(), so seems that vectorize() has no effect)

I suspect that the problem is because the Bessel function is defined in a IPluginLowLevelEvaluation plugin (StatisticalTools by Davide). This interface is afaik the most used among SMath plugin writers, so it would be desirable to extend vectorize() to work correctly with that kind of plugins.

Please excuse me if my reasoning is incorrect, and the real cause is something other.
С уважением, Михаил Каганский
A 1 usuarios les gustó este mensaje
Davide Carpi 31/3/2016 14:09:00
#2 Publicado: 30/3/2016 0:45:29
Jean Giraud

Jean Giraud

983 me gusta en 6.866 mensajes.

Grupo: User

Hello Boris,

If that's not your first name, then tell us to shoot Vodka !
"Bessel" but which Bessel ?
In Smath 5346, there are quite a few built-in "Bessel" from menu f(x).
I understand what you are attempting, give me a day or two.
For what I can see, vectorising is not the best approach.

Jean

Bessel mwbesselj.sm (8,05 KiB) descargado 1360 vez(es).
#3 Publicado: 30/3/2016 1:00:02
Mike Kaganski

Mike Kaganski

184 me gusta en 434 mensajes.

Grupo: User

OH MY! Not again!

Wrote

Hello Boris,

If that's not your first name, then tell us to shoot Vodka !
"Bessel" but which Bessel ?
In Smath 5346, there are quite a few built-in "Bessel" from menu f(x).



Wrote

I suspect that the problem is because the Bessel function is defined in a IPluginLowLevelEvaluation plugin (StatisticalTools by Davide).



Citar


I understand what you are attempting, give me a day or two.
For what I can see, vectorising is not the best approach.



I only used any first custom function from my function list, just to demonstrate the problem. I could use e.g. CoolProp wrapper, or anything else.
С уважением, Михаил Каганский
#4 Publicado: 30/3/2016 1:21:22
Jean Giraud

Jean Giraud

983 me gusta en 6.866 mensajes.

Grupo: User

Mike,

Trust me: vectorising is not a substitute to the right ways of doing.
I have only two legs and 10 fingers ... at night my brain dilutes.

Jean
#5 Publicado: 30/3/2016 12:31:46
Andrey Ivashov

Andrey Ivashov

2.343 me gusta en 4.056 mensajes.

Grupo: Super Administrator

Hello.

Wrote

I suspect that the problem is because the Bessel function is defined in a IPluginLowLevelEvaluation plugin (StatisticalTools by Davide). This interface is afaik the most used among SMath plugin writers, so it would be desirable to extend vectorize() to work correctly with that kind of plugins.


Everything you said is correct. I've just improved vectorize function to support functions from plug-ins.

vectorize_improved_1.png

Thank you!

Best regards.
A 1 usuarios les gustó este mensaje
Davide Carpi 31/3/2016 14:09:00
#6 Publicado: 30/3/2016 14:55:42
Jean Giraud

Jean Giraud

983 me gusta en 6.866 mensajes.

Grupo: User

Wrote


Everything you said is correct.
I've just improved vectorize function to support functions from plug-ins.



Which Bessel ? There are 34 "Bessel functions"
Your Bessel is typically a vector of 5*5 = 25 elements.
Still something not correct.

Jean

#7 Publicado: 2/4/2016 14:22:43
Alexander O. Melnik

Alexander O. Melnik

127 me gusta en 498 mensajes.

Grupo: Moderator

Hi all, did not want to open a new vectorize() topic so posting my question here. From what I know about vectorize is that in order for it to evaluate you need to satisfy the following:

1. Arguments must be two matrices with matching dimensions
2. Operator must be applicable to scalar variables

If the above is correct, I might have detected an odd behaviour.

And as a side note: Andrey, please do not get discouraged by all the recent controversy surrounding vectorize(). It is a very useful function. My only suggestion would be to make sure that it consistently follows a simple list of logical rules, and to make this list available in the SMath release notes / documentation.

http://smath.info/cloud/sheet/xVqGb4rhZq

vectorize1.sm (9,94 KiB) descargado 1323 vez(es).
vectorize1.png
#8 Publicado: 2/4/2016 17:06:38
Jean Giraud

Jean Giraud

983 me gusta en 6.866 mensajes.

Grupo: User

You didn't test completely ... Ah !

Forum Vectorise Correct.gif
#9 Publicado: 2/4/2016 18:23:19
Mike Kaganski

Mike Kaganski

184 me gusta en 434 mensajes.

Grupo: User

Well, then I will add here, too

scr29.png

This minimal example is completely made up for demonstration only. No meaning in it other than to demonstrate a problem.

Here three pieces are relevant: if(), assignment of y, and eval(). Without any of these, it works.
С уважением, Михаил Каганский
  • Nuevos mensajes
  • Sin mensajes nuevos