Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
  • Sign in
OpenWalnut Core
OpenWalnut Core
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 44
    • Issues 44
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
  • OpenWalnut
  • OpenWalnut CoreOpenWalnut Core
  • Issues
  • #179

Closed
Open
Opened May 08, 2017 by Mathias Goldau@math
  • Report abuse
  • New issue
Report abuse New issue

-RM-244-MR-WHistogramBasic, off-by-one error.

The documentation says the intervals are right open, but the implementations does something different. The unittest do not fail, as symptom is actually fixed reducing the number of bins.

m_bins.at( static_cast< size_t >( ( value - m_minimum ) / std::abs( m_maximum - m_minimum ) * ( m_nbBuckets - 1 ) ) )++;

There the @m_nbBuckets -1@ is actually securing that no @bin-index >= bins.size@ occurs. This leads also to invalid unittests:

         h.insert( 0.7234 );
         TS_ASSERT_EQUALS( h.size(), 1000 );
         TS_ASSERT_EQUALS( h.valuesSize(), 1 );
         TS_ASSERT_EQUALS( h[722], 1 );

Where it should actually be bucket number 723.

(from redmine: created on 2013-02-13, closed on 2013-02-13)

To upload designs, you'll need to enable LFS. More information
Assignee
Assign to
OpenWalnut 1.3.1
Milestone
OpenWalnut 1.3.1
Assign milestone
Time tracking
None
Due date
None
1
Labels
Bug
Assign labels
  • View project labels
Reference: openwalnut/openwalnut#179