Skip to content

Commit

Permalink
Migrate sort_order.js
Browse files Browse the repository at this point in the history
  • Loading branch information
curran committed Dec 30, 2020
1 parent 136e064 commit a984523
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ export { permutation, inverse_permutation } from './permutation';
export { permute, permute_inplace, permutetranspose } from './permute';
export { poweriteration, poweriteration_n } from './poweriteration';
export { range } from './range';
//export {
//} from '';
export {
sort_order,
sort_order_ascending,
sort_order_descending
} from './sort_order';
//export {
//} from '';
6 changes: 3 additions & 3 deletions src/sort_order.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
reorder.sort_order = function(v) {
export function sort_order(v) {
return reorder.permutation(0, v.length).sort(
function(a,b) { return v[a] - v[b]; });
};

reorder.sort_order_ascending = reorder.sort_order;
export const sort_order_ascending = sort_order;

reorder.sort_order_descending = function(v) {
export function sort_order_descending(v) {
return reorder.permutation(0, v.length).sort(
function(a,b) { return v[b] - v[a]; });
};

0 comments on commit a984523

Please sign in to comment.