From tschoenhoff at gmail.com  Thu Apr 20 13:35:16 2006
From: tschoenhoff at gmail.com (druid@gmail.com)
Date: Thu, 20 Apr 2006 13:35:16 +0200
Subject: [Rd] bug: code not working as expected (PR#8783)
In-Reply-To: <20060420102610.CE2414423F@slim.kubism.ku.dk>
References: <20060420102610.CE2414423F@slim.kubism.ku.dk>
Message-ID: <5ad2dec0604200435y5cf47518rd06ea12504a231db@mail.gmail.com>

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



[Rd] bug: code not working as expected (PR#8783)
druid@gmail.com