Boost logo

Ublas :

From: John Maddock (john_at_[hidden])
Date: 2006-04-13 13:35:30


> 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.

That's just the information I was looking for, thankyou!

It'll be a few days now before I get test this out, but in the mean time I
have a few more questions for you:

1) Is the interface to these functions likely to change in future?
2) Is this going to become an official part of ublas and get documented?
3) Are folks using this? How reliable is it? I ask because there are no
test cases for it in the ublas regression test suite, and I normally work on
the assumption that "if it's not tested it doesn't work" :-)

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

Any code that can be reused over and over without much change.

Historically, "boilerplate" was the thick steel plate that boilers were made
from: if it wasn't well made the boiler would go "bang" and usually kill
somebody. I don't believe my code will kill anyone, but I still prefer it
to be well made :-)

John.