Boost logo

Boost :

Subject: Re: [boost] [la] [static size matrix/vector linear algebra library] More feedback
From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2010-03-09 04:53:02


2010/3/8 Agustín K-ballo Bergé <kaballo86_at_[hidden]>:
> · boost/la/all.hpp conflicts with boost/assign/list_of.hpp if
> Boost.Assign is included first. I think this has to do with missing
> includes in a few headers.

What do you mean missing includes? All (Boost) LA headers compile on
their own (this is explicitly tested in the libs/la/test/Jamfile.)

> · Expressions like rotx_matrix() * roty_matrix() don't work. The
> temporaries have to be stored in proper matrix variables first.
> Apparently its result type does not model a valid matrix? (just guessing).

Do you have code that demonstrates the problem? Which compiler? The
following works for me:

#include <boost/la/all.hpp>
int main()
{
    using namespace boost::la;
    rotx_matrix<3>(0.0f)*roty_matrix<3>(0.0f); //returns mat<float,3,3>
}

What doesn't work is rotx_matrix<D>()*rotx_matrix<D>(), but I'm not
sure if that's a big problem.

> · Could we have translation_matrix and scale_matrix, just as we have
> rot*_matrix ?

If v is an object of a vector type, v|trans_matrix will give you a
translation matrix of size D+1, where D is the size of v's type.
Similarly, v|diag_matrix will give you a scaling matrix.

> · There is no (vector) normalize function. The implementation is
> straightforward.

I don't know how I've missed that. Will do.

> · During RangeEx review, the use of views and algorithms was widely
> discussed. It would be good for Boost.LA to follow the same conventions
> decided back then. IIRC, `m | transposed` was a lazy view and
> `transpose(m)` returned a new (eagerly) modified value. I should go back
> to the archives to confirm this was indeed the conclusion.

I'm not sure I understand your point, or maybe you need a different
example. In (Boost) LA, m|transpose returns a transposed mutable
reference to m.

> · I would like to have X, Y, Z and W placeholders be convertible to the
> axis versor. However I don't think this can be actually implemented.
> Maybe something like versor<float,3>( X ) or unit_vector<float,3>( X )
> would be better.

Could you provide an example of what you want exactly?

Emil Dotchevski
Reverge Studios, Inc.
http://www.revergestudios.com/reblog/index.php?n=ReCode


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk