Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • 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 86
    • Issues 86
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenWalnut
  • OpenWalnut CoreOpenWalnut Core
  • Issues
  • #179

Closed
Open
Created May 08, 2017 by Mathias Goldau@mathOwner

-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)

Assignee
Assign to
OpenWalnut 1.3.1
Milestone
OpenWalnut 1.3.1
Assign milestone
Time tracking