igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] edge attributes and delete.edges


From: Gabor Csardi
Subject: Re: [igraph] edge attributes and delete.edges
Date: Mon, 13 Nov 2006 15:04:48 -0500
User-agent: Mutt/1.5.11

Vincent,

indeed, this was a bug in igraph, it has been corrected by Tamas.
You can download the 0.3 version from 
http://cneurocvs.rmki.kfki.hu/igraph/download/
In this the bug was corrected. 0.3 is not released yet but there won't be
many changes since its release, only bug fixes if neccesary. Also the
current version was tested only on Linux, so don't be suprised if it has
problems building on windows/macos. I'll try to test it, and it will be
released soon.

Alternatively you can apply this trivial patch to your current version:

---
address@hidden/igraph--main--0.3--patch-16/src/type_indexededgelist.c
+++
address@hidden/igraph--main--0.3--patch-17/src/type_indexededgelist.c
@@ -400,7 +400,7 @@
   if (graph->attr) {
   long int i, j=1;
   for (i=0; i<igraph_vector_size(&graph->from); i++) {
-    if (mark[i] >= 0) {
+    if (mark[i] == 0) {
      VECTOR(graph->from)[i]=j++;
     } else {
      VECTOR(graph->from)[i]=0;


Gabor

On Mon, Nov 13, 2006 at 12:47:10PM -0500, Vincent Matossian wrote:
>  Hi,
> 
> A strange behavior has come to light recently, consider the following
> igraph-R code:
> 
> gtest=barabasi.game(10)
> E(gtest)$a=seq(1:ecount(gtest))
> gtest=delete.edges(gtest,0)
> E(gtest)$a
> 
> After the first call to E(gtest)$a the result is: [1] 1 2 3 4 5 6 7 8 9
> that's okay
> After the second call (after edge deletion) to E(gtest)$a the result is: [1] 1
> 2 3 4 5 6 7 8
> 
> I was expecting to see as a result : [1] 2 3 4 5 6 7 8 9
> 
> The edge lists are however correct when looking at E(gtest) only.
> 
> it appears that delete.edges deletes specified edges but does not delete edge
> attributes appropriately (in reverse order actually), is this a known issue, I
> haven't had time to look into the C code but was wondering if this has been
> observed before,
> 
> thanks,
> 
> vincent
> 
> 

> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help


-- 
Csardi Gabor <address@hidden>    MTA RMKI, ELTE TTK




reply via email to

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