Boost logo

Boost Users :

From: Matthias Schabel (boost_at_[hidden])
Date: 2008-06-25 14:32:16


> Pat Hawley wrote:
>> My next step would be to add units to the numeric values--assuming
>> this can be
>> done in the context of ublas.
>>
>> Is it possible to use Boost.Units and Boost.Ublas together?
>> For example create a ublas vector of positions?
>>
>
> It is possible to create such a vector, but there isn't a whole lot
> you can do with it. You certainly won't be able to do anything
> that requires quantities to be multiplied and divided inside uBlas.

The problem being that ublas currently does not correctly resolve the
value type for arithmetic operations. For "normal" numeric types, even
if not strictly correct, this is usually not a problem : the type of
vector<double>*vector<double> is vector<double>. Since all the unit
magic in Boost.Units is encoded in the types, this isn't true with
quantities : the type of vector<quantity<length>
>*vector<quantity<length> > is vector<quantity<area> >... In
principle, this could be fixed, but would require a significant amount
of effort on the part of the ublas maintainers.

Matthias


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