Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Graphs.transpose() static utility methods for viewing the transpo…
…se of a graph. See: https://en.wikipedia.org/wiki/Transpose_graph Add Graphs.asBasicGraph(). One downside to having BasicGraph *under* Graph in the type hierarchy (still overall a good idea though :P) is that people are likely to write methods that accept "BasicGraph<N>", even though they COULD accept "Graph<N, ?>". A little bit of javadoc is not going to stop that from happening, so might as well make it less painful to handle. Also, if someone e.g. wants to make a MutableBasicGraph copy of a Graph, there was really no way to do that before. They can now do: Graphs.copyOf(Graphs.asBasicGraph(myGraph)); Note that we cannot simply change the MutableBasicGraph version of copyOf() to accept a Graph<N, ?>, because then it would have the same type erasure as the MutableGraph version of copyOf() but a different return type. ImmutableBasicGraph.copyOf() has the same issue, because ImmutableBasicGraph extends ImmutableGraph which has it's own copyOf(). ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=130939830
- Loading branch information
Showing
2 changed files
with
399 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.