Skip to content

Commit

Permalink
sort was not supposed to be in master...
Browse files Browse the repository at this point in the history
  • Loading branch information
v923z committed Nov 1, 2019
1 parent 43cda00 commit 5022a8b
Showing 1 changed file with 0 additions and 63 deletions.
63 changes: 0 additions & 63 deletions code/numerical.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,66 +537,3 @@ mp_obj_t numerical_diff(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_ar
m_del(int8_t, stencil, n);
return MP_OBJ_FROM_PTR(out);
}
/*
void heapsort(ndarray_obj_t *ndarray, size_t n, size_t increment) {
uint8_t type;
if((ndarray->array->typecode == NDARRAY_UINT8) || (ndarray->array->typecode == NDARRAY_INT8)) {
type = 0;
}
if((ndarray->array->typecode == NDARRAY_UINT16) || (ndarray->array->typecode == NDARRAY_INT16)) {
type = 1;
} else {
type = 2;
}
size_t i, j, k, l;
l = (n >> 1) + 1;
k = n;
uint8_t ui8_tmp, *ui8_array = NULL;
uint16_t ui16_tmp, *ui16_array = NULL;
mp_float_t float_tmp, *float_array = NULL;
for(;;) {
if (l > 1) {
if((ndarray->array->typecode == NDARRAY_UINT8) || (ndarray->array->typecode == NDARRAY_INT8)) {
ui8_tmp = ui8_array[--l];
}
} else {
tmp = array[k];
array[k] = array[1];
if (--k == 1) {
array[1] = tmp;
break;
}
}
i = l;
j = 2 * l;
while(j <= k) {
if(j < k && array[j] < array[j+1]) {
j++;
}
}
if(tmp < array[j]) {
array[i] = array[j];
i = j;
j <<= 1;
} else break;
}
array[i] = tmp;
}
mp_obj_t numerical_sort(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_rom_obj = MP_ROM_PTR(&mp_const_none_obj) } },
{ MP_QSTR_n, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 1 } },
{ MP_QSTR_axis, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = -1 } },
};
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
mp_arg_parse_all(1, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
if(!mp_obj_is_type(args[0].u_obj, &ulab_ndarray_type)) {
mp_raise_TypeError("sort argument must be an ndarray");
}
return mp_const_none;
}*/

0 comments on commit 5022a8b

Please sign in to comment.