Commit 5936a2f9 authored by Stefan Behnel's avatar Stefan Behnel

Fix tests in "libcpp_algo" test as already done in master.

parent 888bc4a4
...@@ -20,8 +20,8 @@ def heapsort(l, bool reverse=False): ...@@ -20,8 +20,8 @@ def heapsort(l, bool reverse=False):
cdef vector[int] v = l cdef vector[int] v = l
if reverse: if reverse:
make_heap(v.begin(), v.end(), greater) make_heap(v.begin(), v.end(), &greater)
sort_heap(v.begin(), v.end(), greater) sort_heap(v.begin(), v.end(), &greater)
else: else:
make_heap(v.begin(), v.end()) make_heap(v.begin(), v.end())
sort_heap(v.begin(), v.end()) sort_heap(v.begin(), v.end())
...@@ -38,7 +38,7 @@ def partialsort(l, int k, reverse=False): ...@@ -38,7 +38,7 @@ def partialsort(l, int k, reverse=False):
""" """
cdef vector[int] v = l cdef vector[int] v = l
if reverse: if reverse:
partial_sort(v.begin(), v.begin() + k, v.end(), greater) partial_sort(v.begin(), v.begin() + k, v.end(), &greater)
else: else:
partial_sort(v.begin(), v.begin() + k, v.end()) partial_sort(v.begin(), v.begin() + k, v.end())
return v return v
...@@ -53,7 +53,7 @@ def stdsort(l, reverse=False): ...@@ -53,7 +53,7 @@ def stdsort(l, reverse=False):
""" """
cdef vector[int] v = l cdef vector[int] v = l
if reverse: if reverse:
sort(v.begin(), v.end(), greater) sort(v.begin(), v.end(), &greater)
else: else:
sort(v.begin(), v.end()) sort(v.begin(), v.end())
return v return v
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment