Vectorize or Col, bug?

Vectorize or Col, bug? - Сообщения

#1 Опубликовано: 09.11.2018 16:04:22
overlord

overlord

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

Группа: Moderator

Is this a bug or am I doing something wrong?

vectorize_or_col.sm (41 КиБ) скачан 40 раз(а).
#2 Опубликовано: 09.11.2018 17:24:48
Alvaro Diaz Falconi

Alvaro Diaz Falconi

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

Группа: User

Hi. I guess that not a bug, nor doing something wrong. What I see it's a parenthesis problem. With yours last two approximations what you get is that SMath evaluates first col function, then matrix product. But in the first example, and as you can see in the symbolic evaluation, what SMath do is first the matrix product, then try to get the col. So, the problem it's about that there are not an obvious way except both that you use, for change the operation order, i.e. a parenthesis question.

Clipboard09.gif

Best regards.
Alvaro.
#3 Опубликовано: 10.11.2018 12:25:17
overlord

overlord

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

Группа: Moderator

Well, using submatrices has solved the problem.
You can be right, it seems col() is calculated after matrix.
But I don't think it is related to paranthesis. I have tried nearly every possible usage way of parantheses with col() function, no success so far
If submatrices have no problem with same usage, then somehow this must be related col().

Regards

submatrice.png

#4 Опубликовано: 10.11.2018 22:38:17
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

Is this a bug or am I doing something wrong?



Just wrongdoing ... doctored.

vectorize_or_col.sm (14 КиБ) скачан 39 раз(а).
#5 Опубликовано: 11.11.2018 07:54:37
overlord

overlord

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

Группа: Moderator

Well Jean,

Thank you for your reply.
But this is how I had done this calculation previously, for years. I don't want to do it like this.
I am trying to calculate it via vectorize. It looks more elegant on the paper.
Which I did by the way, you can see the picture above.

Regards

#6 Опубликовано: 11.11.2018 09:44:45
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

Thank you for your reply.
But this is how I had done this calculation previously, for years. I don't want to do it like this.
I am trying to calculate it via vectorize. It looks more elegant on the paper.
Which I did by the way, you can see the picture above.


... then add more elegance and space saving, backward compatible.

Area.PNG
#7 Опубликовано: 11.11.2018 10:14:29
overlord

overlord

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

Группа: Moderator

Well, I used to do that too
It is at the end of smath file by the way.
I will stick with submatrix and vectorize method.
It is the most space saving method I could think of.

Thanks and regards

matrix.png
#8 Опубликовано: 11.11.2018 12:10:40
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

I will stick with submatrix and vectorize method.
It is the most space saving method I could think of.


... even more compact/elegant

SubMat.PNG
#9 Опубликовано: 11.11.2018 15:26:54
Alvaro Diaz Falconi

Alvaro Diaz Falconi

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

Группа: User

Wrote

Well, using submatrices has solved the problem.
You can be right, it seems col() is calculated after matrix.
But I don't think it is related to paranthesis. I have tried nearly every possible usage way of parantheses with col() function, no success so far
If submatrices have no problem with same usage, then somehow this must be related col().

Regards



Hi Overlord. Yes, you're right, the new range access to submatrices method is the more elegant solution, this is the more readable, and math are a lot of things, but for sure is a thing of how can one visualize the problems. If math's notation isn't clear, it can introduce mistakes in their applications. When I talk about parentheses is about that it is the usual tool for change the evaluation order in an expression, and isn't clear how to do that under the vectorize() function. For some reason col() isn't evaluated first than product, but range matrix access it is.

Best regards.
Alvaro.
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений