[This approach](https://github.com/thisMagpie/fftw/blob/master/ext/fftw/fftw.cpp#L120) is slow and does not leverage nmatrix's functionality completely. I'd recommend using something like `NM_STORAGE_DENSE(nmatrix)->elements` from `nmatrix.h` for gaining access to an NMatrix object's elements.