Re: [igraph] vertex_comb=NULL in contract_vertices() – is this okay?

2016-09-19 Thread Szabolcs Horvát
I should have looked at the code more carefully.

I appears that:

 1. The original graph is destroyed and replaced with the new one.
 2. vertex_comb is checked for being NULL. In that case the attribute
handling code is skipped.

On 19 September 2016 at 15:23, Szabolcs Horvát  wrote:
> Actually I don't fully understand this function.
>
> The signature is:
>
> int igraph_contract_vertices(igraph_t *graph,
> const igraph_vector_t *mapping,
> const igraph_attribute_combination_t *vertex_comb);
>
> 'graph' is the input graph.  Where is the new graph returned?
>
> On 19 September 2016 at 15:17, Szabolcs Horvát  wrote:
>> Hello everyone,
>>
>> Quick question about contract_vertices():
>>
>> http://igraph.org/c/doc/igraph-Structural.html#igraph_contract_vertices
>>
>> I don't have attributes.  Can I just pass vertex_comb=NULL?
>>
>> Szabolcs

___
igraph-help mailing list
igraph-help@nongnu.org
https://lists.nongnu.org/mailman/listinfo/igraph-help


Re: [igraph] vertex_comb=NULL in contract_vertices() – is this okay?

2016-09-19 Thread Tamas Nepusz
> int igraph_contract_vertices(igraph_t *graph,
> const igraph_vector_t *mapping,
> const igraph_attribute_combination_t *vertex_comb);
>
> 'graph' is the input graph.  Where is the new graph returned?
Nowhere - "graph" will be modified in-place.

T.

___
igraph-help mailing list
igraph-help@nongnu.org
https://lists.nongnu.org/mailman/listinfo/igraph-help


Re: [igraph] vertex_comb=NULL in contract_vertices() – is this okay?

2016-09-19 Thread Tamas Nepusz
> I don't have attributes.  Can I just pass vertex_comb=NULL?
Yes, you should be able to do that safely. If it isn't safe then it's a bug.

T.

___
igraph-help mailing list
igraph-help@nongnu.org
https://lists.nongnu.org/mailman/listinfo/igraph-help


Re: [igraph] vertex_comb=NULL in contract_vertices() – is this okay?

2016-09-19 Thread Szabolcs Horvát
Actually I don't fully understand this function.

The signature is:

int igraph_contract_vertices(igraph_t *graph,
const igraph_vector_t *mapping,
const igraph_attribute_combination_t *vertex_comb);

'graph' is the input graph.  Where is the new graph returned?

On 19 September 2016 at 15:17, Szabolcs Horvát  wrote:
> Hello everyone,
>
> Quick question about contract_vertices():
>
> http://igraph.org/c/doc/igraph-Structural.html#igraph_contract_vertices
>
> I don't have attributes.  Can I just pass vertex_comb=NULL?
>
> Szabolcs

___
igraph-help mailing list
igraph-help@nongnu.org
https://lists.nongnu.org/mailman/listinfo/igraph-help