Hi Marco,
I think uBlas' traits system needs some refinement (or should I say extension?) and I would be very happy to see such changes make it in. The layout_type traits you provide are probably the most important ones though. Nevertheless I think that we should offer a complete design rather than a few trait classes here and there, so that a solid interface is achieved. Maybe a good start would be the ublas part of the bindings traits (if those are complete would the authors be interested to merge them into uBlas?).
Having a more complete traits mechanism would allow as to scale well in complex operations and especially in multi-methods and dispatching kind of stuff.
Best
Nasos
> Date: Tue, 6 Jul 2010 16:01:10 +0200
> From: marco.guazzone@gmail.com
> To: ublas@lists.boost.org
> Subject: [ublas] Create a matrix with the same layout of another matrix
>
> Hi!
>
> I need to create a matrix B which has the same layout type of another matrix A.
>
> >From a quick look at uBLAS, I'ven't found a cooked solution.
> Indeed, matrix_traits gives only access to orientation_category which
> is a tag type for the matrix layout (this is so because the matrix
> layout type is a private typedef).
>
> So, what I've done is a simple type-traits class "layout_type" which
> maps a matrix type (or a matrix expression type) to its layout type.
> In the attachment, there is a sample code.
>
> 1. Is this the best way to get my goal?
>
> 2. If it is, do you think the "layout_type" type-traits is a useful
> piece-of-code to be included in uBLAS?
>
> If it does, I would be very happy to create a ticket and post the new files.
>
> Thank you very much!!
>
> Cheers,
>
> -- Marco
Hotmail is redefining busy with tools for the New Busy. Get more from your inbox. See how.