docstr: Solve the upper part of a LU factorized matrix for x.
docstr_tok: ["Solve","the","upper","part","of","a","LU","factorized","matrix","for","x","."]
code: def U_solve(ctx, U, y):
      """
      Solve the upper part of a LU factorized matrix for x.
      """
      if U.rows != U.cols:
          raise RuntimeError("need n*n matrix")
      n = U.rows
      if len(y) != n:
          raise ValueError("Value should be equal to n")
      x = copy(y)
      for i in xrange(n - 1, -1, -1):
          for j in xrange(i + 1, n):
              x[i] -= U[i, j] * x[j]
          x[i] /= U[i, i]
      return x
  
imports: from copy import copy
  from ..libmp.backend import xrange
label_desc: Use image node_id 3 for calling the LinearAlgebraMethods obj's underlying member method code with example usage: obj.U_solve(ctx, U, y) and returns: x