Boost logo

Ublas :

Subject: [ublas] initialize ublas matrix with a std::vector or array
From: Michael Morrison (mwmorrison93_at_[hidden])
Date: 2011-11-12 22:37:41


Hello All,

I have a method that takes a std::vector as one of its parameters. Is there
a way I can initialize a matrix by assigning the std::vector to the matrix?
Here's what I tried to do below. Does anyone know how i can achieve
assigning the vector (or even a pointer of doubles) to the matrix? Thanks
in advance. Mike

void Foo(std::vector v)
{
        matrix<double> t(2, 2, v);
        // work with matrix...
}