- Timestamp:
- 07/11/19 16:30:22 (5 years ago)
- Location:
- branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/InfixExpressionFormatter.cs
r16722 r17134 20 20 #endregion 21 21 22 using HEAL.Attic; 23 using HeuristicLab.Common; 24 using HeuristicLab.Core; 25 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 22 26 using System; 23 27 using System.Globalization; 24 28 using System.Linq; 25 29 using System.Text; 26 using HeuristicLab.Common;27 using HeuristicLab.Core;28 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;29 using HEAL.Attic;30 30 31 31 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { … … 58 58 /// <param name="formatString">The format string for numeric parameters (e.g. \"G4\" to limit to 4 digits, default is \"G\")</param> 59 59 /// <returns>Infix expression</returns> 60 public string Format(ISymbolicExpressionTree symbolicExpressionTree, NumberFormatInfo numberFormat, string formatString ="G") {60 public string Format(ISymbolicExpressionTree symbolicExpressionTree, NumberFormatInfo numberFormat, string formatString = "G") { 61 61 // skip root and start symbols 62 62 StringBuilder strBuilder = new StringBuilder(); … … 182 182 else 183 183 strBuilder.Append("(").Append(constNode.Value.ToString(formatString, numberFormat)).Append(")"); // (-1 184 } else if (node.Symbol is TreeModel) { 185 var modelNode = node as TreeModelTreeNode; 186 strBuilder.Append(modelNode.TreeToString()); 184 187 } 185 188 } -
branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/BatchOperations.cs
r16722 r17134 101 101 public static void CubeRoot(double[] a, double[] b) { 102 102 for (int i = 0; i < BATCHSIZE; ++i) 103 a[i] = Math.Pow(b[i], 1d / 3d);103 a[i] = b[i] < 0 ? -Math.Pow(-b[i], 1d / 3d) : Math.Pow(b[i], 1d / 3d); 104 104 } 105 105 -
branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/ModelTreeNode.cs
r17002 r17134 94 94 return s; 95 95 } 96 public string TreeToString() { 97 var fmt = new InfixExpressionFormatter(); 98 string s = fmt.Format(Tree); 99 return s; 100 } 96 101 } 97 102 }
Note: See TracChangeset
for help on using the changeset viewer.