# How to use TrangularView class in Eigen C++

For a nonsingular lower or upper triangular square matrix $A$, how to solve such linear system in Eigen:

$$A x = b$$

x = A.triangularView<Upper>().solve(b);

x = A.triangularView<Lower>().solve(b);

• thank you for answering so many of my Eigen related questions! – LCFactorization Feb 10 '14 at 9:49