Free cookie consent management tool by TermsFeed Policy Generator

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

Merged change sets from CEDMA branch to trunk:

File:
1 edited

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);
Note: See TracChangeset for help on using the changeset viewer.