src/math-helpers.js
function findLargestInCol (M, i, startAtRow = 0) {
  let me = M.elements;
  let n = M.dimension;
  let offset = i * n;
  let maxIdx = startAtRow;
  let maxVal = _Math.abs(me[offset + maxIdx]);
  for (let i = maxIdx + 1; i < n; ++i) {
    let val = _Math.abs(me[offset + i]);
    if (val > maxVal) {
      maxIdx = i;
      maxVal = val;
    }
  }
  return maxIdx;
}
function findLargestInCol (M, i, startAtRow = 0) {
  let me = M.elements;
  let n = M.dimension;
  let offset = i * n;
  let maxIdx = startAtRow;
  let maxVal = _Math.abs(me[offset + maxIdx]);
  for (let i = maxIdx + 1; i < n; ++i) {
    let val = _Math.abs(me[offset + i]);
    if (val > maxVal) {
      maxIdx = i;
      maxVal = val;
    }
  }
  return maxIdx;
}
function findLargestInCol ( M , i , startAtRow = 0 ) { let me = M . elements ; let n = M . dimension ; let offset = i * n ; let maxIdx = startAtRow ; let maxVal = _Math . abs ( me [ offset + maxIdx ] ) ; for ( let i = maxIdx + 1 ; i < n ; ++ i ) { let val = _Math . abs ( me [ offset + i ] ) ; if ( val > maxVal ) { maxIdx = i ; maxVal = val ; } } return maxIdx ; }
Finds the largest element in the matrix column.
@memberof Helpers
@param {Matrix2|Matrix3|Matrix4} M The matrix.
@param {number} i The column index.
@returns {number} The row index of the column's largest element.
Finds the largest element in the matrix column .