This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH GCC][01/06]New interface returning all adjacent vertices in graph


On Mon, Aug 14, 2017 at 11:19 AM, Bin Cheng <Bin.Cheng@arm.com> wrote:
> Hi,
> This simple patch adds new interface returning adjacent vertices for a vertex in graph.
> Bootstrap and test in series.  Is it OK?

The comment of the function doesn't match its implementation.  Why did
you choose
to use the dfs helpers instead of (more clearly IMHO) using

 e = v->succ;
 while (e)
   {
     adj->safe_push (e->dest);
     e = e->succ_next;

given you do not expose the direction as arggument to adjacent_vertices?  Btw,
is this "adjacent" a term understood in the context of (directed) graphs?

Richard.

> Thanks,
> bin
> 2017-08-10  Bin Cheng  <bin.cheng@arm.com>
>
>         * graphds.c (adjacent_vertices): New function.
>         * graphds.h (adjacent_vertices): New declaration.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]