[uBLAS] Initialize a matrix by T*?

10 May
2009
10 May
'09
8:37 a.m.
Hi, I'm new to uBLAS. I wonder if there is an efficient way to initialize a ublas::matrix<T> by a T*. Somthing like a copy(matrix<T>& m, T* p, size_t nrows, size_t ncols). For instance: --- [code_snip] --- double* pd = new double[10*20]; //... ublas::matrix<double> m; copy(m, pd, 10, 20); --- [/code_snip] --- Obviously I can create a 10x20 empty matrix (matrix<T> m(10,20)) and then scan the T* assigning each element one at time. But is there a more efficient way? Thank you very much in advance!! -- Marco
5768
Age (days ago)
5768
Last active (days ago)
0 comments
1 participants
participants (1)
-
Marco Guazzone