-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Current Index implementation #367
Comments
This functionality has been there in the past, before we even had an It's ok with me to reintroduce this functionality again, as long as we can come up with a clear API which works conveniently in both JavaScript as well as the expression parser. If I understand you correctly you would like to replace the support for specifying a range as an Array |
Creating an Index with an Array parameter will no longer create a range for the given dimension, it will use the array as the actual indices for the dimension: Actual behavior:
New behavior:
This allows the following (not possible today):
The same can be expressed in JavaScript as:
|
Yes exactly. For the expression parser it will work like a charm. I'm worried though about the JavaScript notation |
Yes; calling
|
No performance penalties? I would expect that expanding a range into an Array would take more time/memory than just passing three values and running a simple |
It is a tradeoff, by having the Range as it is you need to run a The Set contains the same API operations as a Range so the consuming code is not aware that the actual Index dimension is represented as a Set or a Range. |
I have to say it's hard for me to make a guess about the performance implications of just using As for |
Yes, doing the inline version will work but at the end I will be creating the same permutation vector ( See the actual code in a proof of concept I am working on based on the proposed changes (not completed yet) |
Current
Index
implementation is missing the feature to allow the user to pick individual items from a Matrix and create a SubMatrix as a result. See the following example:The same syntax exists in Matlab and Scilab (replace square brackets by parentheses).
Implementing this feature in V2 will introduce a breaking change since creating an
Index
with one of the parameters being an Array will use the array items to create aRange
(array code and matrix code).The change I am proposing is:
This functionality is needed to correctly implement Matrix LU and QR factorization using full pivoting. Current partial pivoting (LU) will benefit form it as well since the row permutation is implemented by creating a Matrix out of the permutation vector and doing a
Matrix x Matrix
operation.What do you think?
The text was updated successfully, but these errors were encountered: