Changeset 10856 for branches/SimSharp/HeuristicLab.Problems.Programmable/3.3/Datastructures/RealParameterConfiguration.cs
- Timestamp:
- 05/15/14 15:06:57 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SimSharp/HeuristicLab.Problems.Programmable/3.3/Datastructures/RealParameterConfiguration.cs
r10850 r10856 61 61 bounds = cloner.Clone(original.bounds); 62 62 } 63 public RealParameterConfiguration(int length, double min, double max) 64 : base() { 63 public RealParameterConfiguration(int length, double min, double max) { 65 64 if (min >= max) throw new ArgumentException("min must be less than max", "min"); 66 65 this.length = new IntValue(length); … … 69 68 bounds[0, 1] = max; 70 69 } 71 public RealParameterConfiguration(int length, IList<double> min, IList<double> max) 72 : base() { 70 public RealParameterConfiguration(int length, IList<double> min, IList<double> max) { 73 71 if (min.Count == 0) throw new ArgumentException("Bounds must be given for the real parameters."); 74 72 if (min.Count != max.Count) throw new ArgumentException("min must be of the same length as max", "min"); 75 if (min.Zip(max, (m , M) => m >= M).Any()) throw new ArgumentException("min must be less than max in each dimension", "min");73 if (min.Zip(max, (mi, ma) => mi >= ma).Any()) throw new ArgumentException("min must be less than max in each dimension", "min"); 76 74 this.length = new IntValue(length); 77 75 bounds = new DoubleMatrix(min.Count, 2);
Note: See TracChangeset
for help on using the changeset viewer.