def upper_triangle(matlist, K):
 copy_matlist = copy.deepcopy(matlist)
 (lower_triangle, upper_triangle) = LU(copy_matlist, K)
 return upper_triangle

def upper_triangle ( matlist , K ) : copy_matlist = copy . deepcopy ( matlist ) ( lower_triangle , upper_triangle ) = LU ( copy_matlist , K ) return upper_triangle
transforms a given matrix to an upper triangle matrix by performing row operations on it .