help-octave
[Top][All Lists]
Advanced

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

Re: Code generation with an octave interface


From: Jaroslav Hajek
Subject: Re: Code generation with an octave interface
Date: Tue, 18 Nov 2008 20:51:36 +0100

On Tue, Nov 18, 2008 at 6:24 PM, Helfer Thomas <address@hidden> wrote:
> 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 ?
>

Many numeric classes in Octave, in particular everything derived from
Array<T> (such as the Matrix class), are actually pointers to
reference-counted data, using copy-on-write mechanism, so that a
read-only copy is always cheap.

regards

> Feel free to do any remark.
>
> Thanks,
>
> Helfer Thomas,
>
>
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
>
>



-- 
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


reply via email to

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