[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: found a small bug in residue corection
From: |
John W. Eaton |
Subject: |
Re: found a small bug in residue corection |
Date: |
Mon, 26 Nov 2007 13:29:25 -0500 |
On 26-Nov-2007, Ben Abbott wrote:
| On Nov 26, 2007, at 10:49 AM, Doug Stewart <address@hidden> wrote:
|
| > I an using qtoctave on windows xp
| > octave version 2.9.15
| >
| > example that produces the problem:
| >
| > residue([1],[ 1 10 25])
| >
| > to fix the problem goto line 314 in residue
| > pnum = pnum + prepad (pn, N+1, 0);
| >
| > and change it to
| >
| > pnum = pnum + prepad (pn, N+1, 0,2);
| >
| >
| > This only shows up when it was trying to prepad a scaler and it
| > padded it in the wrong direction.
| > By adding the 2 as the 4th parameter we tell it to pad in the right
| > direction.
| >
| >
| > Sorry for the double posting but I saw that the line number was
| > wrong because I still had my debugging lines in the code.
| >
| > Doug Stewart
|
| Recently a significant rewrite of residue was submitted. If memory
| serves it was first present in 2.9.16.
|
| That version depends upon a new function mpoles.
|
| I'm not at my computer, but when I am I'll try your example on 2.9.17.
I see the following:
It seems to be fixed by the following change.
Thanks,
jwe
scripts/ChangeLog:
2007-11-26 John W. Eaton <address@hidden>
* polynomial/residue.m: Prepad along second dimension.
From Doug Stewart <address@hidden>.
Index: scripts/polynomial/residue.m
===================================================================
RCS file: /cvs/octave/scripts/polynomial/residue.m,v
retrieving revision 1.33
diff -u -u -r1.33 residue.m
--- scripts/polynomial/residue.m 12 Oct 2007 21:27:25 -0000 1.33
+++ scripts/polynomial/residue.m 26 Nov 2007 18:28:20 -0000
@@ -311,7 +311,7 @@
endfor
pn = deconv (pden, pm);
pn = r(n) * pn;
- pnum = pnum + prepad (pn, N+1, 0);
+ pnum = pnum + prepad (pn, N+1, 0, 2);
endfor
## Add the direct term.