Re: [Rd] bug: code not working as expected (PR#8783)

From: <druid_at_gmail.com>
Date: Thu 20 Apr 2006 - 11:35:16 GMT

Hi Nicolai,

2006/4/20, N.Kalosha@math.ru.nl <N.Kalosha@math.ru.nl>:
> This is a multi-part message in MIME format.
> --------------020909040800030906040005
> Content-Type: text/plain; charset=KOI8-R; format=flowed
> Content-Transfer-Encoding: 7bit
>
> Hi,
>
> I've attached two files with the sources for a function to implement the
> finite difference method for solving a particular differential equation.
>
> One of them works correctly, the other gives wrong results or returns an
> error, depending on the version of R.
>
> The difference between them is that in the 'broken' version in line 42 I
> check if the items in the two-dimensional array are bigger than a
> certain value, and in the working one I do it in a separate loop.

diff working.r broken.r

also reveals that your expression is differently bracketed

broken.txt says in line 42:

 (...) = (X-(j-1)*dS);

working.txt:

(...) = X-(j-1)*dS;

Don't know what the rationale of this difference really is since I'm no expert for finite difference methods. But your examples apparently don't only differ in terms of checking the size of your array-values.

Does this matter?

Thomas



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu Apr 20 21:38:10 2006

This archive was generated by hypermail 2.1.8 : Thu 20 Apr 2006 - 12:17:46 GMT