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.
.rows
Is there any other option?
Thanks.
Armadillo ( LAPACK), . colptr() . , , . .
- .rows . . , .
- memptr(). C-, . , Mat<double> n n, double n * n.
memptr()
Mat<double>
double
int n=10; Mat<double> M(n,n,fill::rand); double* arr = M.memptr();
arr, , mtall.
arr
, - (, - ). advanced mat.
, Lanczos/Arnoldi Conjugate Gradient, , C-. arma .
Source: https://habr.com/ru/post/1525212/More articles:The problem with decoding DES - iosThe default value for the exposed filter. - drupalExclusion of invalid android keywords? - androidHow do I track pageviews per minute using the Google Analytics Real Time API? - google-analyticshow do you delete an object selected using placement new - c ++How to record original AAC audio files on Android using MediaRecorder? AAC_ADTS not working - androidПочему spring не обеспечивает реализацию области потока? - scopegfortran не допускает массивы символов с различной длиной компонентов - fortranNetLogo Lists and Conditional Change - foreachAndroid Range SeekBar - androidAll Articles