Boost logo

Ublas :

Subject: [ublas] Create a matrix with the same layout of another matrix
From: Marco Guazzone (marco.guazzone_at_[hidden])
Date: 2010-07-06 10:01:10


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