[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-gsl] Array sorting queries
From: |
Joseph Wakeling |
Subject: |
[Help-gsl] Array sorting queries |
Date: |
Wed, 22 Oct 2008 10:33:17 +0200 |
User-agent: |
Thunderbird 2.0.0.17 (X11/20080925) |
Hello,
A few queries about the sorting functions in GSL.
I have a few different arrays which I need to sort, depending on what
they are, into either ascending or descending order.
Later on in the program, I will need to perform index-sorts on the same
arrays -- again, respectively in either ascending or descending order.
What bothers me is that I don't see, from the GSL manual, how to do this
effectively. Sorting in ascending order is easy -- just use gsl_sort()
and gsl_sort_index() -- but there's no hint in the manual how to sort
arrays in _descending_ order.
I could of course use gsl_sort_largest() over the whole array but that
means having to assign a separate destination array and seems an
expensive solution...
Can anyone suggest a better solution? (Apologies if I've missed
something in the manual.)
Thanks & best wishes,
-- Joe