[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] find highest degrees
From: |
John Lapeyre |
Subject: |
Re: [igraph] find highest degrees |
Date: |
Fri, 19 Feb 2010 23:36:04 +0100 |
User-agent: |
KMail/1.12.4 (Linux/2.6.31.9; KDE/4.3.4; x86_64; ; ) |
> I thought about adding an option to return the degrees themselves, but
> I couldn't find a way to do that without putting a conditional in the
> innermost loop..
No thats not correct. But, it would be a good thing to
pass two pointers, one for the degrees and one for the
order. (and either one could be NULL if the user does not
want it) But igraph_indheap_init_array initializes from a C
array, not an igraph_vector, so it is not possible to return
the degrees without an extra copy. It seems like currently
the only way to do this within heap.c is to access the data
in the vector struct, which goes around the vector interface.
But a function in vector.c like this might be useful:
vector_copy_data(igraph_vector_t *v, igraph_real_t *data, size_t n)
It would use memcpy to copy n bytes FROM the array in
the vector struct TO memory starting at the location given by data.
This would allow a function like this
igraph_indheap_init_vector, that initializes the heap from
data in a vector.
John