patchGNU Octave - Patches: patch #9453, assert() should report tolerance...

 
 

patch #9453: assert() should report tolerance exceedance

Submitter:  Dan Sebald <sebald>
Submitted:  Wed 13 Sep 2017 04:29:30 PM UTC
   
 
Category:  Core : other Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  None Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 22 Sep 2017 12:13:24 AM UTC, comment #1: 

I pushed the patch here (http://hg.savannah.gnu.org/hgweb/octave/rev/ae8e3e81f372).  I made two changes.  First, I wrapped the lines to less than 80 characters.  Second, I used the straight transpose operator .' rather than the Hermitian conjugate operator to be explicit that only the shape of the array is being changed.

Rik <rik5>
Group administrator
Wed 13 Sep 2017 04:29:30 PM UTC, original submission:  

When an assert() test fails, the amount by which the tolerance is exceeded is not reported.  Thus there can be error messages like:


error: ASSERT errors for:  assert (3,3.1,0.1)

  Location  |  Observed  |  Expected  |  Reason
     ()           3           3.1        Abs err 0.1 exceeds tol 0.1


which can confuse users who don't realize there is floating point arithmetic at play.

This patch adds a little extra info at the end to give a hint that this is a floating point math issue.  E.g.,


octave:1> assert(3, 3.1, 0.1)
error: ASSERT errors for:  assert (3,3.1,0.1)

  Location  |  Observed  |  Expected  |  Reason
     ()           3           3.1        Abs err 0.1 exceeds tol 0.1 by 8e-17


Dan Sebald <sebald>

 

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

Attach Files:
   
   
Comment:
   

 

Depends on the following items: None found

Digest:
   bug dependencies.

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by sebald (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 logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-09-22 rik5 StatusNone Done
        Open/ClosedOpen Closed
    2017-09-13 mtmiller Dependencies- bugs #52004 is dependent
    2017-09-13 sebald Attached File- Added octave-assert_print_tolerance_overrun-djs2017sep12.patch, #41795

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code