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

View: New views
2 Messages — Rating Filter:   Alert me  

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

by cjbattagl :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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
--
View this message in context: http://www.nabble.com/Accessing-Pointer-to-NDarray-Matrix-data-in-C-oct-file-tp24308186p24308931.html
Sent from the Octave - General mailing list archive at Nabble.com.

_______________________________________________
Help-octave mailing list
Help-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave

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

by Jaroslav Hajek-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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