cmatrix.Matrix.UX_B¶
- Matrix.UX_B()¶
Compute the UX=B system wher U is an upper matrix and B the result matrix. The system is solved by gauss.
Parameters
type
Description
U
Matrix
The upper matrix of the system
B
Matrix
The result matrix of the system
- Returns
- Matrix
1D Matrix representing the solution of the Upper X system
Examples
>>> m=Matrix(3,3) >>> m[0,0]=1 >>> m[0,1]=3 >>> m[0,2]=9 >>> m[1,1]=2 >>> m[1,2]=4 >>> m[2,2]=1 >>> b=Matrix(3,1) >>> b[0,0]=1 >>> b[1,0]=2 >>> b[2,0]=-1 >>> print(m) | +1.000 | +3.000 | +9.000 | | +0.000 | +2.000 | +4.000 | | +0.000 | +0.000 | +1.000 | printed >>> print(b) | +1.000 | | +2.000 | | -1.000 | printed >>> print(m.UX_B(m,b)) | +1.000 | | +3.000 | | -1.000 | printed