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

Increase efficiency of EnumeratedDistribution#probability

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

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • 4.X
    • None
    • Patch

    Description

      There are lots of other low hanging fruit in the distribution package but unfortunately this is the only one I got to that day.

      In the EnumeratedDistribution case, the probability() method is currently O(N) where N denotes number of random variables, even though the random variables are fixed / known. This change makes probability() O(1). The unlikely worst case scenario now consumes slightly more than 2x the memory, but I do not think this would be an issue in the vast majority of cases.

      Original PR (incorrectly against master) here.

      Attachments

        Activity

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

          People

            Unassigned Unassigned
            rG_ Ryan Gaffney

            Dates

              Created:
              Updated:

              Slack

                Issue deployment