Boost logo

Ublas :

Subject: Re: [ublas] [feature request] new free functions for matrix/vector sizes
From: Marco Guazzone (marco.guazzone_at_[hidden])
Date: 2010-07-02 18:16:28


On Sun, Jun 20, 2010 at 10:31 PM, Marco Guazzone
<marco.guazzone_at_[hidden]> wrote:
> On Fri, Oct 9, 2009 at 8:16 PM, Gunter Winkler <guwi17_at_[hidden]> wrote:
>> Marco Guazzone schrieb:
>>> OK Got it!
>>> I'll try to follow this way in future implementations.
>>> For what concern my committed code, I've seen some code need still to
>>> be adequated. If you I can help you to change it. Let me know.
>>>
>> Feel free to send patches at any time.
>>
>
> Hello,
>
> I'm considering to change the code of the "size" operation (that I
> wrote months ago) for two reasons:
>
> 1. to use the new uBLAS traits system introduced by Gunter
>     E.g.:
>        typename ExprT::size_type size(...)
>        ==>
>        typename matrix_traits<ExprT>::size_type size(...)
>
> 2. to make it directly usable with *_expression<E> types rather than
> passing the contained expression E
>     E.g.:
>        template <typename E>
>        void do_something(vector_expression<E> const& ve)
>        {
>           s = size(ve());
>        }
>        ==>
>        template <typename E>
>        void do_something(vector_expression<E> const& ve)
>        {
>           s = size(ve);
>        }
>  (surely less annoying ;) )
>

[big-cut]

> PS: ok! One solution might be to create a different function
> "size_by_tag" and to remove the polymorphic call "size<tag>()"; but
> this would break compatibility with code developed after the release
> of boost 1.41.
>

At the end, after several trials, I am unable to make the
"size<tag>()" works with the new changes.

I've created a new ticket

  https://svn.boost.org/trac/boost/ticket/4399

where I propose a change (and a patch) which however *break back compatibility*.
Specifically, instead of using "size<tag>" one should call "size_by_tag<tag>"

What do you think?

Thank you very much!!

Best,

-- Marco