Boost logo

Ublas :

From: Michael Stevens (mail_at_[hidden])
Date: 2006-08-28 23:37:57

On Monday, 28. August 2006 21:18, Neal Becker wrote:
> Sorry to be a bit dense, but exactly what is matrix_vector_range/slice? It
> is apparently not what I thought it was.
> The constructor for range takes a matrix and 2 range args. Can anyone
> explain what are the semantics?

They extract elements out of a matrix and return them as a vector. Which
elements they are is specified by the pairs of indicies formed from the pair
of ranges or slices.

So if you specify range(0,3), range(4.7) then the resulting vector contains
the three elements 0,4 1,5 2,6 from the matrix.

From this you can see that matrix_vector_range allows you to extract various
diagonal views from the matrix. matrix_vector_slice can be used to more
unusual element combinations but is not very intuitive!


Michael Stevens Systems Engineering
34128 Kassel, Germany
Phone/Fax: +49 561 5218038
Navigation Systems, Estimation  and
                 Bayesian Filtering