help-octave
[Top][All Lists]
Advanced

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

Re: I'll try again: oct and arrays


From: Martin Helm
Subject: Re: I'll try again: oct and arrays
Date: Wed, 29 Dec 2010 15:00:57 +0100
User-agent: KMail/1.13.5 (Linux/2.6.34.7-0.5-desktop; KDE/4.5.4; x86_64; ; )

Am Mittwoch, 29. Dezember 2010, 14:34:21 schrieb Jesper Schmidt Hansen:
> 
> I think the difference is due to the fact that there exists an
> overhead using the () operator (not inlined by the compiler I guess),
> which is not there when you access the variable elements directly. Is
> this correct? If so, how to overcome this overhead without first
> copying everything to a second simple double array?
> 
> Cheers Jesper

I think the overhead is more due to bounds checking but I am not a skilled oct 
file hacker. oct files are the better approach than mex because they are not so 
"foreign" to octave. If you directly want to work with the data in an array 
you may want to use th method fortran_vec() 

http://www.gnu.org/software/octave/doc/interpreter/Matrices-and-Arrays-in-
Oct_002dFiles.html#Matrices-and-Arrays-in-Oct_002dFiles

But keep in mind I have not much experience with the C++/octave bindings. Just 
recently I started to have a look at them because I want to interface with 
fortran 2003 code.

 


reply via email to

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