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

druid@gmail.com tschoenhoff at gmail.com
Thu Apr 20 13:35:16 CEST 2006


Hi Nicolai,


2006/4/20, N.Kalosha at math.ru.nl <N.Kalosha at 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



More information about the R-devel mailing list