src/math-helpers.js
function findLargestInRow (M, i) {
  // get the row:
  const m = M.elements;
  const n = M.dimension;
  const offset = i;

  let j = 0;
  let lrgElem = _Math.abs(m[offset]);
  let lrgCol = j;
  for (j = 1; j < n; ++j) {
    const val = _Math.abs(m[offset + j * n]);
    if (val > lrgElem) {
      lrgCol = j;
      lrgElem = val;
    }
  }
  return lrgCol;
}
function findLargestInRow (M, i) {
  // get the row:
  const m = M.elements;
  const n = M.dimension;
  const offset = i;

  let j = 0;
  let lrgElem = _Math.abs(m[offset]);
  let lrgCol = j;
  for (j = 1; j < n; ++j) {
    const val = _Math.abs(m[offset + j * n]);
    if (val > lrgElem) {
      lrgCol = j;
      lrgElem = val;
    }
  }
  return lrgCol;
}
function findLargestInRow ( M , i ) { // get the row: const m = M . elements ; const n = M . dimension ; const offset = i ; let j = 0 ; let lrgElem = _Math . abs ( m [ offset ] ) ; let lrgCol = j ; for ( j = 1 ; j < n ; ++ j ) { const val = _Math . abs ( m [ offset + j * n ] ) ; if ( val > lrgElem ) { lrgCol = j ; lrgElem = val ; } } return lrgCol ; }
Finds the largest element in the matrix row.
@memberof Helpers
@param {Matrix2|Matrix3|Matrix4} M The matrix.
@param {number} i The row index.
@returns {number} The column index of the row's largest element.
Finds the largest element in the matrix row .