Changeset 344
- Timestamp:
- 06/26/08 14:59:06 (17 years ago)
- Location:
- trunk/sources
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Constraints/DoubleBoundedConstraint.cs
r138 r344 136 136 XmlNode node = base.GetXmlNode(name, document, persistedObjects); 137 137 XmlAttribute lb = document.CreateAttribute("LowerBound"); 138 lb.Value = LowerBound.ToString( CultureInfo.InvariantCulture);138 lb.Value = LowerBound.ToString("r", CultureInfo.InvariantCulture); 139 139 XmlAttribute lbi = document.CreateAttribute("LowerBoundIncluded"); 140 140 lbi.Value = lowerBoundIncluded.ToString(); … … 142 142 lbe.Value = lowerBoundEnabled.ToString(); 143 143 XmlAttribute ub = document.CreateAttribute("UpperBound"); 144 ub.Value = upperBound.ToString( CultureInfo.InvariantCulture);144 ub.Value = upperBound.ToString("r", CultureInfo.InvariantCulture); 145 145 XmlAttribute ubi = document.CreateAttribute("UpperBoundIncluded"); 146 146 ubi.Value = upperBoundIncluded.ToString(); -
trunk/sources/HeuristicLab.Constraints/DoubleBoundedConstraintView.cs
r2 r344 69 69 ubEnabledCheckBox.Enabled = false; 70 70 } else { 71 lbTextBox.Text = DoubleBoundedConstraint.LowerBound + "";71 lbTextBox.Text = DoubleBoundedConstraint.LowerBound.ToString("r"); 72 72 lbTextBox.Enabled = DoubleBoundedConstraint.LowerBoundEnabled; 73 73 lbIncludedCheckBox.Checked = DoubleBoundedConstraint.LowerBoundIncluded; … … 76 76 lbEnabledCheckBox.Enabled = true; 77 77 78 ubTextBox.Text = DoubleBoundedConstraint.UpperBound + "";78 ubTextBox.Text = DoubleBoundedConstraint.UpperBound.ToString("r"); 79 79 ubTextBox.Enabled = DoubleBoundedConstraint.UpperBoundEnabled; 80 80 ubIncludedCheckBox.Checked = DoubleBoundedConstraint.UpperBoundIncluded; -
trunk/sources/HeuristicLab.Data/ArrayDataBaseView.Designer.cs
r2 r344 105 105 private System.Windows.Forms.Label sizeLabel; 106 106 private System.Windows.Forms.TextBox lengthTextBox; 107 pr ivateSystem.Windows.Forms.DataGridView dataGridView;107 protected System.Windows.Forms.DataGridView dataGridView; 108 108 } 109 109 } -
trunk/sources/HeuristicLab.Data/ArrayDataBaseView.cs
r2 r344 64 64 dataGridView.RowCount = length; 65 65 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); 67 67 } 68 68 } else { -
trunk/sources/HeuristicLab.Data/ConstrainedDoubleDataView.cs
r2 r344 62 62 } else { 63 63 dataTextBox.Enabled = true; 64 dataTextBox.Text = ConstrainedDoubleData. ToString();64 dataTextBox.Text = ConstrainedDoubleData.Data.ToString("r"); 65 65 } 66 66 } -
trunk/sources/HeuristicLab.Data/DoubleArrayData.cs
r2 r344 65 65 for(int i = 0; i < Data.Length; i++) { 66 66 builder.Append(";"); 67 builder.Append(Data[i].ToString( format));67 builder.Append(Data[i].ToString("r", format)); 68 68 } 69 69 if(builder.Length > 0) -
trunk/sources/HeuristicLab.Data/DoubleArrayDataView.cs
r2 r344 37 37 public DoubleArrayDataView() { 38 38 InitializeComponent(); 39 // round-trip format for all cells 40 dataGridView.DefaultCellStyle.Format = "r"; 39 41 } 40 42 public DoubleArrayDataView(DoubleArrayData doubleArrayData) -
trunk/sources/HeuristicLab.Data/DoubleData.cs
r2 r344 54 54 public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid,IStorable> persistedObjects) { 55 55 XmlNode node = base.GetXmlNode(name, document, persistedObjects); 56 node.InnerText = Data.ToString( CultureInfo.InvariantCulture.NumberFormat);56 node.InnerText = Data.ToString("r", CultureInfo.InvariantCulture.NumberFormat); 57 57 return node; 58 58 } -
trunk/sources/HeuristicLab.Data/DoubleDataView.cs
r2 r344 59 59 } else { 60 60 dataTextBox.Enabled = true; 61 dataTextBox.Text = DoubleData. ToString();61 dataTextBox.Text = DoubleData.Data.ToString("r"); 62 62 } 63 63 } -
trunk/sources/HeuristicLab.Data/DoubleMatrixData.cs
r2 r344 81 81 for (int j = 0; j < Data.GetLength(1); j++) { 82 82 builder.Append(";"); 83 builder.Append(Data[i, j].ToString( format));83 builder.Append(Data[i, j].ToString("r", format)); 84 84 } 85 85 } -
trunk/sources/HeuristicLab.Data/DoubleMatrixDataView.cs
r2 r344 37 37 public DoubleMatrixDataView() { 38 38 InitializeComponent(); 39 // round-trip format for all cells 40 dataGridView.DefaultCellStyle.Format = "r"; 39 41 } 40 42 public DoubleMatrixDataView(DoubleMatrixData doubleMatrixData) -
trunk/sources/HeuristicLab.Data/MatrixDataBaseView.Designer.cs
r2 r344 132 132 private System.Windows.Forms.Label rowsLabel; 133 133 private System.Windows.Forms.TextBox rowsTextBox; 134 pr ivateSystem.Windows.Forms.DataGridView dataGridView;134 protected System.Windows.Forms.DataGridView dataGridView; 135 135 private System.Windows.Forms.TextBox columnsTextBox; 136 136 private System.Windows.Forms.Label columnsLabel; -
trunk/sources/HeuristicLab.DataAnalysis/Dataset.cs
r333 r344 201 201 for(int column = 0; column < columns; column++) { 202 202 builder.Append(";"); 203 builder.Append(samples[row * columns + column].ToString( format));203 builder.Append(samples[row * columns + column].ToString("r", format)); 204 204 } 205 205 } … … 222 222 string s = ""; 223 223 for(int i = 0; i < xs.Length; i++) { 224 s += xs[i].ToString( CultureInfo.InvariantCulture) + "; ";224 s += xs[i].ToString("r", CultureInfo.InvariantCulture) + "; "; 225 225 } 226 226 -
trunk/sources/HeuristicLab.DataAnalysis/DatasetView.cs
r312 r344 44 44 { manipulator.Execute(Dataset); })); 45 45 } 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"; 46 50 } 47 51 -
trunk/sources/HeuristicLab.DataAnalysis/ManualScalingControl.cs
r312 r344 18 18 cancelButton.Visible = editingAllowed; 19 19 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"; 20 24 } 21 25 -
trunk/sources/HeuristicLab.DataAnalysis/SvmExporter.cs
r234 r344 109 109 StreamWriter writer = new StreamWriter(filename); 110 110 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"); 112 112 for(int j = 0; j < dataset.Columns; j++) { 113 113 if(j != targetColumn) { 114 114 double val = dataset.GetValue(i, j); 115 115 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"); 117 117 } 118 118 } -
trunk/sources/HeuristicLab.Functions/BakedFunctionTree.cs
r324 r344 286 286 if(f.data.Count > 0) { 287 287 XmlAttribute dataAttribute = document.CreateAttribute("Data"); 288 dataAttribute.Value = GetString <double>(f.data);288 dataAttribute.Value = GetString(f.data); 289 289 entryNode.Attributes.Append(dataAttribute); 290 290 } … … 311 311 } 312 312 313 private string GetString <T>(IEnumerable<T> xs) where T : IConvertible{313 private string GetString(IEnumerable<double> xs) { 314 314 StringBuilder builder = new StringBuilder(); 315 foreach( Tx in xs) {316 builder.Append(x.ToString( CultureInfo.InvariantCulture) + "; ");315 foreach(double x in xs) { 316 builder.Append(x.ToString("r", CultureInfo.InvariantCulture) + "; "); 317 317 } 318 318 if(builder.Length > 0) builder.Remove(builder.Length - 2, 2); -
trunk/sources/HeuristicLab.Functions/ModelAnalyzerExporter.cs
r310 r344 54 54 public void Visit(Constant constant) { 55 55 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)"; 57 57 } 58 58 … … 106 106 double offset = ((ConstrainedIntData)currentBranch.GetLocalVariable(HeuristicLab.Functions.Variable.OFFSET).Value).Data; 107 107 108 prefix += currentIndend + "[T]Variable(" + weight + ";" + index + ";" + -offset + ")";108 prefix += currentIndend + "[T]Variable(" + weight.ToString("r") + ";" + index + ";" + -offset + ")"; 109 109 } 110 110 -
trunk/sources/HeuristicLab.Random/NormalDistributedRandom.cs
r138 r344 516 516 517 517 XmlNode muNode = document.CreateNode(XmlNodeType.Element, "Mu", null); 518 muNode.InnerText = mu.ToString( CultureInfo.InvariantCulture);518 muNode.InnerText = mu.ToString("r", CultureInfo.InvariantCulture); 519 519 node.AppendChild(muNode); 520 520 521 521 XmlNode sigmaNode = document.CreateNode(XmlNodeType.Element, "Sigma", null); 522 sigmaNode.InnerText = sigma.ToString( CultureInfo.InvariantCulture);522 sigmaNode.InnerText = sigma.ToString("r", CultureInfo.InvariantCulture); 523 523 node.AppendChild(sigmaNode); 524 524
Note: See TracChangeset
for help on using the changeset viewer.