permutation-rank

WebJar for permutation-rank

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

permutation-rank
Последняя версия

Последняя версия

1.0.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

permutation-rank
WebJar for permutation-rank
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/scijs/permutation-rank

Скачать permutation-rank

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/permutation-rank/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>permutation-rank</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/permutation-rank/
implementation 'org.webjars.npm:permutation-rank:1.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/permutation-rank/
implementation ("org.webjars.npm:permutation-rank:1.0.0")
'org.webjars.npm:permutation-rank:jar:1.0.0'
<dependency org="org.webjars.npm" name="permutation-rank" rev="1.0.0">
  <artifact name="permutation-rank" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='permutation-rank', version='1.0.0')
)
libraryDependencies += "org.webjars.npm" % "permutation-rank" % "1.0.0"
[org.webjars.npm/permutation-rank "1.0.0"]

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
org.webjars.npm : invert-permutation jar [1.0.0,2)
org.webjars.npm : typedarray-pool jar [1.0.0,2)

Модули Проекта

Данный проект не имеет модулей.

permutation-rank

Ranks and unranks permutations. Based on the following paper:

W. Myrvold, F. Ruskey. (2000) "Ranking and Unranking Permutations in Linear Time". Information Processing Letters.

Usage

First install using npm:

npm install permutation-rank

Then you can use it like this:

var prank = require("permutation-rank")
var perm = [0,3,1,2]
var r = prank.rank(perm)
console.log("r = ", r)
var u = prank.unrank(perm.length, r)
console.log("u = ", u)

//Prints:
//        r =  15
//        u =  [ 0, 3, 1, 2 ]

prank.rank(permutation)

Computes an integer representing the colexicographic rank of the permutation

  • permutation is an array encoding some permutation

Returns An integer representing the ranked encoding of the permutation

prank.unrank(length, rank[, result])

Computes a permutation from a rank order with the given length

  • length is the length of the permuation
  • rank is the index of the permutation
  • result is an optional argument which stores the result of the inversion

Returns The permutation at the given rank

Credits

(c) 2013 Mikola Lysenko. MIT License

org.webjars.npm

Версии библиотеки

Версия
1.0.0