[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] why use floating point for graph nodes?

From: Tamas Nepusz
Subject: Re: [igraph] why use floating point for graph nodes?
Date: Thu, 5 Nov 2015 00:12:40 +0100

Ah, sorry, just realized that igraph_t contains igraph_vector_t
objects, and those indeed contains doubles. Yes, you are right, this
is weird, and this is a heritage from the old days when
igraph_integer_t was also typedef'd to a double. Just for fun I have
changed the types in igraph_t to igraph_vector_long_t and made a few
quick modifications to src/type_indexededgelist.c to make things
compile without warnings, and it seems to do the trick - all tests
compile just fine. However, there are probably lots of unnecessary
casts left in the code, and of course we cannot change the public API
(which still uses igraph_vector_t in lots of cases to store vertex
lists) without breaking everyone else's code, so this quirk is
probably here to stay for while (unless Gabor makes an executive
decision and decides to break the API intentionally).

If anyone is interested in it, I have pushed the changes into a
separate branch named feature/graph_t-with-long-vector.



On Wed, Nov 4, 2015 at 11:18 PM, Tamas Nepusz <address@hidden> wrote:
>> Why does igraph use floating point data (C doubles) to represent graph
>> vertices?  It seems like an unusual choice and I would expect it to
>> negatively affect performance.  Is it an R heritage?
> Errrrm... it used to be that way a (not so) long time ago; see this
> thread on the mailing list:
> https://lists.nongnu.org/archive/html/igraph-help/2009-01/msg00119.html
> However, I have just checked the source code and igraph_integer_t is
> now typedef'd to an int so this is probably not the case any more.
> T.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]