Boost logo

Boost Users :

From: jhr.walter_at_[hidden]
Date: 2002-11-12 01:38:53


----- Original Message -----
From: deane_yang
To: Boost-Users_at_[hidden]
Sent: Sunday, November 10, 2002 11:52 PM
Subject: [Boost-Users] Re: using ublas to solve linear systems?

> --- In Boost-Users_at_y..., "jhrwalter" <jhr.walter_at_t...> wrote:
> > --- In Boost-Users_at_y..., "deane_yang" <Deane_Yang_at_y...> wrote:
> > > Digging through the documentation, I find a description of a
> > function
> > > called 'solve" that says "Solves a linear equation for a triangular
> > matrix."
> > > There is also a formula,
> > >
> > > B = solve(A, B, tag) <------> B <- A-1 B
> >
> > At least the -1 is superscripted in the HTML docs, meaning the
> > inverse of the matrix AFAIK.
>
> Yes, I knew that. That still does not make anything clear.
> For example, why is B on both sides of the assignment operator?
> Does this imply that "B = solve(A,B, tag)" causes B to be
> replaced by A^{-1}B?

Oops. I've just looked into the sources (always recommended ;-) and noticed
that this is a documentation bug. The corrected documentation should read

C = solve(A, B, tag) <------> C <- A^-1 B

Corresponding inplace "solvers" are used internally:

inplace_solve(A, B, ...) <------> B <- A^-1 B

Maybe I should add an appropriate dispatcher function and document it, too.

> Is this the only valid way to use "solve"?
>
> And where does "triangular" come into all of this?

A has to be triangular (I'll add this, if it's not there already).

> > > b) what exactly does the function solve do?
> >
> > It's the usual BLAS (see for example www.netlib.org/blas) triangular
> > solver (sorry for the repetition) used in the
> > forward/backsubstitution step of lu for example.
>
> I can infer from what you say that in fact the matrix A above needs to
> be triangular. It would be clearer, if that were made explicit in the
> documentation.

Agreed.

> And is it standard lingo in some circles to say
> "solve for a triangular matrix" for the act of replacing a vector
> or matrix B by A^{-1}B, where A is triangular? I find this odd,
> since when I say "solve for <something>", I mean that <something>
> is an unknown object that needs to be found through a calculation.

Sorry, I'm not a native speaker. How would you correct this?

> Here, the triangular matrix is known, so it does not need to be solved
for.
> The unknown is in fact either a vector or a matrix that does not need
> to be triangular at all.
>
> I would suggest that the documentation for
> uBLAS is quite inadequate for someone who is not fluent in BLAS.

Before I started, I wasn't fluent in BLAS. Seems to be the force of habit.

> Is the intent to have uBLAS only usable by people who are fluent
> in BLAS?

No. But it's certainly intent to point to BLAS.

> Couldn't the documentation for uBLAS be a little more precise
> and use less shorthand BLAS lingo?

If time and competence allow.

Thanks for your feedback

Joerg


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net