Free cookie consent management tool by TermsFeed Policy Generator

Changeset 12143 for trunk/sources


Ignore:
Timestamp:
03/05/15 15:51:09 (9 years ago)
Author:
ascheibe
Message:

#2351 add minimum check for bandwidth

Location:
trunk/sources/HeuristicLab.Analysis.Views/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Analysis.Views/3.3/HistogramControl.Designer.cs

    r12140 r12143  
    148148            0,
    149149            0,
    150             65536});
     150            851968});
    151151      this.bandwidthNumericUpDown.Name = "bandwidthNumericUpDown";
    152152      this.bandwidthNumericUpDown.Size = new System.Drawing.Size(61, 20);
  • trunk/sources/HeuristicLab.Analysis.Views/3.3/HistogramControl.cs

    r12140 r12143  
    3131  public partial class HistogramControl : UserControl {
    3232    protected static readonly string SeriesName = "Histogram";
    33 
     33    protected static readonly decimal bandwidthMin = 0.0000000000001m;
    3434    protected Dictionary<string, List<double>> points;
    35     private bool suppressUpdate;
     35    protected bool suppressUpdate;
    3636
    3737    public int NumberOfBins {
     
    198198      if (double.IsNaN(bandwidth)) {
    199199        bandwidth = KernelDensityEstimator.EstimateBandwidth(rowArray);
     200        decimal bwDecimal = (decimal)bandwidth;
     201        if (bwDecimal < bandwidthMin) {
     202          bwDecimal = bandwidthMin;
     203          bandwidth = decimal.ToDouble(bwDecimal);
     204        }
    200205        suppressUpdate = true;
    201         bandwidthNumericUpDown.Value = (decimal)bandwidth;
     206        bandwidthNumericUpDown.Value = bwDecimal;
    202207      }
    203208      var density = KernelDensityEstimator.Density(rowArray, rowArray.Length, stepWidth, bandwidth);
Note: See TracChangeset for help on using the changeset viewer.