ZigRazor / ZigRazor/CXXGraph

Provide functions for exporting matrices as sequential data types

Open
#454 1 comment 0 reactions 1 assignee View on GitHub

@sbaldu is already working on this.

Since Jun 20, 2024.

core enhancement good first issue help wanted Priority:High Priority:Medium
Dominant language
C++
Stars
729
Forks
147
Avg merge
19h
Merged PRs (30d)
1

Description

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?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.