-
Notifications
You must be signed in to change notification settings - Fork 12
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
feat: add matrixGetSubMatrix function #236
base: main
Are you sure you want to change the base?
Conversation
Please run |
src/matrix/matrixGetSubMatrix.ts
Outdated
const nbColumns = endColumn - startColumn + 1; | ||
const nbRows = endRow - startRow + 1; | ||
|
||
const subMatrix = matrixCreateEmpty({ nbColumns, nbRows }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if we should not simply use ml-matrix but anyway this seems like a very slow method.
Why create an empty matrix ?
Just make a loop on the selected rows and push a 'slice'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder also where it is being used because if we create temporary submatrix for some applications we can always create a 'subarray' https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray that is a pointer to the original array (must be typed). It is very specific but we don't duplicate the data. We can discuss on telegram if it can be used in your application.
Co-authored-by: Michaël Zasso <[email protected]>
Co-authored-by: Michaël Zasso <[email protected]>
b534efc
to
ae8953b
Compare
No description provided.