Free cookie consent management tool by TermsFeed Policy Generator

source: branches/3040_VectorBasedGP/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/VectorData/RandomExtensions.cs @ 17400

Last change on this file since 17400 was 17400, checked in by pfleck, 4 years ago

#3040 Added Azzali benchmarks

File size: 621 bytes
Line 
1using HeuristicLab.Core;
2using HeuristicLab.Problems.DataAnalysis;
3
4namespace HeuristicLab.Problems.Instances.DataAnalysis {
5  public static class RandomExtensions {
6    public static double NextDouble(this IRandom rand, double min, double max) {
7      return (max - min) * rand.NextDouble() + min;
8    }
9    public static DoubleVector NextDoubleVector(this IRandom rand, double min, double max, int length) {
10      var values = new double[length];
11      for (int i = 0; i < values.Length; i++) {
12        values[i] = rand.NextDouble(min, max);
13      }
14      return new DoubleVector(values);
15    }
16  }
17}
Note: See TracBrowser for help on using the repository browser.