Assign submatrices

Assign submatrices - Messages

#1 Posted: 10/5/2016 7:23:25 PM
Mike Kaganski

Mike Kaganski

184 likes in 434 posts.

Group: User

A bit of prerequisite history:

1. "Assign variables/functions put into the vector/matrix" feature announced.

2. "Extracting submatrices using ranges as indices" feature requested.

3. Its implementation announced.

4. Question about putting a matrix into a submatrix posted.

Currently it's impossible to use assignments like this:

AssignSubmatrix.png

The proposal is to enable such syntax.
С уважением, Михаил Каганский
#2 Posted: 10/6/2016 12:33:21 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

I understand the code you are proposing, but wonder if useful.
It would be local anyway, which Smath has it already.

Forum Insert SubMatrix.gif
#3 Posted: 10/6/2016 6:31:21 PM
Mike Kaganski

Mike Kaganski

184 likes in 434 posts.

Group: User

1. What I propose can be seen as "syntactic sugar". As such, it is not strictly *required*, but desirable.
2. Also, this proposal enables syntax that seem "natural" based on previous enhancements (cited in the first post). It improves consistency and discoverability (intuitivity) of features.
3. It enables syntax known from MathCad. This is again not a requirement, but lowers learning curve for newcomers.

All talk about "unneeded features" on the basis that the feature *may be* implemented using programming is bullshit. Yes, you can, and actually you even don't need SMath for this, only abacus being Turing-complete. So what? Let's call SMath not needed, and spend time on reinventing wheels, or searching for wheels someone had implemented before, and then spend time on debugging because when you took someone else' code, you didn't see that that code used "foreign" concept of MathCad zero-based indices? Or difficult-to-find bugs in edge cases?

You may only call a proposal not needed, if it makes software *worse* in some sense. E.g., has a different paradigm and thus makes interface inconsistent.

Developers may decide not to implement useful features, because they may percept it to be too difficult to implement compared to possible benefit (so their time would be better spent for other tasks), or it may be impossible in used architecture, or something. Then't OK. But that's another story.

There also exists the following, for some, more substantial need:
4. Speed. In-built functions involving mass operations like vectorize() or this one may be optimized much better, and even use multi-processing (vectorizing) e.g. in GPU, thus parallelizing work manifold WRT functional approach. User functions in SMath, being greatest feature, are inherently slower than in-built/plugin.
С уважением, Михаил Каганский
#4 Posted: 10/6/2016 7:52:36 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

You can improve your "syntactic sugar" even more practical, Mathcad style.
i:=1..n
j:=1..n
M[i,j :=Mandelbrot
#5 Posted: 1/16/2018 1:49:04 AM
Andrey Ivashov

Andrey Ivashov

2269 likes in 3729 posts.

Group: Super Administrator

Wrote

You can improve your "syntactic sugar" even more practical, Mathcad style.
i:=1..n
j:=1..n
M[i,j :=Mandelbrot



Started implementation of this feature in order to improve compatibility with other software:
arrays_calc.PNG

Best regards, Andrey Ivashov.
4 users liked this post
Martin Kraska 1/16/2018 4:04:00 AM, frapuano 1/16/2018 4:35:00 AM, Davide Carpi 1/16/2018 5:31:00 AM, Radovan Omorjan 1/16/2018 2:22:00 PM
#6 Posted: 1/16/2018 4:06:53 AM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Wrote


Started implementation of this feature in order to improve compatibility with other software:

Best regards, Andrey Ivashov.



Besides compatiblity to "other software" this will improve the readibility in comparison to the vectorize operator, which is not really clear to third party users.
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#7 Posted: 1/16/2018 10:56:46 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

Started implementation of this feature in order to improve compatibility with other software:


Nice feature, Andrey ... keep up !
Vectorize operator works well.

Jean

VectorizeMaths.PNG

Pattern Mandelbrot RGB.sm (57 KiB) downloaded 54 time(s).

Pattern Mandelbrot.sm (108 KiB) downloaded 60 time(s).

  • New Posts New Posts
  • No New Posts No New Posts