Conversation
|
Note that these are internal structs which were never meant for outside consumption. If you need them to be public, can you give some more detail as to why? |
|
To clarify, more documentation, even for private objects, is always a good thing. I just wanna know if we can also make the public-facing API sufficient for your uses. |
|
In JuMP, we compute the sparsity pattern of the Hessian of the objective |
|
Yeah that sounds feasible, but I'm more worried about the view part. Why do you need a view of |
|
It needs a continuous view because JuMP is doing a coloring for the Hessian of the objective and then for the Hessian of each constraints. @blegat I am right? |
src/coloring.jl
Outdated
| """ | ||
| contains the reverse breadth first (BFS) traversal order for each tree in the forest. | ||
| More precisely, given an edge `(u, v)` of index `i`, | ||
| `reverse_bfs_order[i]` is either `(u, v)` or `(v, u)`. |
There was a problem hiding this comment.
It is not right, i is not an edge index.
| # Number of edges treated | ||
| num_edges_treated = zero(T) | ||
|
|
||
| # reverse_bfs_orders contains the reverse breadth first (BFS) traversal order for each tree in the forest |
There was a problem hiding this comment.
We should keep this comment.
What do think of:
# reverse_bfs_orders will contain the reverse breadth first (BFS) traversal order for each tree in the forest concatenated
There was a problem hiding this comment.
I simply moved it into the comment of the field of the struct. I feel that the definition of what reverse_bfs_orders will be should go there and here we should comment on why what we do achieve this
There was a problem hiding this comment.
I added a new comment clarifying the confusion with the root of the Forest union-find datastructure that we thought we be useful during our discussion on the phone
src/coloring.jl
Outdated
| is_star::Vector{Bool} | ||
| "`tree_edge_indices[1]` is one and `tree_edge_indices[k+1] - tree_edge_indices[k]` is the number of edges in the `k`th tree" | ||
| tree_edge_indices::Vector{T} | ||
| "numbers of 2-colored trees for which trees sharing the same 2 colors have disjoint vertices" |
There was a problem hiding this comment.
I don't think they have disjoint vertices. When the matrix is dense, we have n(n+1)/2 trees with two vertices (one for each edge) but only n vertices.
There was a problem hiding this comment.
If a red vertex u is adjacent to both a blue and yellow vertex then the red-blue tree and red-yellow tree have the u vertex in common so they don't have disjoint vertices
There was a problem hiding this comment.
Ahah, I contradicted myself in my reply. I meant disjoint edges indeed
There was a problem hiding this comment.
Fixed it in the last commit
Co-authored-by: Alexis Montoison <35051714+amontoison@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #296 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 20 20
Lines 2027 2139 +112
==========================================
+ Hits 2027 2139 +112 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I needed to understand these from the implementation for the purpose of blegat/ArrayDiff.jl#19 so I thought I might as well document them now that I understand what they represent :)