Accessing Pointer to NDarray/Matrix data in C oct-file

Jaroslav Hajek highegg at gmail.com
Fri Jul 3 02:43:33 CDT 2009


On Thu, Jul 2, 2009 at 5:30 PM, cjbattagl<c.battaglino at ll.mit.edu> wrote:
>
> Nevermind!
> I have got the code working again by using:
> const double* a_data = A.data();
>
> I'll refrain from having this posted to the mailing list.
> Casey

Yes, this is the recommended way to get a read-only pointer. To obtain
a writable pointer, use A.fortran_vec () (the odd name is a relic from
the past). This will correctly sort out possible multiple references
to the matrix.

regards

-- 
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


More information about the Help-octave mailing list