Uploaded image for project: 'Commons Math'
  1. Commons Math
  2. MATH-1205

AbstractStorelessUnivariateStatistic should not extend AbstractUnivariateStatistic

Rank to TopRank to BottomAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.4.1
    • 4.0
    • None
    • None

    Description

      For a storeless statistic it is wrong to extend AbstractUnivariateStatistic as various fields and methods are inherited that do not make sense in case of a storeless statistic.

      This means a user can accidentially use a storeless statistic in a wrong way:

              Mean mean = new Mean();
              
              mean.increment(1);
              mean.increment(2);
              
              mean.setData(new double[] { 1, 2, 3});
              
              System.out.println(mean.getResult());
              System.out.println(mean.evaluate());
      

      will output

      1.5
      2.0
      

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            tn Thomas Neidhart
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment