I am using the Armadillo C++ library for solving linear systems of medium/large dimensions (1000-5000 equations).
Since I have to solve different linear systems
AX=b
in which A is always the same and B changes, I would like to LU factorize A only once and reuse the LU factorization with different b. Unfortunately I do not know how to perform this kind of operations in Armadillo.
What I did was just the LU factorization of the A matrix:
arma::mat A;
// ... fill the A matrix ...
arma::mat P,L,U;
arma::lu(L, U, P, A);
But now I would like to use the matrices P, L and U to solve several linear systems with different b vectors.
Could you help me please?