# Triangular Solver (trs)

trs (defined in namespace flens::lapack) solves a system of linear equations

$A X = B \quad\text{or}\quad A^T X = B$

Two variants are provided:

• For a general $$n \times n$$ matrix $$A$$ containing the $$LU$$ factorization computed by trf.

• For a triangular matrix $$A$$.

Further subvariants are provided for cases where the right hand side $$B$$ is a matrix or vector.

## Variant: System of Linear Equations

### Multiple Right-Hand Sides

 trans (input) bool Solve $$AX=B$$, $$A^T X=B$$ or $$A^H X = B$$ A (input) real or complex valued GeMatrix The factors $$L$$ and $$U$$ from the factorization $$A = PLU$$ as computed trf. piv (input) integer valued DenseVector The pivot indices as returned from trf. B (input/output) real or complex valued GeMatrix On entry, the $$n \times n_{rhs}$$ right hand side matrix $$B$$. On exit, the solution matrix $$X$$.

### Single Right-Hand Side

 trans (input) bool Solve $$AX=B$$, $$A^T X=B$$ or $$A^H X = B$$ A (input) real or complex valued GeMatrix The factors $$L$$ and $$U$$ from the factorization $$A = PLU$$ as computed trf. piv (input) integer valued DenseVector The pivot indices as returned from trf. b (input/output) real or complex valued DenseVector On entry, the right hand side vector $$b$$. On exit, the solution vector $$x$$.

## Variant: Triangular System

### Multiple Right-Hand Sides

 trans (input) bool Solve $$AX=B$$, $$A^T X=B$$ or $$A^H X = B$$ A (input) real or complex valued TrMatrix The $$n \times n$$ triangular matrix. B (input/output) real or complex valued GeMatrix On entry, the $$n \times n_{rhs}$$ right hand side matrix $$B$$. On exit, the solution matrix $$X$$.

### Single Right-Hand Side

 trans (input) bool Solve $$AX=B$$, $$A^T X=B$$ or $$A^H X = B$$ A (input) real or complex valued TrMatrix The $$n \times n$$ triangular matrix. b (input/output) real or complex valued DenseVector On entry, the $$n \times n_{rhs}$$ right hand side vector $$b$$. On exit, the solution vector $$x$$.