_toMatrix = function _toMatrix(a) {
    // check it is a matrix
    if (type.isMatrix(a)) {
      return a;
    } // check array


    if (isArray(a)) {
      return matrix(a);
    } // throw


    throw new TypeError('Invalid Matrix LU decomposition');
  }
Solves the linear system `A * x = b` where `A` is an [n x n] matrix and `b` is a [n] column vector.

Syntax:

   math.lusolve(A, b)     // returns column vector with the solution to the linear system A * x = b
   math.lusolve(lup, b)   // returns column vector with the solution to the linear system A * x = b, lup = math.lup(A)

Examples:

   const m = [[1, 0, 0, 0], [0, 2, 0, 0], [0, 0, 3, 0], [0, 0, 0, 4]]

   const x = math.lusolve(m, [-1, -1, -1, -1])        // x = [[-1], [-0.5], [-1/3], [-0.25]]

   const f = math.lup(m)
   const x1 = math.lusolve(f, [-1, -1, -1, -1])       // x1 = [[-1], [-0.5], [-1/3], [-0.25]]
   const x2 = math.lusolve(f, [1, 2, 1, -1])          // x2 = [[1], [1], [1/3], [-0.25]]

   const a = [[-2, 3], [2, 1]]
   const b = [11, 9]
   const x = math.lusolve(a, b)  // [[2], [5]]

See also:

   lup, slu, lsolve, usolve

@param {Matrix | Array | Object} A      Invertible Matrix or the Matrix LU decomposition
@param {Matrix | Array} b               Column Vector
@param {number} [order]                 The Symbolic Ordering and Analysis order, see slu for details. Matrix must be a SparseMatrix
@param {Number} [threshold]             Partial pivoting threshold (1 for partial pivoting), see slu for details. Matrix must be a SparseMatrix.

@return {DenseMatrix | Array}           Column vector with the solution to the linear system A * x = b