|
Boost Users : |
Subject: Re: [Boost-users] multi_array : using double** from 3rd party lib
From: Rhys Ulerich (rhys.ulerich_at_[hidden])
Date: 2010-02-23 10:44:43
> I have a 3rd party library which exposes a function that takes a double** data argument.
> I looked into its source and saw that they use this notation
> data[i][j] with i and j varying from imin to imax and j from jmin to jmax
>
> Now I have a boost::multi_array<double, 7> marray ...
> and I wish to pass the "subarray" as a double** argument and call their function.
> It's not possible, is it?
I do not think it is directly possible without some work. It sounds
like you've got pointers-to-pointers a la [1]. You could probably
recreate the double** information you need from the subarray, however,
and pass that in.
> I am actually able to override their function that takes in a double** data.
>
> Can it work then?
Then it will depend a lot on the underlying implementation.
- Rhys
[1] http://www.fftw.org/fftw3.3alpha_doc/Dynamic-Arrays-in-C_002dThe-Wrong-Way.html
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net