function _denseForwardSubstitution (m, b_) {
    // the algorithm is derived from
    // https://www.overleaf.com/read/csvgqdxggyjv

    // array of right-hand sides
    const B = [solveValidation(m, b_, true)._data.map(e => e[0])]

    const M = m._data
    const rows = m._size[0]
    const columns = m._size[1]

    // loop columns
    for (let i = 0; i < columns; i++) {
      let L = B.length

      // loop right-hand sides
      for (let k = 0; k < L; k++) {
        const b = B[k]

        if (!equalScalar(M[i][i], 0)) {
          // non-singular row

          b[i] = divideScalar(b[i], M[i][i])

          for (let j = i + 1; j < columns; j++) {
            // b[j] -= b[i] * M[j,i]
            b[j] = subtractScalar(b[j], multiplyScalar(b[i], M[j][i]))
          }
        } else if (!equalScalar(b[i], 0)) {
          // singular row, nonzero RHS

          if (k === 0) {
            // There is no valid solution
            return []
          } else {
            // This RHS is invalid but other solutions may still exist
            B.splice(k, 1)
            k -= 1
            L -= 1
          }
        } else if (k === 0) {
          // singular row, RHS is zero

          const bNew = [...b]
          bNew[i] = 1

          for (let j = i + 1; j < columns; j++) {
            bNew[j] = subtractScalar(bNew[j], M[j][i])
          }

          B.push(bNew)
        }
      }
    }

    return B.map(x => new DenseMatrix({ data: x.map(e => [e]), size: [rows, 1] }))
  }
Finds all solutions of a linear equation system by forwards substitution. Matrix must be a lower triangular matrix.

`L * x = b`

Syntax:

   math.lsolveAll(L, b)

Examples:

   const a = [[-2, 3], [2, 1]]
   const b = [11, 9]
   const x = lsolveAll(a, b)  // [ [[-5.5], [20]] ]

See also:

   lsolve, lup, slu, usolve, lusolve

@param {Matrix, Array} L       A N x N matrix or array (L)
@param {Matrix, Array} b       A column vector with the b values

@return {DenseMatrix[] | Array[]}  An array of affine-independent column vectors (x) that solve the linear system