{"_id":"permutation-rank","_rev":"18-5ad7c2472371443176f3220a19ecfd4d","name":"permutation-rank","description":"Ranks and unranks permutations","dist-tags":{"latest":"1.0.0"},"versions":{"0.0.0":{"name":"permutation-rank","version":"0.0.0","description":"Ranks and unranks permutations","main":"index.js","directories":{"test":"test"},"dependencies":{"invert-permutation":"~0.0.0"},"devDependencies":{"tap":"~0.4.0"},"scripts":{"test":"tap test/*.js"},"repository":{"type":"git","url":"git://github.com/mikolalysenko/permutation-rank.git"},"keywords":["permutation","rank","unrank","order","compare","sort"],"author":{"name":"Mikola Lysenko"},"license":"MIT","gitHead":"878988862d074ad307eed0a60928810e62aeb792","_id":"permutation-rank@0.0.0","dist":{"shasum":"3c103a40cc13a306c02864c10a2e5927f520363d","tarball":"https://registry.npmjs.org/permutation-rank/-/permutation-rank-0.0.0.tgz","integrity":"sha512-aGf7E7rFjk/YouxeCayY7Xd1qMj/rvarf+01bxVTN/WvAHCEGHOgHolii6k50X35u4bnoijOc6LhzVvCIcJpew==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDRUMvnS+8Pu3I9hIArJET6o5w8O+uWsoSMHjKcIE1CHQIgI/VmbOQ8jAUBMAZ/UnYWYzHCCDmxzv3ITlg50aPph4g="}]},"_npmVersion":"1.1.69","_npmUser":{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},"maintainers":[{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"}]},"0.1.0":{"name":"permutation-rank","version":"0.1.0","description":"Ranks and unranks permutations","main":"index.js","directories":{"test":"test"},"dependencies":{"invert-permutation":"~0.1.0","typedarray-pool":"~0.1.1"},"devDependencies":{"tap":"~0.4.0"},"scripts":{"test":"tap test/*.js"},"repository":{"type":"git","url":"git://github.com/mikolalysenko/permutation-rank.git"},"keywords":["permutation","rank","unrank","order","compare","sort","group"],"author":{"name":"Mikola Lysenko"},"license":"MIT","gitHead":"878988862d074ad307eed0a60928810e62aeb792","bugs":{"url":"https://github.com/mikolalysenko/permutation-rank/issues"},"_id":"permutation-rank@0.1.0","dist":{"shasum":"a6347f28353ab607c8228eaf9390becce5b1fd7e","tarball":"https://registry.npmjs.org/permutation-rank/-/permutation-rank-0.1.0.tgz","integrity":"sha512-kx9aYqYcgmFPEQoMFP9kI+3NEOQi/A6q95N1MB50MZQ0yqOcsoPXfddbAtNAYejBZznOOms89tMMh7DQn5uZyA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCGhahmVX4VM+rh5cvN2/co8I4nQ7n0nuRgMfuySe29/QIge+ui/bX3qiNF5xg/9TZK3Y70P9UYO0zxICkcv7Bczx0="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},"maintainers":[{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"}]},"0.1.1":{"name":"permutation-rank","version":"0.1.1","description":"Ranks and unranks permutations","main":"index.js","directories":{"test":"test"},"dependencies":{"invert-permutation":"~0.1.0","typedarray-pool":"~0.1.1"},"devDependencies":{"tap":"~0.4.0"},"scripts":{"test":"tap test/*.js"},"repository":{"type":"git","url":"git://github.com/mikolalysenko/permutation-rank.git"},"keywords":["permutation","rank","unrank","order","compare","sort","group"],"author":{"name":"Mikola Lysenko"},"license":"MIT","gitHead":"878988862d074ad307eed0a60928810e62aeb792","bugs":{"url":"https://github.com/mikolalysenko/permutation-rank/issues"},"_id":"permutation-rank@0.1.1","dist":{"shasum":"a02d3996d16129d2ed5d4e57e97b8020f1c5139c","tarball":"https://registry.npmjs.org/permutation-rank/-/permutation-rank-0.1.1.tgz","integrity":"sha512-8X49DL5aGcODTz23039sp93Ep+ssdQ+sOxanNRS8tYhdVaem9PqAz9V/7scjo9OaaoVmXoeTHVmRSdHlJ+DNPg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCnbbh1FI2SSRiKDe/MortegsQtkMMwz9AQfRinu/DlrAIhAOAWlvEVBU5XUeXalnE54FIJiGljHksQCJ4oGCukLdkm"}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},"maintainers":[{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"}]},"1.0.0":{"name":"permutation-rank","version":"1.0.0","description":"Ranks and unranks permutations","main":"index.js","directories":{"test":"test"},"dependencies":{"invert-permutation":"^1.0.0","typedarray-pool":"^1.0.0"},"devDependencies":{"tape":"^2.12.3"},"scripts":{"test":"tape test/*.js"},"repository":{"type":"git","url":"git://github.com/mikolalysenko/permutation-rank.git"},"keywords":["permutation","rank","unrank","order","compare","sort","group"],"author":{"name":"Mikola Lysenko"},"license":"MIT","gitHead":"878988862d074ad307eed0a60928810e62aeb792","bugs":{"url":"https://github.com/mikolalysenko/permutation-rank/issues"},"homepage":"https://github.com/mikolalysenko/permutation-rank","_id":"permutation-rank@1.0.0","dist":{"shasum":"9fd98bbcecf08fbf5994b5eadc94a62e679483b5","tarball":"https://registry.npmjs.org/permutation-rank/-/permutation-rank-1.0.0.tgz","integrity":"sha512-kmXwlQcd4JlV8g61jz0xDyroFNlJ/mP+KbSBllMuQD7FvaQInRnnAStElcppkUXd8qVFLvemy6msUmBn7sDzHg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICin7wYumB8eHFjfk8FzaZexYX25cXglgw924Xeus54OAiArRsgdsAKnsKa0sRtDD4rBTLcpFP6ryJy90HM+4We1hg=="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},"maintainers":[{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"}]}},"readme":"permutation-rank\n================\nRanks and unranks permutations.  Based on the following paper:\n\nW. Myrvold, F. Ruskey. (2000) \"[Ranking and Unranking Permutations in Linear Time](http://webhome.cs.uvic.ca/~ruskey/Publications/RankPerm/RankPerm.html)\". Information Processing Letters.  \n\nUsage\n=====\nFirst install using npm:\n\n    npm install permutation-rank\n\nThen you can use it like this:\n\n```javascript\nvar prank = require(\"permutation-rank\")\nvar perm = [0,3,1,2]\nvar r = prank.rank(perm)\nconsole.log(\"r = \", r)\nvar u = prank.unrank(perm.length, r)\nconsole.log(\"u = \", u)\n\n//Prints:\n//        r =  15\n//        u =  [ 0, 3, 1, 2 ]\n```\n\n`prank.rank(permutation)`\n-----------------------------------------------\nComputes an integer representing the colexicographic rank of the permutation\n\n* `permutation` is an array encoding some permutation\n\n**Returns** An integer representing the ranked encoding of the permutation\n\n\n`prank.unrank(length, rank[, result])`\n--------------------------------------------------\nComputes a permutation from a rank order with the given length\n\n* `length` is the length of the permuation\n* `rank` is the index of the permutation\n* `result` is an optional argument which stores the result of the inversion\n\n**Returns** The permutation at the given rank\n\nCredits\n=======\n(c) 2013 Mikola Lysenko. MIT License","maintainers":[{"email":"mikolalysenko@gmail.com","name":"mikolalysenko"},{"email":"th.v.d.gronde@hccnet.nl","name":"jaspervdg"},{"email":"hughskennedy@gmail.com","name":"hughsk"},{"email":"pgb@andrew.cmu.edu","name":"planeshifter"},{"email":"rsreusser@gmail.com","name":"rreusser"}],"time":{"modified":"2022-11-08T10:40:31.160Z","created":"2013-03-04T17:55:37.634Z","0.0.0":"2013-03-04T17:55:38.503Z","0.1.0":"2013-11-05T02:10:22.528Z","0.1.1":"2013-11-26T18:31:24.036Z","1.0.0":"2014-04-30T22:53:02.636Z"},"author":{"name":"Mikola Lysenko"},"repository":{"type":"git","url":"git://github.com/mikolalysenko/permutation-rank.git"},"homepage":"https://github.com/mikolalysenko/permutation-rank","keywords":["permutation","rank","unrank","order","compare","sort","group"],"bugs":{"url":"https://github.com/mikolalysenko/permutation-rank/issues"},"license":"MIT","readmeFilename":"README.md","users":{"antimatter15":true}}