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 mkraska  
#1 Posted : 01 March 2018 13:29:06(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,985
Germany

Was thanked: 1124 time(s) in 721 post(s)
Why is using a vector instead of a vector-valued variable a syntax error?

indexvec.png
indexvec.sm (6kb) downloaded 18 time(s).
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
thanks 1 user thanked mkraska for this useful post.
on 01/03/2018(UTC)

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

Offline Jean Giraud  
#2 Posted : 01 March 2018 18:00:35(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: mkraska Go to Quoted Post
Why is using a vector instead of a vector-valued variable a syntax error?


In Mathcad [7 <= 11] ... N[i,j is a matrix creator,
In Smath N[i,j ... is NOT a matrix creator.

Besides this distinction, Smath handles all related stuff much easier/naturally
A good example is "Utilities Matrix Locate Array1 Array2.sm" posted yesterday.
Smath spits out this project in two pages compared to Mathcad 5 pages
5 pages very hard to follow for the non-familiar user.

On the other hand, Smath can't render Mandelbrot as nicely as Mathcad.
The cannon that shoots flies is too small for shooting elephant ... never shoot elephants !

MatrixUser.PNG

Utilities Matrix Creator_Exploder.sm (33kb) downloaded 17 time(s).

Offline mkraska  
#3 Posted : 01 March 2018 21:30:35(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,985
Germany

Was thanked: 1124 time(s) in 721 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post


In Mathcad [7 <= 11] ... N[i,j is a matrix creator,
In Smath N[i,j ... is NOT a matrix creator.


What do you mean by "matrix creator"?

I can easily use M[i;j to define (create?) a matrix. This just doesn't work with anonymous vector constants.

indexvec1.png
indexvec1.sm (10kb) downloaded 11 time(s).
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline Jean Giraud  
#4 Posted : 02 March 2018 02:38:07(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: mkraska Go to Quoted Post
I can easily use M[i;j to define (create?) a matrix. This just doesn't work with anonymous vector constants.

That feature is not coded Smath 6179

NOTcoded.PNG

Offline mkraska  
#5 Posted : 02 March 2018 13:58:33(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,985
Germany

Was thanked: 1124 time(s) in 721 post(s)
Originally Posted by: mkraska Go to Quoted Post
Why is using a vector instead of a vector-valued variable a syntax error?

indexvec.png
indexvec.sm (6kb) downloaded 18 time(s).


For now we have to distinguish between read access to submatrices and implicit loops.

ranged indices, be it an expression or a variable, work work on the right hand side for access to existing vector or matrix elements.
This concept can be used for any expression except assignment targets.

If assignemts to vector or matrix elements have to be executed for multiple index values, then you can use explicit for-loops (programming) or implicit loops. These are generated by just using vector-valued variables (general vector-valued expressions aren't allowed) as indices in the assignment target.

I don't know why implicit loops don't work for general index expressions, given that scalar expressions can be used for indexing assignment targets. It would be natural to use implicit loops as long as the index object is vector-valued.

Feature request filed as SS-3513
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline Jean Giraud  
#6 Posted : 04 March 2018 06:08:38(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: mkraska Go to Quoted Post
I don't know why implicit loops don't work for general index expressions

Smath is essentially an algorithmic CAS. Reconciliation with local "implicit loops"
does not have much interest or very limited interest except for classroom to
demonstrate the limit of simple thinking vs real productive end use.

Utilities Matrix Creator_Exploder.sm (49kb) downloaded 25 time(s).
Offline Jean Giraud  
#7 Posted : 22 March 2018 17:54:01(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 981 time(s) in 809 post(s)
More generalized/applied recursive.

AppliedRecursive.PNG
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.