Armadillo - how to extract strings?

I am using the Armadillo C ++ library for matrices.

I would like to copy some of the lines to an external array (I need to copy them to gpu). Is there a quick way to do this?

If I use .rows, it gives me a subview without access to pointers to data, so I have to iterate over the values ​​and copy them one by one. It is very slow.

Is there any other option?

Thanks.

+4
source share
3 answers

Armadillo ( LAPACK), . colptr() . , , . .

+5

- .rows . . , .

+2

- memptr(). C-, . , Mat<double> n n, double n * n.

int n=10;
Mat<double> M(n,n,fill::rand);
double* arr = M.memptr();

arr, , mtall.

, - (, - ). advanced mat.

, Lanczos/Arnoldi Conjugate Gradient, , C-. arma .

+2

Source: https://habr.com/ru/post/1525212/


All Articles