Changeset 14768 for branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/EgoUtilities.cs
- Timestamp:
- 03/20/17 12:07:20 (8 years ago)
- Location:
- branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO
-
Property
svn:global-ignores
set to
obj
-
Property
svn:ignore
set to
HeuristicLab.Algorithms.EGO-3.4.csproj.user
Plugin.cs
-
Property
svn:global-ignores
set to
-
branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/EgoUtilities.cs
r14741 r14768 52 52 53 53 public static ResultCollection SyncRunSubAlgorithm(IAlgorithm alg, int random) { 54 55 if (alg.Parameters.ContainsKey("SetSeedRandomly") && alg.Parameters.ContainsKey("Seed")) { 56 var setSeed = alg.Parameters["SetSeedRandomly"].ActualValue as BoolValue; 57 var seed = alg.Parameters["Seed"].ActualValue as IntValue; 58 if (seed == null || setSeed == null) throw new ArgumentException("wrong SeedParametertypes"); 59 setSeed.Value = false; 60 seed.Value = random; 61 62 } 63 64 54 65 EventWaitHandle trigger = new AutoResetEvent(false); 55 66 Exception ex = null; … … 103 114 return new Dataset(names.Concat(new[] { "output" }).ToArray(), data); 104 115 } 116 public static DoubleMatrix GetBoundingBox(IEnumerable<RealVector> vectors) { 117 DoubleMatrix res = null; 118 foreach (var vector in vectors) 119 if (res == null) { 120 res = new DoubleMatrix(vector.Length, 2); 121 for (var i = 0; i < vector.Length; i++) 122 res[i, 0] = res[i, 1] = vector[i]; 123 } else 124 for (var i = 0; i < vector.Length; i++) { 125 res[i, 0] = Math.Min(vector[i], res[i, 0]); 126 res[i, 1] = Math.Max(vector[i], res[i, 1]); 127 } 128 return res; 129 } 105 130 } 106 131 }
Note: See TracChangeset
for help on using the changeset viewer.