Boost logo

Ublas :

Subject: Re: [ublas] [bindings][lapack] Interface design
From: Rutger ter Borg (rutger_at_[hidden])
Date: 2008-12-04 19:00:01

Thomas Klimpel wrote:
> I have problems understanding what unwrap_traits does. I also don't
> understand why the member of left_eigenvector_impl must be a
> boost::reference_wrapper<T> m_ref instead of a simple T& m_ref.

suppose you have a wrapped type, e.g.,

left_eigenvector( M )

with M being of type matrix<double>, then the wrapped type is

left_eigenvector_impl< matrix<double> >


traits::num_rows( left_eigenvector_impl< matrix<double> > );

doesn't know that type. I created the unwrap traits so that whatever is
wrapped in left_eigenvector_impl, it's contained type will be passed to the
traits. Perhaps it should be named dispatch_traits or something.

The reference wrapper is nothing special, just out of habit I guess.

Hopefully this cleared it up a bit,