/** * Copyright (c) 2018-2019 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author Alexander Rose */ import { NumberArray } from '../../../mol-util/type-helpers.js'; import { Vec } from '../3d.js'; interface Matrix { data: NumberArray; size: number; cols: N; rows: M; } declare namespace Matrix { function create(cols: N, rows: M, ctor?: { new (size: number): NumberArray; }): Matrix; /** Get element assuming data are stored in column-major order */ function get(m: Matrix, i: number, j: number): number; /** Set element assuming data are stored in column-major order */ function set(m: Matrix, i: number, j: number, value: number): Matrix; /** Add to element assuming data are stored in column-major order */ function add(m: Matrix, i: number, j: number, value: number): Matrix; /** Zero out the matrix */ function makeZero(m: Matrix): Matrix; function clone(m: Matrix): Matrix; function fromArray(data: NumberArray, cols: N, rows: M): Matrix; function transpose(out: Matrix, mat: Matrix): Matrix; /** out = matA * matB' */ function multiplyABt(out: Matrix, matA: Matrix, matB: Matrix): Matrix; /** Get the mean of rows in `mat` */ function meanRows>(mat: Matrix): V; /** Subtract `row` from all rows in `mat` */ function subRows(mat: Matrix, row: NumberArray): Matrix; } export { Matrix };