- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I need to sort a 1-dimensional real-type array. I find I can use sortqq and qsort. Is there any difference?
By the way, could I ask what is integer(2)???? What the '(2)' is for?
Thanks very much.
I need to sort a 1-dimensional real-type array. I find I can use sortqq and qsort. Is there any difference?
By the way, could I ask what is integer(2)???? What the '(2)' is for?
Thanks very much.
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How large is the array?
Are multiple cores available?
Is the output array the input array? (or seperate arrays)
integer(2) means 2-byte integer (16-bits). In C this would be a short (short int)
Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - jimdempseyatthecove
How large is the array?
Are multiple cores available?
Is the output array the input array? (or seperate arrays)
integer(2) means 2-byte integer (16-bits). In C this would be a short (short int)
Jim
the array has 10000 elements. Yes, 4 CPUs. A seperate array is expected.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For 10,000 reals, SORTQQ may be faster than QSORT (experiment).
However, QSORT has the advantage of being able to check for NaN's and/or denormalized nubmers.
The disadvantage of both is they sort in place (as opposed to takingin and out arrays).
If this sort occures very often, then it might be worth the effort to write a specialized sort (SSE using multiple threads). 10,000 is probably not large enough to involve multiple threads, but involving SSE may help.
Jim
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page