[Top][All Lists]

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

Re: [igraph] Sorting vertices by degree with igraph C library

From: Szabolcs Horvát
Subject: Re: [igraph] Sorting vertices by degree with igraph C library
Date: Sat, 24 Mar 2018 17:26:07 +0100

To give a concrete example, you could sort an igraph vector 'vec' using

std::stable_sort(vec.stor_begin, vec.stor_end);

To stick to the documented API (might be a good idea), you can use

std::stable_sort(VECTOR(vec), VECTOR(vec) + igraph_vector_size(&vec));


You don't need to use any other C++ features in your program if you don't like C++. You can keep it as C.  Compiling as C++ will only impose minor restrictions.

On 24 March 2018 at 17:20, Szabolcs Horvát <address@hidden> wrote:
I do not know.  I believe that the documented ones in igraph are not stable.

Personally, I would just use std::stable_sort() from the C++ standard library. Is there any reason why you don't want to use that, and want something from igraph instead?

On 24 March 2018 at 15:48, Vincent Beugnet <address@hidden> wrote:
Thank you very much !

Last question: is there a stable sort already implemented in igraph ?

igraph-help mailing list

reply via email to

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