Changeset 345 for branches/3.0/sources
- Timestamp:
- 06/26/08 15:30:16 (16 years ago)
- Location:
- branches/3.0/sources
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.0/sources/HeuristicLab.Constraints/DoubleBoundedConstraint.cs
r139 r345 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(); -
branches/3.0/sources/HeuristicLab.Constraints/DoubleBoundedConstraintView.cs
r2 r345 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; -
branches/3.0/sources/HeuristicLab.Data/ArrayDataBaseView.Designer.cs
r2 r345 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 } -
branches/3.0/sources/HeuristicLab.Data/ArrayDataBaseView.cs
r2 r345 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 { -
branches/3.0/sources/HeuristicLab.Data/ConstrainedDoubleDataView.cs
r2 r345 62 62 } else { 63 63 dataTextBox.Enabled = true; 64 dataTextBox.Text = ConstrainedDoubleData. ToString();64 dataTextBox.Text = ConstrainedDoubleData.Data.ToString("r"); 65 65 } 66 66 } -
branches/3.0/sources/HeuristicLab.Data/DoubleArrayData.cs
r2 r345 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) -
branches/3.0/sources/HeuristicLab.Data/DoubleArrayDataView.cs
r2 r345 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) -
branches/3.0/sources/HeuristicLab.Data/DoubleData.cs
r2 r345 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 } -
branches/3.0/sources/HeuristicLab.Data/DoubleDataView.cs
r2 r345 59 59 } else { 60 60 dataTextBox.Enabled = true; 61 dataTextBox.Text = DoubleData. ToString();61 dataTextBox.Text = DoubleData.Data.ToString("r"); 62 62 } 63 63 } -
branches/3.0/sources/HeuristicLab.Data/DoubleMatrixData.cs
r2 r345 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 } -
branches/3.0/sources/HeuristicLab.Data/DoubleMatrixDataView.cs
r2 r345 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) -
branches/3.0/sources/HeuristicLab.Data/MatrixDataBaseView.Designer.cs
r2 r345 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; -
branches/3.0/sources/HeuristicLab.DataAnalysis/Dataset.cs
r278 r345 66 66 public double[] Samples { 67 67 get { return samples; } 68 set { 68 set { 69 69 samples = value; 70 70 CreateDictionaries(); … … 81 81 public Dataset() { 82 82 Name = "-"; 83 VariableNames = new string[] { "Var0"};83 VariableNames = new string[] { "Var0" }; 84 84 Columns = 1; 85 85 Rows = 1; … … 146 146 rows = int.Parse(node.Attributes["Dimension1"].Value, CultureInfo.InvariantCulture.NumberFormat); 147 147 columns = int.Parse(node.Attributes["Dimension2"].Value, CultureInfo.InvariantCulture.NumberFormat); 148 148 149 149 VariableNames = ParseVariableNamesString(node.Attributes["VariableNames"].Value); 150 150 … … 154 154 for(int row = 0; row < rows; row++) { 155 155 for(int column = 0; column < columns; column++) { 156 if(double.TryParse(tokens[row * columns + column], NumberStyles.Float, CultureInfo.InvariantCulture.NumberFormat, out samples[row *columns + column]) == false) {156 if(double.TryParse(tokens[row * columns + column], NumberStyles.Float, CultureInfo.InvariantCulture.NumberFormat, out samples[row * columns + column]) == false) { 157 157 throw new FormatException("Can't parse " + tokens[row * columns + column] + " as double value."); 158 158 } … … 171 171 for(int column = 0; column < columns; column++) { 172 172 builder.Append(";"); 173 builder.Append(samples[row *columns+column].ToString(format));173 builder.Append(samples[row * columns + column].ToString("r",format)); 174 174 } 175 175 } … … 180 180 private string GetVariableNamesString() { 181 181 string s = ""; 182 for 182 for(int i = 0; i < variableNames.Length; i++) { 183 183 s += variableNames[i] + "; "; 184 184 } 185 185 186 if 186 if(variableNames.Length > 0) { 187 187 s = s.TrimEnd(';', ' '); 188 188 } … … 192 192 private string[] ParseVariableNamesString(string p) { 193 193 p = p.Trim(); 194 string[] tokens = p.Split(new char[] { ';'}, StringSplitOptions.RemoveEmptyEntries);194 string[] tokens = p.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries); 195 195 return tokens; 196 196 } 197 197 198 198 public double GetMean(int column) { 199 return GetMean(column, 0, Rows -1);199 return GetMean(column, 0, Rows - 1); 200 200 } 201 201 … … 216 216 217 217 public double GetRange(int column) { 218 return GetRange(column, 0, Rows -1);218 return GetRange(column, 0, Rows - 1); 219 219 } 220 220 -
branches/3.0/sources/HeuristicLab.DataAnalysis/DatasetView.cs
r278 r345 41 41 InitializeComponent(); 42 42 openFileDialog = new OpenFileDialog(); 43 44 dataGridView.DefaultCellStyle.Format = "r"; 43 45 } 44 46 -
branches/3.0/sources/HeuristicLab.Functions/FunctionView.cs
r2 r345 285 285 286 286 public void Visit(Constant constant) { 287 prefix += currentIndend + "[T]Constant(" + constant.Value.Data.ToString( ) + ";0;0)";287 prefix += currentIndend + "[T]Constant(" + constant.Value.Data.ToString("r") + ";0;0)"; 288 288 } 289 289 … … 333 333 334 334 public void Visit(HeuristicLab.Functions.Variable variable) { 335 prefix += currentIndend + "[T]Variable(" + variable.Weight + ";" + variable.VariableIndex + ";" + -variable.SampleOffset+ ")";335 prefix += currentIndend + "[T]Variable(" + variable.Weight.ToString("r") + ";" + variable.VariableIndex.ToString("r") + ";" + (-variable.SampleOffset).ToString("r") + ")"; 336 336 } 337 337 -
branches/3.0/sources/HeuristicLab.Random/NormalDistributedRandom.cs
r139 r345 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.