igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] igraph_add_vertices memory allocation


From: Gábor Csárdi
Subject: Re: [igraph] igraph_add_vertices memory allocation
Date: Fri, 11 Sep 2015 13:55:14 +0200

Please include a link to GitHub when  you refer to the source code. Thanks.

Yes, when you add vertices, there will be a reallocation. Igraph is optimised for graphs that do not change much.

There is no function to preallocate memory for a graph. The reason for this is that we reorder the vectors that store the structure, anyway, so you would not gain much with preallocation in most cases.

Gabor

On Sep 11, 2015 1:26 PM, "Hadidi, Lars" <address@hidden> wrote:

According to lines 375-376 in file 'type_indexededgelist.c' there will be a vector reseizing when adding vertices to a graph. 

What does the comment /*reserved*/ mean in that context ? Will there be a reallocation or is it preallocated, and if so, is

there a function on a graph which I can use to do a memory reservation ?


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


reply via email to

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