Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/08/09 12:48:18 (16 years ago)
Author:
gkronber
Message:

Merged change sets from CEDMA branch to trunk:

Location:
trunk/sources/HeuristicLab.DataAnalysis
Files:
3 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.DataAnalysis/Dataset.cs

    r534 r1287  
    5252    public int Columns {
    5353      get { return columns; }
    54       set { columns = value; }
     54      set {
     55        columns = value;
     56        if (variableNames == null || variableNames.Length != columns) {
     57          variableNames = new string[columns];
     58        }
     59      }
    5560    }
    5661
     
    9095
    9196    private string[] variableNames;
    92     public string[] VariableNames {
    93       get { return variableNames; }
    94       set { variableNames = value; }
    95     }
    9697
    9798    public Dataset() {
    9899      Name = "-";
    99       VariableNames = new string[] { "Var0" };
     100      variableNames = new string[] { "Var0" };
    100101      Columns = 1;
    101102      Rows = 1;
     
    114115      }
    115116    }
     117
     118    public string GetVariableName(int variableIndex) {
     119      return variableNames[variableIndex];
     120    }
     121
     122    public void SetVariableName(int variableIndex, string name) {
     123      variableNames[variableIndex] = name;
     124    }
     125
    116126
    117127    public override IView CreateView() {
     
    128138      clone.Samples = cloneSamples;
    129139      clone.Name = Name;
    130       clone.VariableNames = new string[VariableNames.Length];
    131       Array.Copy(VariableNames, clone.VariableNames, VariableNames.Length);
     140      clone.variableNames = new string[variableNames.Length];
     141      Array.Copy(variableNames, clone.variableNames, variableNames.Length);
    132142      Array.Copy(scalingFactor, clone.scalingFactor, columns);
    133143      Array.Copy(scalingOffset, clone.scalingOffset, columns);
     
    165175      columns = int.Parse(node.Attributes["Dimension2"].Value, CultureInfo.InvariantCulture.NumberFormat);
    166176
    167       VariableNames = ParseVariableNamesString(node.Attributes["VariableNames"].Value);
     177      variableNames = ParseVariableNamesString(node.Attributes["VariableNames"].Value);
    168178      if(node.Attributes["ScalingFactors"] != null)
    169179        scalingFactor = ParseDoubleString(node.Attributes["ScalingFactors"].Value);
  • trunk/sources/HeuristicLab.DataAnalysis/DatasetView.cs

    r473 r1287  
    135135
    136136    private string GetColumnName(int index) {
    137       if(Dataset.VariableNames.Length == dataGridView.Columns.Count) {
    138         return Dataset.VariableNames[index];
     137      if(Dataset.Columns == dataGridView.Columns.Count) {
     138        return Dataset.GetVariableName(index);
    139139      } else {
    140140        return "Var " + index;
  • trunk/sources/HeuristicLab.DataAnalysis/HeuristicLab.DataAnalysis.csproj

    r894 r1287  
    7171    <Compile Include="Dataset.cs" />
    7272    <Compile Include="DatasetParser.cs" />
     73    <Compile Include="DatasetShuffler.cs" />
    7374    <Compile Include="DatasetView.cs">
    7475      <SubType>UserControl</SubType>
     
    9798      <Name>HeuristicLab.Data</Name>
    9899    </ProjectReference>
     100    <ProjectReference Include="..\HeuristicLab.Operators\HeuristicLab.Operators.csproj">
     101      <Project>{A9983BA2-B3B2-475E-8E2C-62050B71D1C5}</Project>
     102      <Name>HeuristicLab.Operators</Name>
     103    </ProjectReference>
    99104    <ProjectReference Include="..\HeuristicLab.PluginInfrastructure\HeuristicLab.PluginInfrastructure.csproj">
    100105      <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
    101106      <Name>HeuristicLab.PluginInfrastructure</Name>
     107    </ProjectReference>
     108    <ProjectReference Include="..\HeuristicLab.Random\HeuristicLab.Random.csproj">
     109      <Project>{47019A74-F7F7-482E-83AA-D3F4F777E879}</Project>
     110      <Name>HeuristicLab.Random</Name>
    102111    </ProjectReference>
    103112  </ItemGroup>
Note: See TracChangeset for help on using the changeset viewer.