@@ -433,7 +433,8 @@ struct adj_matrix_traversal_tag : public virtual adjacency_matrix_tag,
433433 public virtual vertex_list_graph_tag,
434434 public virtual incidence_graph_tag,
435435 public virtual adjacency_graph_tag,
436- public virtual edge_list_graph_tag
436+ public virtual edge_list_graph_tag,
437+ public virtual bidirectional_graph_tag
437438{
438439};
439440
@@ -826,6 +827,27 @@ typename adjacency_matrix< D, VP, EP, GP, A >::degree_size_type in_degree(
826827 return n;
827828}
828829
830+ // O(N)
831+ template < typename VP, typename EP, typename GP, typename A >
832+ typename adjacency_matrix< directedS, VP, EP, GP, A >::degree_size_type
833+ degree (
834+ typename adjacency_matrix< directedS, VP, EP, GP, A >::vertex_descriptor u,
835+ const adjacency_matrix< directedS, VP, EP, GP, A >& g)
836+ {
837+ return in_degree (u, g) + out_degree (u, g);
838+ }
839+
840+ // O(N)
841+ template < typename VP, typename EP, typename GP, typename A >
842+ typename adjacency_matrix< undirectedS, VP, EP, GP, A >::degree_size_type
843+ degree (
844+ typename adjacency_matrix< undirectedS, VP, EP, GP, A >::vertex_descriptor
845+ u,
846+ const adjacency_matrix< undirectedS, VP, EP, GP, A >& g)
847+ {
848+ return out_degree (u, g);
849+ }
850+
829851// =========================================================================
830852// Functions required by the AdjacencyGraph concept
831853
0 commit comments