bugGNU Octave - Bugs: bug #35174, polyfit broken by chageset...

 
 

bug #35174: polyfit broken by chageset 614505385171

Submitted by:  marco atzeri <matzeri>
Submitted on:  Mon 26 Dec 2011 07:36:18 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 26 Dec 2011 11:40:14 PM UTC, comment #2:

Fixed by jwe in this changeset (http://hg.savannah.gnu.org/hgweb/octave/rev/b8d9530e940e).

Rik <rik5>
Project Administrator
Mon 26 Dec 2011 03:22:29 PM UTC, comment #1:

I undid the non-documentation changes in that changeset.

John W. Eaton <jwe>
Project Administrator
Mon 26 Dec 2011 07:36:18 AM UTC, original submission:

changeset 14104:614505385171
doc: Overhaul docstrings for polynomial functions.

has the side effect to broke a test inside polyfit.

isrow can not work as it is applied after y=y(:)
so this portion should be reversed

10.30
10.31 - y_is_row_vector = (rows (y) == 1);
10.32 -
10.33 ## Reshape x & y into column vectors.
10.34 l = numel (x);
10.35 x = x(:);
10.36 @@ -98,7 +97,7 @@
10.37 if (nargout > 1)
10.38 yf = v*p;
10.39
10.40 - if (y_is_row_vector)
10.41 + if (isrow (y))
10.42 s.yf = yf.';
10.43 else
10.44 s.yf = yf;

>>>>> processing /pub/hg/octave/scripts/polynomial/polyfit.m

***** test
x = 1000 + (-5:5);
xn = (x - mean (x)) / std (x);
pn = ones (1,5);
y = polyval (pn, xn);
[p, s, mu] = polyfit (x, y, numel(pn)-1);
[p2, s2] = polyfit (x, y, numel(pn)-1);
assert (p, pn, s.normr)
assert (s.yf, y, s.normr)
assert (mu, [mean(x), std(x)])
assert (s.normr/s2.normr < sqrt(eps))
!!!!! test failed
assert (s.yf,y,s.normr) expected
Columns 1 through 8:
3.50419 1.60995 0.84300 0.67356 0.77025 1.00000 1.42810 2.31817
Columns 9 through 11:
4.13221 7.53054 13.37184
but got
3.50419
1.60995
0.84300
0.67356
0.77025
1.00000
1.42810
2.31817
4.13221
7.53054
13.37184
Dimensions don't match

marco atzeri <matzeri>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by jwe
  • -unavailable- added by matzeri (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 26 Dec 2011 11:40:14 PM UTCrik5StatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Mon 26 Dec 2011 03:22:29 PM UTCjweCarbon-Copy-=>Added rik5

    Back to the top


    Powered by Savane 3.1-cleanup1