|
Ublas : |
Subject: Re: [ublas] vector< vector< T > > to matrix < T > assignment
From: Matwey V. Kornilov (matwey.kornilov_at_[hidden])
Date: 2010-09-11 09:56:49
I would prefer special adapter:
vector< vector<double> > v;
matrix< double > m;
m = vector_of_vector_as_matrix( v ); //
matrix_as_vector_of_vector( m ) = v; //
but unfortunately it doesn't exist.
As far as I understand class vector_of_vector from boost is just a special
type of matrix storage.
Marco Guazzone wrote:
> Hello,
>
> Obviously, you can always iterate through each element of the outer
> and inner vectors and assign each element to your matrix.
>
> If you want something less boring you can iterate only the outer
> vector and assign each inner vector to a column or a row of your
> matrix.
>
> For instance, supposing each inner vector represents a column of your
> matrix, you can do the following: