« Return to Thread: Re: Accessing Pointer to NDarray/Matrix data in C oct-file

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

by Jaroslav Hajek-2 :: Rate this Message:

Reply to Author | View in Thread

On Thu, Jul 2, 2009 at 5:30 PM, cjbattagl<c.battaglino@...> 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
_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

 « Return to Thread: Re: Accessing Pointer to NDarray/Matrix data in C oct-file