Boost logo

Boost :

From: Geoffrey Irving (irving_at_[hidden])
Date: 2006-06-19 12:03:19

On Mon, Jun 19, 2006 at 09:43:45AM -0600, Dave Steffen wrote:
> Janek Kozicki writes:
> > Leland Brown said: (by the date of Fri, 16 Jun 2006 09:45:53 -0700 (PDT))
> >
> [...]
> > >
> > > I'd probably also include multiplication of one matrix
> > > by another, which is an equally straightforward
> > > operation.
> >
> > fully agreed, I was thinking about it, but didn't wrote this. This
> > qualifies to be put into wiki with specifications of this library.
> >
> </lurk>
> Allow me to ask a stupid question.
> Doesn't Boost already have a large, working, nifty, linear algebra
> (or at least vectors-and-matrices) package in UBLAS?

I think there is a need for a dedicated small vector library, not least
because it's highly unlikely that UBLAS code applied to fixed size vectors
will optimize sufficiently. I tried switching from a vector with separate
x,y,z member variables to one with a single x[3] and compile time for loops
and it got 30% slower (with gcc 4). Since small vector/matrix operations
are often the core of extremely performance intensive applications, it's
worth duplicating a little effort to get a 30% speedup.

That said, if the fusion-capable library Dave Abrahams is working on
doesn't have as much of a problem here, I'll happily withdraw the above.

> It seems to me that building operations for vectors-with-units and
> matrices-with-units is a duplication of effort. If the PQS library
> is as easy to use as [ it should be | we think it is ] then
> incorporating units into UBLAS should be both easy and a good
> exercise.

Small vectors and transforms require somewhat different interfaces than
large vectors. For example, uBLAS does not have cross products,
normalization, quaternions, exponential maps from vectors to quaternions,

As for units, a vector library should certainly be separate from the
units library, but the ability to add units requires a little extra
functionality here and there. For example, an unit capable affine
transform class has to know that

  y = Ax + b

has different units for A and b, and therefore needs one more template
parameter than it would otherwise require.

> Personally I think we're seeing some scope-creep here. If we come
> up with a good, general, units/dimensions library, than things like
> vectors-with-units should be things people do _with_ the library, not
> things people do _to_ the library, right?

I apologize for contributing to this confusion. A small vector library
is something to do _with_ PQS, and would not be part of PQS at all.
The fact that it's still on the PQS thread is due to bad etiquette.
Sorry about that.

Dave Abrahams: it would be great if you could give us your two sentence
opinion as to whether your linear algebra library subsumes all of this
functionality, and whether there would be significant speed penalties
compared to a far less general version specific to low dimensions.


Boost list run by bdawes at, gregod at, cpdaniel at, john at