Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline overlord  
#1 Posted : 09 November 2018 22:04:22(UTC)
overlord


Rank: Advanced Member

Groups: Registered
Joined: 23/07/2013(UTC)
Posts: 1,125
Turkey

Was thanked: 506 time(s) in 337 post(s)
Is this a bug or am I doing something wrong?

vectorize_or_col.sm (42kb) downloaded 21 time(s).

Edited by user 09 November 2018 22:09:30(UTC)  | Reason: Not specified

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline Razonar  
#2 Posted : 09 November 2018 23:24:48(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
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.
Offline overlord  
#3 Posted : 10 November 2018 18:25:17(UTC)
overlord


Rank: Advanced Member

Groups: Registered
Joined: 23/07/2013(UTC)
Posts: 1,125
Turkey

Was thanked: 506 time(s) in 337 post(s)
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 Good
If submatrices have no problem with same usage, then somehow this must be related col().

Regards

submatrice.png

Offline Jean Giraud  
#4 Posted : 11 November 2018 04:38:17(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: overlord Go to Quoted Post
Is this a bug or am I doing something wrong?


Just wrongdoing ... doctored.

vectorize_or_col.sm (15kb) downloaded 18 time(s).
Offline overlord  
#5 Posted : 11 November 2018 13:54:37(UTC)
overlord


Rank: Advanced Member

Groups: Registered
Joined: 23/07/2013(UTC)
Posts: 1,125
Turkey

Was thanked: 506 time(s) in 337 post(s)
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

Offline Jean Giraud  
#6 Posted : 11 November 2018 15:44:45(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: overlord Go to Quoted Post
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
Offline overlord  
#7 Posted : 11 November 2018 16:14:29(UTC)
overlord


Rank: Advanced Member

Groups: Registered
Joined: 23/07/2013(UTC)
Posts: 1,125
Turkey

Was thanked: 506 time(s) in 337 post(s)
Well, I used to do that too Good
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
Offline Jean Giraud  
#8 Posted : 11 November 2018 18:10:40(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: overlord Go to Quoted Post
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
Offline Razonar  
#9 Posted : 11 November 2018 21:26:54(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Originally Posted by: overlord Go to Quoted Post
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 Good
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.
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.