# Solving a General System of Linear Equations (trs)

trs solves a system of linear equations $$A X = B$$ or $$A^T X = B$$ with a general $$n \times n$$ matrix $$A$$ using the $$LU$$ factorization computed trf.

## Multiple Right-Hand Sides

trans

(input)
Specifies the form of the system of equations:

 NoTrans $$A X = B$$ Trans $$A^T X = B$$ ConjTrans $$A^H X = B$$

A

(input) real or complex valued GeMatrix
The factors $$L$$ and $$U$$ from the factorization $$A = P L U$$ as computed by trf.

piv

(output) integer valued DenseVector
The pivot indices from trf. For $$1 \leq i \leq \min\{m, n\}$$, row $$i$$ of the matrix was interchanged with row $$piv_i$$.

B

(input/output) real or complex valued GeMatrix
On entry, the right hand side matrix $$B$$. On exit, the solution matrix $$X$$.

## Single Right-Hand Side

trans

(input)
Specifies the form of the system of equations:

 NoTrans $$A X = B$$ Trans $$A^T X = B$$ ConjTrans $$A^H X = B$$

A

(input) real or complex valued GeMatrix
The factors $$L$$ and $$U$$ from the factorization $$A = P L U$$ as computed by trf.

piv

(output) integer valued DenseVector
The pivot indices from trf. For $$1 \leq i \leq \min\{m, n\}$$, row $$i$$ of the matrix was interchanged with row $$piv_i$$.

b

(input/output) real or complex valued DenseVector
On entry, the right hand side vector $$b$$. On exit, the solution vector $$x$$.