Changeset 16946 for branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionSmalltalkFormatter.cs
- Timestamp:
- 05/13/19 13:59:30 (5 years ago)
- Location:
- branches/2521_ProblemRefactoring
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring
- Property svn:mergeinfo changed
-
branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Problems.DataAnalysis.Symbolic merged: 16802,16822,16839,16858,16868,16905
- Property svn:mergeinfo changed
-
branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionSmalltalkFormatter.cs
r16723 r16946 20 20 #endregion 21 21 22 using System; 22 23 using System.Globalization; 23 24 using System.Text; … … 69 70 } 70 71 stringBuilder.Append(") ifTrue:[1] ifFalse:[-1]"); 72 } else if (symbol is Absolute) { 73 stringBuilder.Append($"({FormatRecursively(node.GetSubtree(0))}) abs"); 74 } else if (symbol is AnalyticQuotient) { 75 stringBuilder.Append($"({FormatRecursively(node.GetSubtree(0))}) / (1 + ({FormatPower(node.GetSubtree(1), "2")})) sqrt"); 71 76 } else if (symbol is Average) { 72 77 stringBuilder.Append("(1/"); … … 84 89 stringBuilder.Append(FormatRecursively(node.GetSubtree(0))); 85 90 stringBuilder.Append(" cos"); 91 } else if (symbol is Cube) { 92 stringBuilder.Append(FormatPower(node.GetSubtree(0), "3")); 93 } else if (symbol is CubeRoot) { 94 stringBuilder.Append(FormatRecursively(node.GetSubtree(0))); 95 stringBuilder.Append(" cbrt"); 86 96 } else if (symbol is Division) { 87 97 if (node.SubtreeCount == 1) { … … 146 156 stringBuilder.Append(FormatRecursively(node.GetSubtree(0))); 147 157 stringBuilder.Append(" sin"); 158 } else if (symbol is Square) { 159 stringBuilder.Append(FormatPower(node.GetSubtree(0), "2")); 160 } else if (symbol is SquareRoot) { 161 stringBuilder.Append(FormatPower(node.GetSubtree(0), "(1/2)")); 148 162 } else if (symbol is Subtraction) { 149 163 if (node.SubtreeCount == 1) { … … 184 198 } 185 199 200 private string FormatPower(ISymbolicExpressionTreeNode node, string exponent) { 201 return $"(({FormatRecursively(node)}) log * {exponent}) exp "; 202 } 203 186 204 public override IDeepCloneable Clone(Cloner cloner) { 187 205 return new SymbolicDataAnalysisExpressionSmalltalkFormatter(this, cloner);
Note: See TracChangeset
for help on using the changeset viewer.