Skip to content
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

refactor and add split for matrix #37

Merged

Conversation

nagatoism
Copy link

@nagatoism nagatoism commented Mar 2, 2024

Refactor the matrix trait so we can make slice and mutable slice of Row as MatrixMut

Add split function to MatrixMut

@Janmajayamall
Copy link
Collaborator

This looks good to me!

Ideally I would want to remove all ::zeros calls inside *ops.rs and hence get rid of any additional memory allocations inside ops type functions. For ex, the way it is done for ckks/ops.rs. The caller will responsible to reserving a scratch space to allocate temporary allocations used inside *ops.rs.

But this isn't related to this task and I should open another issue to tackle this later.


Note the postion idx is included in the second half
*/
fn split(&mut self, idx: usize) -> (&mut [<Self as Matrix>::R], &mut [<Self as Matrix>::R]) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A small thing.

Can we change this to split_at_row? Much clearer.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes you are right

@Janmajayamall Janmajayamall merged commit 4c21e48 into gausslabs:jay-ckks Mar 6, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants