Boost logo

Ublas :

Subject: Re: [ublas] Numeric traits for ublas bounded_vector and matrix
From: Jesse Perla (jesseperla_at_[hidden])
Date: 2010-02-22 10:32:28

Rutger ter Borg <rutger <at>> writes:

> E.g., result_of::size< double[10] >::type will be an mpl::int_<10>.

Can you explain the rationale behind the result_of:: style with metafunctions?
I have seen it in a few places and don't understand it.

> If you end up using traits-related stuff other than that available directly
> under bindings/, please drop us a message.

Another few useful ones I had to write that I can't find in the bindings are:
is_vector<ublas::vector<double>> == true
is_vector<ublas::bounded_vector<double, 3>> == true
is_vector<ublas::vector_range<ublas::vector<double>>> == true

and is_matrix<>

Last, I haven't needed it yet but eventually will: Consider numeric traits for
boost::multi_array of dimension 1 and 2 as vectors and matrices. I know that
a lot of people need interoperability of multi_array, ublas, and lapack,
and this might be a cheap way to get it.

BTW, I think the numeric bindings may be close for inclusion into boost.
I am not sure that the LAPACK, etc. ones belong there, but no question
in my mind that the numeric traits do.