igraph icon indicating copy to clipboard operation
igraph copied to clipboard

Rename `vector_qsort_ind()` to `vector_sort_ind()`

Open szhorvat opened this issue 1 year ago • 1 comments

We have a function named igraph_vector_qsort_ind(), see https://igraph.org/c/html/latest/igraph-Data-structures.html#igraph_vector_qsort_ind

The naming is inconsistent with igraph_vector_sort() and implies a specific sorting algorithm. We discussed moving to timsort or powersort.

Shall we rename this to igraph_vector_sort_ind(), @ntamas ?

szhorvat avatar May 24 '24 16:05 szhorvat

Yup, with the usual deprecation path (i.e. keep the original name as an alias).

ntamas avatar May 24 '24 17:05 ntamas

Do we also split it into igraph_vector_reverse_sort_ind() and igraph_vector_sort_ind(), for consistency with igraph_vector_reverse_sort() and igraph_vector_sort()? Or do we keep the igraph_order_t parameter? I'd go with splitting for consistency, but not strong opinion from me.

szhorvat avatar Jul 05 '24 15:07 szhorvat

igraph_order_t was added in lieu of a boolean in 0.10.0. It's also used that way in igraph_sort_vertex_ids_by_degree(). If we really want to push this consistency thing to the extreme, then we should also split igraph_sort_vertex_ids_by_degree() into two functions, one for ascending and one for descending sort :) I'd rather not do that.

ntamas avatar Jul 08 '24 23:07 ntamas

OK, then we neither split vector_sort_ind nor do we merge vector_sort + vector_reverse_sort.

We only rename qsort -> sort.

Are we on the same page?

szhorvat avatar Jul 09 '24 08:07 szhorvat

Yes, that's correct.

ntamas avatar Jul 15 '24 09:07 ntamas