Boost logo

Ublas :

From: Manoj Rajagopalan (rmanoj_at_[hidden])
Date: 2006-04-13 10:06:11

you can solve Ax=b using three lines of ublas code:

permutation_matrix<> piv;
lu_factorize(A, piv);
lu_substitute(A, piv, x);

Then x will contain the solution and A is overwritten with its LU
decomposition. i.e., the original values of A and x are destroyed so the
above lines are actually the inplace_solve(A, x) for a dense, generic A.

BTW, I've come across this in many places - what does "boilerplate code"
mean and why is it called so?


John Maddock wrote:
> I gather from a quick web search that ublas does have LUP decomposition
> routines, however a grep of the docs failed to find any mention of the
> routine in question, and how they should be used.
> So.... does anyone have the boiler plate code needed to solve for x given
> matrix A and vector b ?
> Many thanks,
> John Maddock.
> _______________________________________________
> ublas mailing list
> ublas_at_[hidden]