aureooms/js-permutation

View on GitHub
src/_identity.js

Summary

Maintainability
A
0 mins
Test Coverage
/**
 * Fills an input array with the identity permutation on input <code>n</code>
 * elements.
 *
 * @param {Array} sigma The input array.
 * @param {number} n The size to use for the permutation.
 */
export function _identity(sigma, n) {
    for (let i = 0; i < n; ++i) sigma[i] = i;
}