Query the whole vector at once with VANV, and then call
igraph_vector_sum(). Although this copies the vector once, so might
not be faster....

G.

On Mon, Nov 24, 2014 at 12:10 PM, Matheus Viana <[email protected]> wrote:
> Hi all.
>
> I would like to know if there is any fastest way to sum the attribute
> "MyAttribute" of all nodes, other than that:
>
> double sum = 0.0;
> for (node = igraph_vcount(&Graph); node--;) {
> sum += VAN(&Graph,"MyAttribute",node);
> }
>
> Many thanks,
>
> Matheus Viana
> Postdoctoral Research Employee
> Developmental and Cell Biology
> University of California Irvine
>
>
>
> _______________________________________________
> igraph-help mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/igraph-help
>

_______________________________________________
igraph-help mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/igraph-help

Reply via email to