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

ResizableDoubleArray: Wrong "initialCapacity"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 3.5
    • 3.6
    • None
    • None

    Description

      In o.a.c.m.util.ResizableDoubleArray, in the constructor

      public ResizableDoubleArray(double[] initialArray) {
          this(DEFAULT_INITIAL_CAPACITY,
                  DEFAULT_EXPANSION_FACTOR,
                  DEFAULT_CONTRACTION_DELTA + DEFAULT_EXPANSION_FACTOR,
                  DEFAULT_EXPANSION_MODE,
                  initialArray);
      }
      

      the initial capacity should be set to the length on the input, and not to the hard-coded default.

      Attachments

        Activity

          People

            erans Gilles Sadowski
            erans Gilles Sadowski
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: