Changeset 15281 for branches/Async/HeuristicLab.Common
- Timestamp:
- 07/23/17 11:17:18 (7 years ago)
- Location:
- branches/Async
- Files:
-
- 1 deleted
- 27 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/Async
- Property svn:ignore
-
old new 24 24 protoc.exe 25 25 obj 26 .vs
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/Async/HeuristicLab.Common/3.3/ArrayExtensions.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Common/3.3/CancelEventArgs.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Common/3.3/Cloner.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Common/3.3/ColorGradient.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Common/3.3/Constants.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Common/3.3/Content/ContentManager.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Common/3.3/Content/IContent.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Common/3.3/Content/IStorableContent.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Common/3.3/DeepCloneable.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Common/3.3/DoubleExtensions.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Common/3.3/EnumerableExtensions.cs
r15280 r15281 120 120 121 121 for (int i = 0; i < length; ++i) { 122 yield return range.Select(x => elements[x]) ;122 yield return range.Select(x => elements[x]).ToArray(); 123 123 124 124 if (i == length - 1) break; … … 150 150 if (k > n - k) 151 151 k = n - k; 152 long r = 1; 153 for (long d = 1; d <= k; d++) { 154 r *= n--; 155 r /= d; 152 153 // enable explicit overflow checking for very large coefficients 154 checked { 155 long r = 1; 156 for (long d = 1; d <= k; d++) { 157 r *= n--; 158 r /= d; 159 } 160 return r; 156 161 } 157 return r;158 162 } 159 163 } -
branches/Async/HeuristicLab.Common/3.3/EventArgs.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Common/3.3/HeuristicLab.Common-3.3.csproj
r15232 r15281 132 132 <Compile Include="Constants.cs" /> 133 133 <Compile Include="ArrayExtensions.cs" /> 134 <Compile Include="Statistics\EmpiricalCumulativeDistributionFunction.cs" /> 134 135 <Compile Include="ListExtensions.cs" /> 135 136 <Compile Include="Point2D.cs" /> … … 140 141 <Compile Include="DeepCloneable.cs" /> 141 142 <Compile Include="Content\IContent.cs" /> 142 <Compile Include=" EnumerableStatisticExtensions.cs" />143 <Compile Include="Statistics\EnumerableStatisticExtensions.cs" /> 143 144 <Compile Include="IDeepCloneable.cs" /> 144 145 <Compile Include="Plugin.cs" /> -
branches/Async/HeuristicLab.Common/3.3/IDeepCloneable.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Common/3.3/ListExtensions.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Common/3.3/MatrixExtensions.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 20 20 #endregion 21 21 22 using System.Diagnostics.Contracts; 23 22 24 namespace HeuristicLab.Common { 23 25 public static class MatrixExtensions { … … 35 37 return result; 36 38 } 39 40 /// <summary> 41 /// Concatenates matrices vertically. 42 /// A B 43 /// 1 2 9 8 44 /// 3 4 7 6 45 /// 46 /// VertCat(A, B) 47 /// 1 2 48 /// 3 4 49 /// 9 8 50 /// 7 6 51 /// </summary> 52 /// <typeparam name="T"></typeparam> 53 /// <param name="a"></param> 54 /// <param name="b"></param> 55 /// <returns>A new matrix with the number of rows = a.GetLength(0) + b.GetLength(0)</returns> 56 public static T[,] VertCat<T>(this T[,] a, T[,] b) { 57 Contract.Assert(a.GetLength(1) == b.GetLength(1)); 58 var aLen = a.GetLength(0); 59 var bLen = b.GetLength(0); 60 var result = new T[aLen + bLen, a.GetLength(1)]; 61 for (int i = 0; i < aLen; i++) 62 for (int j = 0; j < a.GetLength(1); j++) 63 result[i, j] = a[i, j]; 64 for (int i = 0; i < bLen; i++) 65 for (int j = 0; j < b.GetLength(1); j++) 66 result[i + aLen, j] = b[i, j]; 67 68 return result; 69 } 70 71 /// <summary> 72 /// Concatenates matrices horizontally. 73 /// A B 74 /// 1 2 9 8 75 /// 3 4 7 6 76 /// 77 /// HorzCat(A, B) 78 /// 1 2 9 8 79 /// 3 4 7 6 80 /// </summary> 81 /// <typeparam name="T"></typeparam> 82 /// <param name="a"></param> 83 /// <param name="b"></param> 84 /// <returns>A new matrix with the number of columns = a.GetLength(1) + b.GetLength(1)</returns> 85 public static T[,] HorzCat<T>(this T[,] a, T[,] b) { 86 Contract.Assert(a.GetLength(0) == b.GetLength(0)); 87 var aLen = a.GetLength(1); 88 var bLen = b.GetLength(1); 89 var result = new T[a.GetLength(0), aLen + bLen]; 90 for (int i = 0; i < a.GetLength(0); i++) 91 for (int j = 0; j < aLen; j++) 92 result[i, j] = a[i, j]; 93 for (int i = 0; i < a.GetLength(0); i++) 94 for (int j = 0; j < bLen; j++) 95 result[i, j + aLen] = b[i, j]; 96 return result; 97 } 37 98 } 38 99 } -
branches/Async/HeuristicLab.Common/3.3/NaturalStringComparer.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Common/3.3/ObjectExtensions.cs
r15280 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 30 30 31 31 namespace HeuristicLab.Common { 32 33 [AttributeUsage(AttributeTargets.Field)] 34 // this attribute can be used to mark fields that should be excluded from object graph traversal 35 public class ExcludeFromObjectGraphTraversalAttribute : Attribute { 36 } 37 32 38 public static class ObjectExtensions { 33 39 public static IEnumerable<T> ToEnumerable<T>(this T obj) { … … 63 69 /// * System.Delegate 64 70 /// * System.Reflection.Pointer 65 /// * System.RuntimeType66 71 /// * Primitives (Boolean, Byte, SByte, Int16, UInt16, Int32, UInt32, Int64, UInt64, IntPtr, UIntPtr, Char, Double, Single) 67 72 /// * string, decimal, DateTime … … 80 85 typeof(Pointer).IsAssignableFrom(type) || 81 86 type.Namespace == "System.Reflection.Emit" || 82 type.Assembly.GetName().Name == "System.Runtime.Serialization" ||83 typeof(TypeInfo).IsAssignableFrom(type) ||84 87 (type.HasElementType && ExcludeType(type.GetElementType())); 85 88 } … … 116 119 } 117 120 } else { 118 if (!fieldInfos.ContainsKey(type)) 119 fieldInfos[type] = type.GetAllFields().ToArray(); 120 foreach (FieldInfo f in fieldInfos[type]) { 121 FieldInfo[] fieldInfo; 122 if (!fieldInfos.TryGetValue(type, out fieldInfo)) { 123 fieldInfo = type.GetAllFields() 124 .Where(fi => !Attribute.IsDefined(fi, typeof(ExcludeFromObjectGraphTraversalAttribute))) 125 .ToArray(); 126 fieldInfos.Add(type, fieldInfo); 127 } 128 foreach (FieldInfo f in fieldInfo) { 121 129 if (excludeStaticMembers && f.IsStatic) continue; 122 130 object fieldValue; 123 131 try { 124 132 fieldValue = f.GetValue(obj); 125 } 126 catch (SecurityException) { 133 } catch (SecurityException) { 127 134 continue; 128 135 } -
branches/Async/HeuristicLab.Common/3.3/Plugin.cs.frame
r13321 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 29 29 /// Plugin class for HeuristicLab.Common plugin. 30 30 /// </summary> 31 [Plugin("HeuristicLab.Common", "3.3.1 3.$WCREV$")]31 [Plugin("HeuristicLab.Common", "3.3.14.$WCREV$")] 32 32 [PluginFile("HeuristicLab.Common-3.3.dll", PluginFileType.Assembly)] 33 33 public class HeuristicLabCommonPlugin : PluginBase { -
branches/Async/HeuristicLab.Common/3.3/Point2D.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 26 26 namespace HeuristicLab.Common { 27 27 [Serializable] 28 public struct Point2D<T> where T : struct {28 public struct Point2D<T> where T : struct, IEquatable<T> { 29 29 public static readonly Point2D<T> Empty = new Point2D<T>(); 30 30 … … 38 38 } 39 39 40 private object tag; 41 public object Tag { 42 get { return tag; } 43 } 44 40 45 [Browsable(false)] 41 46 public bool IsEmpty { … … 43 48 } 44 49 45 public Point2D(T x, T y ) {50 public Point2D(T x, T y, object tag = null) { 46 51 this.x = x; 47 52 this.y = y; 53 this.tag = tag; 54 } 55 56 public static Point2D<T> Create(T x, T y, object tag = null) { 57 return new Point2D<T>(x, y, tag); 48 58 } 49 59 50 60 public static bool operator ==(Point2D<T> left, Point2D<T> right) { 51 return left.x.Equals(right.x) && left.y.Equals(right.y) ;61 return left.x.Equals(right.x) && left.y.Equals(right.y) && left.tag == right.tag; 52 62 } 53 63 public static bool operator !=(Point2D<T> left, Point2D<T> right) { … … 59 69 return false; 60 70 Point2D<T> point = (Point2D<T>)obj; 61 return x.Equals(point.x) && y.Equals(point.y) && GetType().Equals(point.GetType()); 71 return GetType() == point.GetType() && x.Equals(point.x) && y.Equals(point.y) && 72 ((tag != null && tag.Equals(point.tag)) || tag == point.tag); 62 73 } 63 74 public override int GetHashCode() { -
branches/Async/HeuristicLab.Common/3.3/Properties/AssemblyInfo.cs.frame
r13321 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 32 32 [assembly: AssemblyCompany("")] 33 33 [assembly: AssemblyProduct("HeuristicLab")] 34 [assembly: AssemblyCopyright("(c) 2002-201 5HEAL")]34 [assembly: AssemblyCopyright("(c) 2002-2016 HEAL")] 35 35 [assembly: AssemblyTrademark("")] 36 36 [assembly: AssemblyCulture("")] … … 54 54 // by using the '*' as shown below: 55 55 [assembly: AssemblyVersion("3.3.0.0")] 56 [assembly: AssemblyFileVersion("3.3.1 3.$WCREV$")]56 [assembly: AssemblyFileVersion("3.3.14.$WCREV$")] -
branches/Async/HeuristicLab.Common/3.3/ReferenceEqualityComparer.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Common/3.3/SequenceGenerator.cs
r12292 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Common/3.3/TimeSpanHelper.cs
r12626 r15281 2 2 3 3 /* HeuristicLab 4 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)4 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 5 5 * 6 6 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Common/3.3/TypeEqualityComparer.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Common/3.3/TypeExtensions.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab.
Note: See TracChangeset
for help on using the changeset viewer.