Skip to content

Conversation

@jkyang92
Copy link
Contributor

This implements functions IM2_Matrix_get_entries and IM2_MutableMatrix_get_entries that gives an array with all of the entries and uses these to implement entries. This fixes the quadratic in the number of rows behavior seen in #4016. Strictly this change is only needed for Matrix and not MutableMatrix, and I have not yet tested whether there is an improvement for MutableMatrix, since this version does involve an extra copy. Additionally, for MutableMatrix we are still calling get_entry entry by entry on the matrix itself when we should in theory be able to loop over an array somewhere.

There is a slight design compromise in this, as top level expects a list of lists, but it is not easy to return a list of lists from the interface level, we return just a single sequence and let the top level code rearrange that into a list of lists. This rearrangement could in theory happen at the "d" level, but it's not clear if that's faster.

… in one function call and implement entries using it

This fixes Macaulay2#4016
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.

1 participant