Free cookie consent management tool by TermsFeed Policy Generator

Changeset 344 for trunk


Ignore:
Timestamp:
06/26/08 14:59:06 (16 years ago)
Author:
gkronber
Message:

merged changes r338 r339 r340 r341 r342 r343 from the ticket-specific branch into the main trunk

Location:
trunk/sources
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Constraints/DoubleBoundedConstraint.cs

    r138 r344  
    136136      XmlNode node = base.GetXmlNode(name, document, persistedObjects);
    137137      XmlAttribute lb = document.CreateAttribute("LowerBound");
    138       lb.Value = LowerBound.ToString(CultureInfo.InvariantCulture);
     138      lb.Value = LowerBound.ToString("r", CultureInfo.InvariantCulture);
    139139      XmlAttribute lbi = document.CreateAttribute("LowerBoundIncluded");
    140140      lbi.Value = lowerBoundIncluded.ToString();
     
    142142      lbe.Value = lowerBoundEnabled.ToString();
    143143      XmlAttribute ub = document.CreateAttribute("UpperBound");
    144       ub.Value = upperBound.ToString(CultureInfo.InvariantCulture);
     144      ub.Value = upperBound.ToString("r", CultureInfo.InvariantCulture);
    145145      XmlAttribute ubi = document.CreateAttribute("UpperBoundIncluded");
    146146      ubi.Value = upperBoundIncluded.ToString();
  • trunk/sources/HeuristicLab.Constraints/DoubleBoundedConstraintView.cs

    r2 r344  
    6969        ubEnabledCheckBox.Enabled = false;
    7070      } else {
    71         lbTextBox.Text = DoubleBoundedConstraint.LowerBound + "";
     71        lbTextBox.Text = DoubleBoundedConstraint.LowerBound.ToString("r");
    7272        lbTextBox.Enabled = DoubleBoundedConstraint.LowerBoundEnabled;
    7373        lbIncludedCheckBox.Checked = DoubleBoundedConstraint.LowerBoundIncluded;
     
    7676        lbEnabledCheckBox.Enabled = true;
    7777
    78         ubTextBox.Text = DoubleBoundedConstraint.UpperBound + "";
     78        ubTextBox.Text = DoubleBoundedConstraint.UpperBound.ToString("r");
    7979        ubTextBox.Enabled = DoubleBoundedConstraint.UpperBoundEnabled;
    8080        ubIncludedCheckBox.Checked = DoubleBoundedConstraint.UpperBoundIncluded;
  • trunk/sources/HeuristicLab.Data/ArrayDataBaseView.Designer.cs

    r2 r344  
    105105    private System.Windows.Forms.Label sizeLabel;
    106106    private System.Windows.Forms.TextBox lengthTextBox;
    107     private System.Windows.Forms.DataGridView dataGridView;
     107    protected System.Windows.Forms.DataGridView dataGridView;
    108108  }
    109109}
  • trunk/sources/HeuristicLab.Data/ArrayDataBaseView.cs

    r2 r344  
    6464        dataGridView.RowCount = length;
    6565        for (int i = 0; i < length; i++) {
    66           dataGridView.Rows[i].Cells[0].Value = ArrayDataBase.Data.GetValue(i); ;
     66          dataGridView.Rows[i].Cells[0].Value = ArrayDataBase.Data.GetValue(i);
    6767        }
    6868      } else {
  • trunk/sources/HeuristicLab.Data/ConstrainedDoubleDataView.cs

    r2 r344  
    6262      } else {
    6363        dataTextBox.Enabled = true;
    64         dataTextBox.Text = ConstrainedDoubleData.ToString();
     64        dataTextBox.Text = ConstrainedDoubleData.Data.ToString("r");
    6565      }
    6666    }
  • trunk/sources/HeuristicLab.Data/DoubleArrayData.cs

    r2 r344  
    6565      for(int i = 0; i < Data.Length; i++) {
    6666        builder.Append(";");
    67         builder.Append(Data[i].ToString(format));
     67        builder.Append(Data[i].ToString("r", format));
    6868      }
    6969      if(builder.Length > 0)
  • trunk/sources/HeuristicLab.Data/DoubleArrayDataView.cs

    r2 r344  
    3737    public DoubleArrayDataView() {
    3838      InitializeComponent();
     39      // round-trip format for all cells
     40      dataGridView.DefaultCellStyle.Format = "r";
    3941    }
    4042    public DoubleArrayDataView(DoubleArrayData doubleArrayData)
  • trunk/sources/HeuristicLab.Data/DoubleData.cs

    r2 r344  
    5454    public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid,IStorable> persistedObjects) {
    5555      XmlNode node = base.GetXmlNode(name, document, persistedObjects);
    56       node.InnerText = Data.ToString(CultureInfo.InvariantCulture.NumberFormat);
     56      node.InnerText = Data.ToString("r", CultureInfo.InvariantCulture.NumberFormat);
    5757      return node;
    5858    }
  • trunk/sources/HeuristicLab.Data/DoubleDataView.cs

    r2 r344  
    5959      } else {
    6060        dataTextBox.Enabled = true;
    61         dataTextBox.Text = DoubleData.ToString();
     61        dataTextBox.Text = DoubleData.Data.ToString("r");
    6262      }
    6363    }
  • trunk/sources/HeuristicLab.Data/DoubleMatrixData.cs

    r2 r344  
    8181        for (int j = 0; j < Data.GetLength(1); j++) {
    8282          builder.Append(";");
    83           builder.Append(Data[i, j].ToString(format));
     83          builder.Append(Data[i, j].ToString("r", format));
    8484        }
    8585      }
  • trunk/sources/HeuristicLab.Data/DoubleMatrixDataView.cs

    r2 r344  
    3737    public DoubleMatrixDataView() {
    3838      InitializeComponent();
     39      // round-trip format for all cells
     40      dataGridView.DefaultCellStyle.Format = "r";
    3941    }
    4042    public DoubleMatrixDataView(DoubleMatrixData doubleMatrixData)
  • trunk/sources/HeuristicLab.Data/MatrixDataBaseView.Designer.cs

    r2 r344  
    132132    private System.Windows.Forms.Label rowsLabel;
    133133    private System.Windows.Forms.TextBox rowsTextBox;
    134     private System.Windows.Forms.DataGridView dataGridView;
     134    protected System.Windows.Forms.DataGridView dataGridView;
    135135    private System.Windows.Forms.TextBox columnsTextBox;
    136136    private System.Windows.Forms.Label columnsLabel;
  • trunk/sources/HeuristicLab.DataAnalysis/Dataset.cs

    r333 r344  
    201201        for(int column = 0; column < columns; column++) {
    202202          builder.Append(";");
    203           builder.Append(samples[row * columns + column].ToString(format));
     203          builder.Append(samples[row * columns + column].ToString("r", format));
    204204        }
    205205      }
     
    222222      string s = "";
    223223      for(int i = 0; i < xs.Length; i++) {
    224         s += xs[i].ToString(CultureInfo.InvariantCulture) + "; ";
     224        s += xs[i].ToString("r", CultureInfo.InvariantCulture) + "; ";
    225225      }
    226226
  • trunk/sources/HeuristicLab.DataAnalysis/DatasetView.cs

    r312 r344  
    4444          { manipulator.Execute(Dataset); }));
    4545      }
     46     
     47      // format all cells with the round-trip formatter to make sure that values that are exported and imported to
     48      // another C# app (HL2) have the same numeric value
     49      dataGridView.DefaultCellStyle.Format = "r";
    4650    }
    4751
  • trunk/sources/HeuristicLab.DataAnalysis/ManualScalingControl.cs

    r312 r344  
    1818      cancelButton.Visible = editingAllowed;
    1919      cancelButton.Text = "Cancel";
     20
     21      // format all cells with the round-trip formatter to make sure that exported and imported values have
     22      // the same numeric value
     23      dataGridView.DefaultCellStyle.Format = "r";
    2024    }
    2125
  • trunk/sources/HeuristicLab.DataAnalysis/SvmExporter.cs

    r234 r344  
    109109        StreamWriter writer = new StreamWriter(filename);
    110110        for(int i = 0; i < dataset.Rows; i++) {
    111           writer.Write(dataset.GetValue(i, targetColumn).ToString(CultureInfo.InvariantCulture) + "\t");
     111          writer.Write(dataset.GetValue(i, targetColumn).ToString("r", CultureInfo.InvariantCulture) + "\t");
    112112          for(int j = 0; j < dataset.Columns; j++) {
    113113            if(j != targetColumn) {
    114114              double val = dataset.GetValue(i, j);
    115115              if(!double.IsInfinity(val) && !double.IsNaN(val))
    116                 writer.Write((j + 1) + ":" + val.ToString(CultureInfo.InvariantCulture) + "\t");
     116                writer.Write((j + 1) + ":" + val.ToString("r", CultureInfo.InvariantCulture) + "\t");
    117117            }
    118118          }
  • trunk/sources/HeuristicLab.Functions/BakedFunctionTree.cs

    r324 r344  
    286286        if(f.data.Count > 0) {
    287287          XmlAttribute dataAttribute = document.CreateAttribute("Data");
    288           dataAttribute.Value = GetString<double>(f.data);
     288          dataAttribute.Value = GetString(f.data);
    289289          entryNode.Attributes.Append(dataAttribute);
    290290        }
     
    311311    }
    312312
    313     private string GetString<T>(IEnumerable<T> xs) where T : IConvertible {
     313    private string GetString(IEnumerable<double> xs) {
    314314      StringBuilder builder = new StringBuilder();
    315       foreach(T x in xs) {
    316         builder.Append(x.ToString(CultureInfo.InvariantCulture) + "; ");
     315      foreach(double x in xs) {
     316        builder.Append(x.ToString("r", CultureInfo.InvariantCulture) + "; ");
    317317      }
    318318      if(builder.Length > 0) builder.Remove(builder.Length - 2, 2);
  • trunk/sources/HeuristicLab.Functions/ModelAnalyzerExporter.cs

    r310 r344  
    5454    public void Visit(Constant constant) {
    5555      double value = ((ConstrainedDoubleData)currentBranch.GetLocalVariable(HeuristicLab.Functions.Constant.VALUE).Value).Data;
    56       prefix += currentIndend + "[T]Constant(" + value + ";0;0)";
     56      prefix += currentIndend + "[T]Constant(" + value.ToString("r") + ";0;0)";
    5757    }
    5858
     
    106106      double offset = ((ConstrainedIntData)currentBranch.GetLocalVariable(HeuristicLab.Functions.Variable.OFFSET).Value).Data;
    107107
    108       prefix += currentIndend + "[T]Variable(" + weight + ";" + index + ";" + -offset + ")";
     108      prefix += currentIndend + "[T]Variable(" + weight.ToString("r") + ";" + index + ";" + -offset + ")";
    109109    }
    110110
  • trunk/sources/HeuristicLab.Random/NormalDistributedRandom.cs

    r138 r344  
    516516
    517517      XmlNode muNode = document.CreateNode(XmlNodeType.Element, "Mu", null);
    518       muNode.InnerText = mu.ToString(CultureInfo.InvariantCulture);
     518      muNode.InnerText = mu.ToString("r", CultureInfo.InvariantCulture);
    519519      node.AppendChild(muNode);
    520520
    521521      XmlNode sigmaNode = document.CreateNode(XmlNodeType.Element, "Sigma", null);
    522       sigmaNode.InnerText = sigma.ToString(CultureInfo.InvariantCulture);
     522      sigmaNode.InnerText = sigma.ToString("r", CultureInfo.InvariantCulture);
    523523      node.AppendChild(sigmaNode);
    524524
Note: See TracChangeset for help on using the changeset viewer.