Changeset 11205 for branches/HiveStatistics/sources/HeuristicLab.Data
- Timestamp:
- 07/18/14 13:44:53 (10 years ago)
- Location:
- branches/HiveStatistics/sources
- Files:
-
- 35 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveStatistics/sources
- Property svn:ignore
-
old new 8 8 FxCopResults.txt 9 9 Google.ProtocolBuffers-0.9.1.dll 10 Google.ProtocolBuffers-2.4.1.473.dll 10 11 HeuristicLab 3.3.5.1.ReSharper.user 11 12 HeuristicLab 3.3.6.0.ReSharper.user 12 13 HeuristicLab.4.5.resharper.user 13 14 HeuristicLab.ExtLibs.6.0.ReSharper.user 15 HeuristicLab.Scripting.Development 14 16 HeuristicLab.resharper.user 15 17 ProtoGen.exe … … 17 19 _ReSharper.HeuristicLab 18 20 _ReSharper.HeuristicLab 3.3 21 _ReSharper.HeuristicLab 3.3 Tests 19 22 _ReSharper.HeuristicLab.ExtLibs 20 23 bin 21 24 protoc.exe 22 _ReSharper.HeuristicLab 3.3 Tests23 Google.ProtocolBuffers-2.4.1.473.dll
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/HiveStatistics/sources/HeuristicLab.Data/3.3
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
/branches/HLScript/HeuristicLab.Data/3.3 merged eligible /stable/HeuristicLab.Data/3.3 merged eligible /trunk/sources/HeuristicLab.Data/3.3 merged eligible /branches/1721-RandomForestPersistence/HeuristicLab.Data/3.3 10321-10322 /branches/2135-PercentValue/3.3 10325-10447 /branches/Algorithms.GradientDescent/HeuristicLab.Data/3.3 5516-5520 /branches/Benchmarking/sources/HeuristicLab.Data/3.3 6917-7005 /branches/CloningRefactoring/HeuristicLab.Data/3.3 4656-4721 /branches/DataAnalysis Refactoring/HeuristicLab.Data/3.3 5471-5808 /branches/DataAnalysis SolutionEnsembles/HeuristicLab.Data/3.3 5815-6180 /branches/DataAnalysis/HeuristicLab.Data/3.3 4458-4459,4462,4464 /branches/DataPreprocessing/HeuristicLab.Data/3.3 10085-11101 /branches/GP.Grammar.Editor/HeuristicLab.Data/3.3 6284-6795 /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Data/3.3 5060 /branches/HeuristicLab.Data Path DataTypes/HeuristicLab.Data/3.3 9668-9706 /branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Data/3.3 6123-9799 /branches/LogResidualEvaluator/HeuristicLab.Data/3.3 10202-10483 /branches/NET40/sources/HeuristicLab.Data/3.3 5138-5162 /branches/ParallelEngine/HeuristicLab.Data/3.3 5175-5192 /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Data/3.3 7568-7810 /branches/QAPAlgorithms/HeuristicLab.Data/3.3 6350-6627 /branches/Restructure trunk solution/HeuristicLab.Data/3.3 6828 /branches/RuntimeOptimizer/HeuristicLab.Data/3.3 8943-9078 /branches/ScatterSearch (trunk integration)/HeuristicLab.Data/3.3 7787-8333 /branches/SlaveShutdown/HeuristicLab.Data/3.3 8944-8956 /branches/SpectralKernelForGaussianProcesses/HeuristicLab.Data/3.3 10204-10479 /branches/SuccessProgressAnalysis/HeuristicLab.Data/3.3 5370-5682 /branches/Trunk/HeuristicLab.Data/3.3 6829-6865 /branches/UnloadJobs/HeuristicLab.Data/3.3 9168-9215 /branches/VNS/HeuristicLab.Data/3.3 5594-5752 /branches/histogram/HeuristicLab.Data/3.3 5959-6341
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
-
branches/HiveStatistics/sources/HeuristicLab.Data/3.3/BoolArray.cs
r11203 r11205 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HiveStatistics/sources/HeuristicLab.Data/3.3/BoolMatrix.cs
r11203 r11205 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HiveStatistics/sources/HeuristicLab.Data/3.3/BoolValue.cs
r11203 r11205 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HiveStatistics/sources/HeuristicLab.Data/3.3/Comparison.cs
r11203 r11205 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HiveStatistics/sources/HeuristicLab.Data/3.3/ComparisonType.cs
r11203 r11205 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HiveStatistics/sources/HeuristicLab.Data/3.3/DateTimeValue.cs
r11203 r11205 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HiveStatistics/sources/HeuristicLab.Data/3.3/DoubleArray.cs
r11203 r11205 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HiveStatistics/sources/HeuristicLab.Data/3.3/DoubleMatrix.cs
r11203 r11205 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HiveStatistics/sources/HeuristicLab.Data/3.3/DoubleRange.cs
r11203 r11205 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HiveStatistics/sources/HeuristicLab.Data/3.3/DoubleValue.cs
r11203 r11205 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HiveStatistics/sources/HeuristicLab.Data/3.3/FormatPatterns.cs
r11203 r11205 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HiveStatistics/sources/HeuristicLab.Data/3.3/HeuristicLab.Data-3.3.csproj
r11203 r11205 117 117 <Compile Include="Comparison.cs" /> 118 118 <Compile Include="ComparisonType.cs" /> 119 <Compile Include="Path Types\DirectoryValue.cs" /> 120 <Compile Include="Path Types\FileValue.cs" /> 121 <Compile Include="Path Types\PathValue.cs" /> 122 <Compile Include="Path Types\TextFileValue.cs" /> 119 123 <Compile Include="PercentMatrix.cs" /> 120 124 <Compile Include="PercentArray.cs" /> … … 212 216 --> 213 217 <PropertyGroup> 214 <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)218 <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir) 215 219 set ProjectDir=$(ProjectDir) 216 220 set SolutionDir=$(SolutionDir) … … 219 223 call PreBuildEvent.cmd 220 224 </PreBuildEvent> 221 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">225 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' "> 222 226 export ProjectDir=$(ProjectDir) 223 227 export SolutionDir=$(SolutionDir) -
branches/HiveStatistics/sources/HeuristicLab.Data/3.3/IntArray.cs
r11203 r11205 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HiveStatistics/sources/HeuristicLab.Data/3.3/IntMatrix.cs
r11203 r11205 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HiveStatistics/sources/HeuristicLab.Data/3.3/IntRange.cs
r11203 r11205 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HiveStatistics/sources/HeuristicLab.Data/3.3/IntValue.cs
r11203 r11205 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HiveStatistics/sources/HeuristicLab.Data/3.3/Interfaces/IStringConvertibleArray.cs
r11203 r11205 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 21 21 22 22 using System; 23 using System.Collections.Generic; 23 24 using HeuristicLab.Common; 24 25 … … 26 27 public interface IStringConvertibleArray : IContent { 27 28 int Length { get; set; } 29 IEnumerable<string> ElementNames { get; set; } 28 30 29 31 bool ReadOnly { get; } … … 33 35 bool SetValue(string value, int index); 34 36 37 event EventHandler ElementNamesChanged; 35 38 event EventHandler<EventArgs<int>> ItemChanged; 36 39 event EventHandler Reset; -
branches/HiveStatistics/sources/HeuristicLab.Data/3.3/Interfaces/IStringConvertibleMatrix.cs
r11203 r11205 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HiveStatistics/sources/HeuristicLab.Data/3.3/Interfaces/IStringConvertibleValue.cs
r11203 r11205 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HiveStatistics/sources/HeuristicLab.Data/3.3/Interfaces/IStringConvertibleValueTuple.cs
r11203 r11205 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HiveStatistics/sources/HeuristicLab.Data/3.3/PercentArray.cs
r11203 r11205 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HiveStatistics/sources/HeuristicLab.Data/3.3/PercentMatrix.cs
r11203 r11205 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HiveStatistics/sources/HeuristicLab.Data/3.3/PercentValue.cs
r11203 r11205 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 20 20 #endregion 21 21 22 using System; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; … … 28 29 [StorableClass] 29 30 public class PercentValue : DoubleValue { 31 [Storable(DefaultValue = false)] 32 private bool restrictToUnitInterval = false; 33 public bool RestrictToUnitInterval { 34 get { return restrictToUnitInterval; } 35 } 36 37 public override double Value { 38 get { return base.Value; } 39 set { 40 if (restrictToUnitInterval && (value < 0 || value > 1)) 41 throw new ArgumentException("Value must lie in the interval [0,1]."); 42 base.Value = value; 43 } 44 } 45 30 46 [StorableConstructor] 31 47 protected PercentValue(bool deserializing) : base(deserializing) { } 32 48 protected PercentValue(PercentValue original, Cloner cloner) 33 49 : base(original, cloner) { 50 restrictToUnitInterval = original.restrictToUnitInterval; 34 51 } 35 52 public PercentValue() : base() { } 36 53 public PercentValue(double value) : base(value) { } 54 55 public PercentValue(double value, bool restrictToUnitInterval) 56 : base() { 57 this.restrictToUnitInterval = restrictToUnitInterval; 58 if (restrictToUnitInterval && (value < 0 || value > 1)) 59 throw new ArgumentException("Value must lie in the interval [0,1]."); 60 this.value = value; 61 } 37 62 38 63 public override IDeepCloneable Clone(Cloner cloner) { … … 46 71 protected override bool Validate(string value, out string errorMessage) { 47 72 value = value.Replace("%", " "); 48 return base.Validate(value, out errorMessage); 73 bool valid = base.Validate(value, out errorMessage); 74 if (!restrictToUnitInterval || !valid) return valid; 75 76 double val = double.Parse(value); 77 if (val < 0 || val > 1) { 78 errorMessage = "Value must lie in the interval [0,1]."; 79 return false; 80 } 81 return true; 49 82 } 83 50 84 protected override string GetValue() { 51 85 return Value.ToString("#0.#################### %"); // percent format -
branches/HiveStatistics/sources/HeuristicLab.Data/3.3/Plugin.cs.frame
r11203 r11205 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 26 26 /// Plugin class for HeuristicLab.Data plugin. 27 27 /// </summary> 28 [Plugin("HeuristicLab.Data", "3.3. 7.$WCREV$")]28 [Plugin("HeuristicLab.Data", "3.3.10.$WCREV$")] 29 29 [PluginFile("HeuristicLab.Data-3.3.dll", PluginFileType.Assembly)] 30 30 [PluginDependency("HeuristicLab.Common", "3.3")] -
branches/HiveStatistics/sources/HeuristicLab.Data/3.3/Properties/AssemblyInfo.cs.frame
r11203 r11205 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 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 2HEAL")]34 [assembly: AssemblyCopyright("(c) 2002-2014 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. 7.$WCREV$")]56 [assembly: AssemblyFileVersion("3.3.10.$WCREV$")] -
branches/HiveStatistics/sources/HeuristicLab.Data/3.3/StringArray.cs
r11203 r11205 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 43 43 protected string[] array; 44 44 45 [Storable] 46 protected List<string> elementNames; 47 public virtual IEnumerable<string> ElementNames { 48 get { return this.elementNames; } 49 set { 50 if (ReadOnly) throw new NotSupportedException("ElementNames cannot be set. ValueTypeArray is read-only."); 51 if (value == null || !value.Any()) 52 elementNames = new List<string>(); 53 else if (value.Count() > Length) 54 throw new ArgumentException("The number of element names must not exceed the array length."); 55 else 56 elementNames = new List<string>(value); 57 OnElementNamesChanged(); 58 } 59 } 60 45 61 public virtual int Length { 46 62 get { return array.Length; } … … 49 65 if (value != Length) { 50 66 Array.Resize<string>(ref array, value); 67 while (elementNames.Count > value) 68 elementNames.RemoveAt(elementNames.Count - 1); 69 OnElementNamesChanged(); 51 70 OnReset(); 52 71 } … … 72 91 } 73 92 93 [StorableHook(HookType.AfterDeserialization)] 94 private void AfterDeserialization() { 95 if (elementNames == null) { elementNames = new List<string>(); } 96 } 97 74 98 [StorableConstructor] 75 99 protected StringArray(bool deserializing) : base(deserializing) { } … … 78 102 this.array = (string[])original.array.Clone(); 79 103 this.readOnly = original.readOnly; 104 this.elementNames = new List<string>(original.elementNames); 80 105 } 81 106 public StringArray() { 82 107 array = new string[0]; 83 108 readOnly = false; 109 elementNames = new List<string>(); 84 110 } 85 111 public StringArray(int length) { … … 88 114 array[i] = string.Empty; 89 115 readOnly = false; 116 elementNames = new List<string>(); 90 117 } 91 118 public StringArray(string[] elements) { … … 95 122 array[i] = elements[i] == null ? string.Empty : elements[i]; 96 123 readOnly = false; 124 elementNames = new List<string>(); 97 125 } 98 126 … … 153 181 } 154 182 183 public event EventHandler ElementNamesChanged; 184 protected virtual void OnElementNamesChanged() { 185 EventHandler handler = ElementNamesChanged; 186 if (handler != null) 187 handler(this, EventArgs.Empty); 188 } 189 155 190 public event EventHandler<EventArgs<int>> ItemChanged; 156 191 protected virtual void OnItemChanged(int index) { -
branches/HiveStatistics/sources/HeuristicLab.Data/3.3/StringConvertibleValueTuple.cs
r11203 r11205 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HiveStatistics/sources/HeuristicLab.Data/3.3/StringMatrix.cs
r11203 r11205 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HiveStatistics/sources/HeuristicLab.Data/3.3/StringValue.cs
r11203 r11205 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HiveStatistics/sources/HeuristicLab.Data/3.3/TimeSpanValue.cs
r11203 r11205 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HiveStatistics/sources/HeuristicLab.Data/3.3/ValueTypeArray.cs
r11203 r11205 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 43 43 protected T[] array; 44 44 45 [Storable] 46 protected List<string> elementNames; 47 public virtual IEnumerable<string> ElementNames { 48 get { return this.elementNames; } 49 set { 50 if (ReadOnly) throw new NotSupportedException("ElementNames cannot be set. ValueTypeArray is read-only."); 51 if (value == null || !value.Any()) 52 elementNames = new List<string>(); 53 else if (value.Count() > Length) 54 throw new ArgumentException("The number of element names must not exceed the array length."); 55 else 56 elementNames = new List<string>(value); 57 OnElementNamesChanged(); 58 } 59 } 60 45 61 public virtual int Length { 46 62 get { return array.Length; } … … 51 67 if (value != Length) { 52 68 Array.Resize<T>(ref array, value); 69 while (elementNames.Count > value) 70 elementNames.RemoveAt(elementNames.Count - 1); 71 OnElementNamesChanged(); 53 72 OnReset(); 54 73 } … … 73 92 } 74 93 94 [StorableHook(HookType.AfterDeserialization)] 95 private void AfterDeserialization() { 96 if (elementNames == null) { elementNames = new List<string>(); } 97 } 98 75 99 [StorableConstructor] 76 100 protected ValueTypeArray(bool deserializing) : base(deserializing) { } … … 79 103 this.array = (T[])original.array.Clone(); 80 104 this.readOnly = original.readOnly; 105 this.elementNames = new List<string>(original.elementNames); 81 106 } 82 107 protected ValueTypeArray() { 83 108 array = new T[0]; 84 109 readOnly = false; 110 elementNames = new List<string>(); 85 111 } 86 112 protected ValueTypeArray(int length) { 87 113 array = new T[length]; 88 114 readOnly = false; 115 elementNames = new List<string>(); 89 116 } 90 117 protected ValueTypeArray(T[] elements) { … … 92 119 array = (T[])elements.Clone(); 93 120 readOnly = false; 121 elementNames = new List<string>(); 94 122 } 95 123 … … 125 153 } 126 154 155 public event EventHandler ElementNamesChanged; 156 protected virtual void OnElementNamesChanged() { 157 EventHandler handler = ElementNamesChanged; 158 if (handler != null) 159 handler(this, EventArgs.Empty); 160 } 161 127 162 public event EventHandler<EventArgs<int>> ItemChanged; 128 163 protected virtual void OnItemChanged(int index) { -
branches/HiveStatistics/sources/HeuristicLab.Data/3.3/ValueTypeMatrix.cs
r11203 r11205 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HiveStatistics/sources/HeuristicLab.Data/3.3/ValueTypeValue.cs
r11203 r11205 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 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.