vectorize() with IPluginLowLevelEvaluation functions

vectorize() with IPluginLowLevelEvaluation functions - Сообщения

#1 Опубликовано: 29.03.2016 20:54:04
Mike Kaganski

Mike Kaganski

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

Группа: 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.
С уважением, Михаил Каганский
1 пользователям понравился этот пост
Davide Carpi 31.03.2016 14:09:00
#2 Опубликовано: 30.03.2016 00:45:29
Jean Giraud

Jean Giraud

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

Группа: 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 КиБ) скачан 33 раз(а).
#3 Опубликовано: 30.03.2016 01:00:02
Mike Kaganski

Mike Kaganski

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

Группа: 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).



Цитата


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 Опубликовано: 30.03.2016 01:21:22
Jean Giraud

Jean Giraud

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

Группа: 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 Опубликовано: 30.03.2016 12:31:46
Andrey Ivashov

Andrey Ivashov

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

Группа: 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.
1 пользователям понравился этот пост
Davide Carpi 31.03.2016 14:09:00
#6 Опубликовано: 30.03.2016 14:55:42
Jean Giraud

Jean Giraud

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

Группа: 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 Опубликовано: 02.04.2016 14:22:43
Alexander O. Melnik

Alexander O. Melnik

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

Группа: 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 КиБ) скачан 40 раз(а).
vectorize1.png
#8 Опубликовано: 02.04.2016 17:06:38
Jean Giraud

Jean Giraud

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

Группа: User

You didn't test completely ... Ah !

Forum Vectorise Correct.gif
#9 Опубликовано: 02.04.2016 18:23:19
Mike Kaganski

Mike Kaganski

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

Группа: 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.
С уважением, Михаил Каганский
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений