Changeset 14751 for branches/symbreg-factors-2650/HeuristicLab.Data/3.3
- Timestamp:
- 03/16/17 07:56:01 (7 years ago)
- Location:
- branches/symbreg-factors-2650
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/symbreg-factors-2650
-
branches/symbreg-factors-2650/HeuristicLab.Data/3.3
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Data/3.3 merged: 14597,14672
- Property svn:mergeinfo changed
-
branches/symbreg-factors-2650/HeuristicLab.Data/3.3/EnumValue.cs
r14185 r14751 52 52 private EnumValue(EnumValue<T> original, Cloner cloner) 53 53 : base(original, cloner) { 54 this.value = original.value;55 this.readOnly = original.readOnly;56 54 } 57 55 … … 64 62 } 65 63 } 64 65 public static class EnumHelper { 66 public static T SetFlag<T>(this Enum value, T flag, bool set) { 67 var baseType = Enum.GetUnderlyingType(value.GetType()); 68 dynamic valueAsBase = Convert.ChangeType(value, baseType); 69 dynamic flagAsBase = Convert.ChangeType(flag, baseType); 70 if (set) 71 valueAsBase |= flagAsBase; 72 else 73 valueAsBase &= ~flagAsBase; 74 return (T)valueAsBase; 75 } 76 } 66 77 } -
branches/symbreg-factors-2650/HeuristicLab.Data/3.3/HeuristicLab.Data-3.3.csproj
r13695 r14751 108 108 </PropertyGroup> 109 109 <ItemGroup> 110 <Reference Include="Microsoft.CSharp" /> 110 111 <Reference Include="System" /> 111 112 <Reference Include="System.Core"> -
branches/symbreg-factors-2650/HeuristicLab.Data/3.3/ValueTypeMatrix.cs
r14185 r14751 201 201 } 202 202 203 public virtual IEnumerable<T> GetRow(int row) { 204 for (var col = 0; col < Columns; col++) { 205 yield return matrix[row, col]; 206 } 207 } 208 209 public virtual IEnumerable<T> GetColumn(int col) { 210 for (var row = 0; row < Rows; row++) { 211 yield return matrix[row, col]; 212 } 213 } 214 203 215 public override string ToString() { 204 216 if (matrix.Length == 0) return "[]";
Note: See TracChangeset
for help on using the changeset viewer.