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

 
 

bug #35174: polyfit broken by chageset 614505385171

Submitter:  marco atzeri <matzeri>
Submitted:  Mon 26 Dec 2011 07:36:18 AM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 26 Dec 2011 11:40:14 PM UTC, comment #2: 
Rik <rik5>
Group 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>
Group 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 Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-12-26 rik5 StatusNone Fixed
        Open/ClosedOpen Closed
    2011-12-26 jwe Carbon-Copy- Added rik5

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code