[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] R igraph 1.0 and return.vs.es
From: |
Dr Gregory Jefferis |
Subject: |
Re: [igraph] R igraph 1.0 and return.vs.es |
Date: |
Fri, 26 Jun 2015 22:56:19 +0100 |
On 26 Jun 2015, at 22:24, Gábor Csárdi wrote:
On Fri, Jun 26, 2015 at 10:05 PM, Dr Gregory Jefferis
<address@hidden> wrote:
[snip]
changed by the igraph_option return.vs.es=F (which incidentally does
not
seem to be documented)
Undocumented, because it is dangerous. If you change it, it'll apply
globally. I think if you change it now, you are probably safe, though,
because most functions expect numbers instead of vertices.
OK, then I'll avoid.
Here is a (stupid) toy example:
[...]
user system elapsed
0.713 0.007 0.719
[...]
0.001 0.000 0.001
[...]
But this means changing quite a bit of code and there are places
where
similar issues cannot be so easily side-stepped.
Two questions:
1. Is this slow down expected?
Wow, I expected it to be slower, but not this much. I should have
measured.
In most of my real life cases the impact is either more modest (2-3x) or
can be worked around as above.
2. As a package developer, is there any way to ensure I have the
behaviour
of igraph_options(return.vs.es=F) when I import the igraph package
(while
still giving other users the chance to set
igraph_options(return.vs.es=T)
if that is what they want) ?
Unfortunately not, AFAIK. These options are global.
OK
As a comment, my feeling is that this behaviour should probably be
controlled both at a per function as well as a package option level.
Yes, function specific arguments are good.
You can set the option as a workaround now, I think. I'll speed this
up in 1-2 weeks, and then everything should be fine again.
Thanks a lot for looking into this already. I think speeding up simple
cases
https://github.com/igraph/rigraph/commit/66e2c75b16f4d7f1402581645b98ad1f9b0fcc38
will probably solve a number of issues already.
Best,
Greg.
--
Gregory Jefferis, PhD
Division of Neurobiology
MRC Laboratory of Molecular Biology
Francis Crick Avenue
Cambridge Biomedical Campus
Cambridge, CB2 OQH, UK
http://www2.mrc-lmb.cam.ac.uk/group-leaders/h-to-m/g-jefferis
http://jefferislab.org
http://flybrain.stanford.edu