[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: A question about programming using dynamically linked function
From: |
David Bateman |
Subject: |
Re: A question about programming using dynamically linked function |
Date: |
Wed, 2 Jun 2004 10:46:56 +0200 |
User-agent: |
Mutt/1.4.1i |
According to address@hidden <address@hidden> (on 06/01/04):
> Hi
>
> I am writing dynamically linked functions. In my function, I
> need to copy the data from a complex matrix (in octave_value
> type) to a double buffer. I was wondering if there is a way to
> find a pointer to the real data in the complex matrix (in
> octave_value type), so that I can use memcpy to copy it to my
> own buffer. The similar function can be found in MATLAB which
> is mxGetPr. Does Octave have similar functions like mxGetPr?
You want the pointer to the raw data? Then in this case something
like
DEFUN_DLD (foo, args, , "help message") {
int nargin = args.length ();
for (int i=0; i < nargin; i++) {
<snip>
if (args(i).is_complex_type()) {
ComplexMatrix a = args(i).complex_matrix_value();
Complex *vec = a.fortran_vec ();
<snip>
}
}
}
But the pointer is of type "Complex" and not "double".. Is this what you
were after?
regards
D.
>
> Thanks a lot!
>
> Jia
> __
>
> Friends are angels
> sent down to earth
> to have good days and
> to help us find our way...
>
>
>
> -------------------------------------------------------------
> Octave is freely available under the terms of the GNU GPL.
>
> Octave's home on the web: http://www.octave.org
> How to fund new projects: http://www.octave.org/funding.html
> Subscription information: http://www.octave.org/archive.html
> -------------------------------------------------------------
--
David Bateman address@hidden
Motorola CRM +33 1 69 35 48 04 (Ph)
Parc Les Algorithmes, Commune de St Aubin +33 1 69 35 77 01 (Fax)
91193 Gif-Sur-Yvette FRANCE
The information contained in this communication has been classified as:
[x] General Business Information
[ ] Motorola Internal Use Only
[ ] Motorola Confidential Proprietary
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------