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

Provide functions for exporting matrices as sequential data types #454

Open
sbaldu opened this issue Jun 20, 2024 · 1 comment
Open

Provide functions for exporting matrices as sequential data types #454

sbaldu opened this issue Jun 20, 2024 · 1 comment
Assignees
Labels
core something about core enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed Priority:High Priority Label for high priority issue Priority:Medium Priority Label for medium priority issue

Comments

@sbaldu
Copy link
Collaborator

sbaldu commented Jun 20, 2024

We currently define the adjacency matrix (and all other matrices) as hash maps, and this is the most optimal choice, but I was thinking that it would be useful to provide some functions for exporting those matrices as more standard sequential data structure (linearized vector, vector of vector, Eigen matrix, ecc.). This would be useful for example if a user wants to draw a heat map for those matrices. We could easily implement this with a template function specialized for each data type we want to support.
Furthermore, one might want to do some calculations with those matrices, and in that case a sequential data structure would be better because it would grant locality (this would be critical if the calculation is run on a GPU)

Example:

...
CXX::Graph<int> graph(edgeSet);
auto adj1 = export<std::vector<int>>(graph.getAdjMatrix());
auto adj2 = export<std::vector<std::vector<int>>>(graph.getAdjMatrix());
auto adj3 = export<Eigen::Matrix<int>>(graph.getAdjMatrix());
...

It could be a free function, a Graph method or both.

Wdyt @ZigRazor @nolankramer?

@ZigRazor
Copy link
Owner

yes, good idea!

@ZigRazor ZigRazor added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers core something about core Priority:High Priority Label for high priority issue Priority:Medium Priority Label for medium priority issue labels Jun 20, 2024
@sbaldu sbaldu self-assigned this Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core something about core enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed Priority:High Priority Label for high priority issue Priority:Medium Priority Label for medium priority issue
Projects
None yet
Development

No branches or pull requests

2 participants