help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Octave equivalent to A = mxGetPr(prhs[0]);


From: Fredrik Lingvall
Subject: Octave equivalent to A = mxGetPr(prhs[0]);
Date: Fri, 09 Jun 2006 11:15:19 +0200
User-agent: Thunderbird 1.5.0.4 (X11/20060604)

Hi all,

I want to get a pointer to an input parameter (a large matrix) in an octave
DLD-function (oct file) without making a copy of the input data. In a Matlab
mex-file I would do,

A_M = mxGetM(prhs[0]);
A_N = mxGetN(prhs[0]);
A = mxGetPr(prhs[0]);

to get the matrix size and a pointer to the data.  For octave, I have tried

A_M = args(0).matrix_value().rows();
A_N = args(0).matrix_value().cols();
A = args(0).matrix_value().fortran_vec();

A_M and A_N get the correct values but the pointer A do not seem to point to the data.
What am I doing wrong here?

/Fredrik




reply via email to

[Prev in Thread] Current Thread [Next in Thread]