octave-maintainers
[Top][All Lists]
Advanced

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

Re: Better quadrature routine in octave


From: Pedro Gonnet
Subject: Re: Better quadrature routine in octave
Date: Sat, 24 Apr 2010 21:32:50 +0100

Hello again,

I'm currently re-writing the C-language version as an Oct-file. The
documentation is a bit shaky, but I can get by on the examples except
for one thing: When I call the integrand (I'm using an octave_function
*fcn), I need to generate a vector of values "x" to compute "y = f(x)".
I have to do this often and for vectors "x" of length 5, 17, 33, 3, 7,
15 and 31.

I'm guessing the most efficient way would be do declare one Matrix
object of length 33 and then, whenever I call the integrand, fill it
with the values of "x" I need and somehow tell the Matrix to truncate
its own length.

Unfortunately, I have no idea how to do this. In MEX, I would do this
with mxSetM(...), but with Octave I don't even know if I should declare
a Matrix or an NDArray... Any help anyone?

Cheers,
Pedro





reply via email to

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