higlass
Version:
HiGlass Hi-C / genomic / large data viewer
15 lines (14 loc) • 559 B
TypeScript
export default accessorTransposition;
/**
* Factory function for a transposition accessor for a 2D matrix in form of a 1D
* array.
*
* @description
* i^T = column * i + row
* where column: `Math.floor(i / x)` and row: `Math.floor(i / x)`
*
* @param {number} x - X dimension of the 2D matrix
* @param {number} y - Y dimension of the 2D matrix
* @return {(index: number) => number} Accessor function converting the orignal 1D index into the transposed index
*/
declare function accessorTransposition(x: number, y: number): (index: number) => number;