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

Support for Fortran order in COO.flatten() #603

Open
Transurgeon opened this issue Jul 28, 2023 · 1 comment
Open

Support for Fortran order in COO.flatten() #603

Transurgeon opened this issue Jul 28, 2023 · 1 comment
Labels
enhancement Indicates new feature requests

Comments

@Transurgeon
Copy link

Is your feature request related to a problem? Please describe.
I am currently doing a GSoC project for cvxpy and we need to use 3d sparse matrices.
The way we process matrices in the backend (using variables on one axis and constraints on another), it is more intuitive to store the data in column-major format as it makes the problem readable. Hence, we made a design decision to use fortran order for all matrix operations. Currently, we are trying to move from scipy.sparse to using your sparse library and this missing API flag is the main obstacle in doing so.

Describe the solution you'd like
I would like to have flatten in fortran (column major order) for increased compatibility with NumPy.
Another API that is missing and could be nice to have is expand_dims or also atleast_2d.

I would be happy to make a PR for this, if someone could guide me on how to get started.

@Transurgeon Transurgeon added the enhancement Indicates new feature requests label Jul 28, 2023
@hameerabbasi
Copy link
Collaborator

Hello, @Transurgeon thanks for the interest, this would certainly be appreciated. I guess this can be implemented in the following way:

  • Transpose the array.
  • Flatten it.

There's not much more to it really. A PR would be appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Indicates new feature requests
Projects
None yet
Development

No branches or pull requests

2 participants