Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add helper/docs for permuting array with a Permutation? #18

Open
0joshuaolson1 opened this issue Jan 27, 2018 · 0 comments
Open

Add helper/docs for permuting array with a Permutation? #18

0joshuaolson1 opened this issue Jan 27, 2018 · 0 comments

Comments

@0joshuaolson1
Copy link
Owner

0joshuaolson1 commented Jan 27, 2018

A more efficient atop(ptoa(p), wantPermuted) would be

function(p, wantPermuted){return p.map(function(i){return wantPermuted[i];});}

This makes a new array instead of permuting wantPermuted, but if Factoradic used an indexof reverse index here and a user wanted (to pass in) a wantPermuted copy anyway, that'd be two new arrays...

...I'll just write the indexof approach here sometime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant