help-octave
[Top][All Lists]
Advanced

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

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


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

David Bateman wrote:
Try

const Matrix Am = args(0).matrix_value();
const double *A = Am.fortran_vec();
octave_idx_type A_M = A.rows();
octave_idx_type A_N = A.cols();

D.
This works but is Am now a copy of the data?
I'm working with really big matrices and do not want to
copy any data.

Also, I don't want to declare the pointers as const
since I want to preform in-place operations on the data.
That is, change the input parameters like, for example,

   A[0] = 1.0;

This works fine i Matlab.

/F


reply via email to

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