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 16:34:23


2010/3/9 Agustín K-ballo Bergé <kaballo86_at_[hidden]>:
> El 09/03/2010 06:53 a.m., Emil Dotchevski escribió:
>> 2010/3/8 Agustín K-ballo Bergé <kaballo86_at_[hidden]>:
> Here is a small example that does not compile, however different from
> what I initially report. it may be even illegal code?
>
> #include <boost/la/col.hpp>
> #include <boost/la/mat.hpp>
> #include <boost/la/vec.hpp>
>
> int main()
> {
>        using namespace boost::la;
>
>        mat< float, 4, 4 > m = {};
>        vec< float, 4 > v = {};
>        ( m | col< 0 >() ) = v;
> }

You need more/different includes, mat_traits.hpp includes mat.hpp, the
motivation being that if you just need the type definition you don't
have to include the rest of the (Boost) LA stuff:

#include <boost/la/col.hpp>
#include <boost/la/mat_traits.hpp>
#include <boost/la/vec_traits.hpp>
#include <boost/la/vector_assign.hpp>

int main()
{
       using namespace boost::la;

       mat< float, 4, 4 > m = {};
       vec< float, 4 > v = {};
       m|col<0>() = v;
}

Also note that the actual syntax is m|col<0> = v, the () is only
needed on MSVC due to a compiler bug.

>>> · 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?
> vec< float, 3 > const x_axis = unit_vector< float, 3 >( X );
> // x_axis == { 1.f, 0.f, 0.f }

I'd rather use unit_x<float,3>() what do you think?

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