help-octave
[Top][All Lists]
Advanced

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

Code generation with an octave interface


From: Helfer Thomas
Subject: Code generation with an octave interface
Date: Tue, 18 Nov 2008 18:24:23 +0100
User-agent: KMail/1.10.1 (Linux/2.6.24-21-generic; KDE/4.1.2; x86_64; ; )

Hello,

I am writing a code generation tool for material properties (Young Modulus, 
etc..), material behaviours (creep,...). This tool support interface to 
c,c++,fortran, some finite element code, etc...

For material properties I have written an interface for octave. This interface 
is pretty convenient for testing and plotting material properties. Code 
generated works but I am wondering if performances are ok. 

You will find an example of original file octave_test.mfront and the generated 
code Test.cpp attached to this mail. 

I mostly used Stefan Van Der Walt's DaCodaAlFine for writting the octave 
interface (http://wiki.octave.org/wiki.pl?DaCodaAlFine). 

Test.cpp can be compiled with mkoctfile using GNU Octave, version 3.0.0
under ubuntu.

This test simply compute the product of the two arguments. The arguments might 
be either two reals, either two matrices, either a scalar and a matrix. All 
these cases are treated individually.

Could you give me your opinion on the code. In particular, to treat the latter 
case, I used to function get_scalar_value and get_matrix_value. Is their any 
real performance penalty du to these functions ? In particular, does 
 octave_value::matrix.value() return a copy of the matrix ?

Feel free to do any remark.

Thanks,

Helfer Thomas,

Attachment: Test.cpp
Description: Text Data

Attachment: octave_test.mfront
Description: Text document


reply via email to

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