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 omorr  
#1 Posted : 14 April 2012 21:09:43(UTC)
omorr


Rank: Administration

Groups: Registered, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
Hello Andrey,

I wonder if the augment() and stack() could be made to receive a scalar argument in the case of merging vectors and scalars. This is not working at the moment *Array dimensions do not match*:

c:mat(x,y,z,1,3)
augment(a,b,c)=#@#
stack(a,b,transpose(c))=#@#

But this will:

c:mat(x,y,z,1,3) a:mat(a,1,1) b:mat(b,1,1)
augment(a,b,c)=mat(a,b,x,y,z,1,5)
stack(a,b,transpose(c))=mat(a,b,x,y,z,5,1)

We had to make "a" and "b" variables as single element vectors. It seems to me a bit redundant. Andrey, could you make that augment() and stack() could have scalars as their arguments as well, in the cases of merging row or column matrices (vectors)?

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
thanks 1 user thanked omorr for this useful post.
on 16/06/2012(UTC)

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

Offline Andrey Ivashov  
#2 Posted : 17 June 2012 13:21:45(UTC)
Andrey Ivashov


Rank: Administration

Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member
Joined: 11/07/2008(UTC)
Posts: 1,616
Man
Russian Federation

Was thanked: 1978 time(s) in 666 post(s)
Hello Radovan.

I've checked what could be done with stack/augment to fix issues you are mentioned and I've made corrections to your approach: symbolic engine will not either evaluate augment/stack functions or raise an exception if dimensions of the arguments don't match. It will pass these functions to allow numeric engine make a final decision about what is error and what is not.

Please see Use case section of the screenshot below for understanding the reasons.
Andrey Ivashov attached the following image(s):
stackAugment.png
thanks 2 users thanked Andrey Ivashov for this useful post.
on 17/06/2012(UTC),  on 17/06/2012(UTC)
Offline omorr  
#3 Posted : 17 June 2012 14:39:58(UTC)
omorr


Rank: Administration

Groups: Registered, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
Thank you Andrey for this fix Thank you

Loking forward to the next release Good

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline omorr  
#4 Posted : 17 June 2012 17:10:19(UTC)
omorr


Rank: Administration

Groups: Registered, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
Hello Andrey,

SMath 0.95 was just released and I must be annoying about this issue. Therefore, I appologize Blush

Just wondering why this could not be possible in v0.95. Why the first element could not be a scalar - it must be a vector.

augment(1,mat(2,3,4,1,3))=#@#

stack(1,mat(2,3,4,3,1))=#@#

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline Andrey Ivashov  
#5 Posted : 17 June 2012 17:29:19(UTC)
Andrey Ivashov


Rank: Administration

Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member
Joined: 11/07/2008(UTC)
Posts: 1,616
Man
Russian Federation

Was thanked: 1978 time(s) in 666 post(s)
Ahh yes. The separate logic for this case presented in the program... It's my fault. Will be fixed in the next release.
thanks 1 user thanked Andrey Ivashov for this useful post.
on 17/06/2012(UTC)
Offline omorr  
#6 Posted : 17 June 2012 17:40:01(UTC)
omorr


Rank: Administration

Groups: Registered, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
Thank you AndreyGood ,

BTW, in v0.95 this is possible: stack() and augment() with all scalars - very good Good


augment(1,2,3)=mat(1,2,3,1,3)

stack(1,2,3)=mat(1,2,3,3,1)

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Users browsing this topic
Guest
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.