[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Simple recursion problem
From: |
Michal Tarana |
Subject: |
Simple recursion problem |
Date: |
Sun, 27 Feb 2005 15:51:28 +0100 |
Hi everybody,
^^^^^^^^^^^^^
I am trying to run this simple code in Octave:
function I = strangeintegral(order, b, Z)
if (order == 0)
result = -0.5 / sqrt(pi * b);
I = result + 0.5 * i * sqrt(Z) * cef(-sqrt(b * Z), 20);
else
result = (-1.0 / (2.0 * pi)) * (b ^ (-order - 2.5)) *
spgamma(order);
I = result + Z * strangeintegral(order - 1, b, Z);
endif
endfunction
But sometimes Octave crashes with Segmentation fault and I don't know,
why. When I call this function from the commandline, sometimes Octave
crashes. Manytimes it works for two or three times, but when I call it
fourth or fifth time, it crashes. When it is called from some for-cycle,
it also sometimes happens. And everytime it is called with the same
parameter order (number of recursions). And this number is low (the
level of recursion is not higher than 5). Does anybody have some idea? I
am using Octave 2.1.66 in Debian Sid.
Thank you for any comment or hint.
--
Regards
Michal
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------
- Simple recursion problem,
Michal Tarana <=