code: function findFirstNonvanishing (M, TOL) {
    const te = M.elements;
    const n = M.dimension;
    let rowCol = {
      row: 0,
      column: 0,
      value: te[0]
    };
    if (Compare.isZero(te[0], TOL)) {
      for (let i = 0; i < n; ++i) {
        for (let j = 0; j < n; ++j) {
          const val = te[i * n + j];
          if (!Compare.isZero(val, TOL)) {
            rowCol.row = j;
            rowCol.column = i;
            rowCol.value = val;
            return rowCol;
          }
        }
      }
    }
    return rowCol;
  }
docs: Finds the first nonvanishing element.
  @memberof Helpers
  @param {Matrix2|Matrix3|Matrix4} M The matrix.
  @param {number} TOL The numerical tolerance.
  @returns {Object} The information for the nonvanishing element.