Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ext/numo/narray/gen/tmpl/qsort.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ static void
presorted;

loop:SWAPINIT(a, es);
if (es >= sizeof(void*)) swaptype = 2;
if (n < 7)
{
for (pm = (char *) a + es; pm < (char *) a + n * es; pm += es)
Expand Down
6 changes: 6 additions & 0 deletions test/narray_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -649,4 +649,10 @@ class NArrayTest < Test::Unit::TestCase
assert_equal(Numo::DFloat[1, Float::NAN, 3].format_to_a,
Numo::DFloat.cast(Numo::RObject[1, nil, 3]).format_to_a)
end

test "sort_index correctness" do
a = Numo::SFloat.new(10).rand_norm
idx = a.sort_index
assert { a[idx].to_a == a[idx].to_a.sort }
end
end
Loading