Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    invert-permutationpublic

    invert-permutation

    Computes the inverse of a permutation

    Example

    console.log( require("invert-permutation")([1,3,0,2]) )
     
    //Prints: 
    //          [ 2, 1, 3, 0 ] 

    Install

    npm install invert-permutation
    

    API

    `require("invert-permutation")(perm[, result])

    Inverts a permutation

    • perm is the permutation to invert
    • result is an optional array that gets the result of inverting the permutation

    Returns result or a newly allocated array if nothing is specified

    Credits

    (c) 2013 Mikola Lysenko. MIT License

    install

    npm i invert-permutation

    Downloadsweekly downloads

    13,207

    version

    1.0.0

    license

    MIT

    repository

    github.com

    last publish

    collaborators

    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar