-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add methods for iteration of matrix rows and columns #2177
Comments
This is an interesting idea, good to split this in a separate discussion/PR. Just to repeat my initial thoughts in #2155 (comment): Can you give some use cases for the new methods |
Implementing this as an iterator instead of returning an Array with columns makes a lot of sense to me: then there is no conflict whatsoever with the current API. An iterator is not currently usable in the expression parser, but there is no reason not be able to use it in the expression parser when implementing support for loops there, see #518, #2184. |
I understand what you mean though this is a more generic idea to have more options to iterate through rows/columns and do "some" matrix operation. Let's move this idea to the discussions section, we do not have concrete plans to implement it right now (and no much demand for it so far). |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Right now there is no comfortable way of doing something like this:
The implementation of such a function would be very easy (using generators), but I'd like to discuss the design first.
Things we should address:
mat._data
)Matrix
only (as amat.something
method), or rather as a global method that works for arrays too?columns
is at risk for being misread ascolumn
(an already existing method), whileiterateColumns
feels awkward in afor..of
(the codefor (cons col of iterateColumns(mat))
doesn't read like a grammatical sentence). MaybecolumnsOf(mat)
androwsOf(mat)
could be better. Or maybe I'm just bikeshedding.The text was updated successfully, but these errors were encountered: