Boost logo

Ublas :

Subject: Re: [ublas] [bindings] Workspaces
From: Thomas Klimpel (Thomas.Klimpel_at_[hidden])
Date: 2008-12-17 05:35:21


Rutger ter Borg wrote:
> Would be nice if something along this lines would work:
>
> typedef traits::type_traits< ValueType >::real_type real_type;
> typedef ValueType value_type;
> ( ...
> traits::vector_storage( get_array_of< value_type >(work) ),

Now you have "vector_storage" but "get_array_of". Therefore a comment about "boost::numeric::bindings::traits::detail::array<T>" seems appropriate:

The lapack bindings use "boost::numeric::bindings::traits::detail::array<T>" for minimal_workspace and optimal_workspace, but the user is not required to do the same. It is perfectly valid to use a "std::vector<T>" or a "boost::numeric::ublas::vector<T>" or any other container satisfying the vector traits requirements for providing workspace. So I think "get_array_of" is a misleading name.

> I see the workspace structs only keep references,

Do you state this because it is unexpected, or just to nail it down so that it is easier to follow the rest of your explanation?

> this would mean that we'll
> just pass the temporary arrays through a workspaceN struct to the more
> generic member function.

What do you mean by "temporary arrays"? The temporary references to the arrays? Or the temporary arrays allocated by the bindings in case of minimal_workspace or optimal_workspace? Or the vector storage container provided by the user in case of user provided workspace?

Regards,
Thomas