C ++: a mathematical library that solves a system of equations using a backward substitution algorithm

If I have this:

A * f = g; A: upper triangular matrix (nxn) f: (nx 1) g: (nx 1) 

It is necessary to solve for f using the backward substitution algorithm. I would say that in fact it is not so difficult to write, but itโ€™s good if there is a library, then why not.

+4
source share
4 answers

Boost uBlas should work. At least if I understood your question correctly, you probably want to start by looking at lu_substitute() and inplace_solve() .

+2
source

Use LAPACK . It is already installed on many systems, and there are many implementations for systems that do not have it.

In particular, the required procedure is dtrtrs or strtrs , depending on whether your data is double or single-precision.

+3
source

Is this one of them? I have not heard about solving systems of linear equations with "reverse substitution" before. Why should it be a replacement?

http://eigen.tuxfamily.org/dox/TutorialAdvancedLinearAlgebra.html

0
source

For simplicity and lack of dependencies, I would go for JAMA + TNT and use the LU class for factorization and its solve() method. It seems that you cannot initialize LUs with an already existing upper triangular matrix (the LU constructor makes no assumptions and just starts factoring), but I think you could use it as it is and live with the performance defeat of redundant factoring or just adopt a solution method and adapt it to your needs.

0
source

Source: https://habr.com/ru/post/1304730/


All Articles