Skip to content

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

@0joshuaolson1

Description

@0joshuaolson1

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions