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: John W. Eaton
Subject: Re: Better quadrature routine in octave
Date: Sat, 24 Apr 2010 17:14:45 -0400

On 24-Apr-2010, Pedro Gonnet wrote:

| 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.

If you resize a matrix, you may end up generating a copy.  So I would
just create a matrix of the size you need each time you need it.

Also, how are you accessing the pointer to the octave_function object?
It will probaby be more robust to just call feval.

If you want help, maybe it would be best to post what you have so far
so someone could comment on it.  The help list would be a better place
for that kind of question.

jwe


reply via email to

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