Changeset 13116 for trunk/sources
- Timestamp:
- 11/04/15 16:20:21 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionCSharpFormatter.cs
r12982 r13116 89 89 FormatFunction(node, "Math.Sin", strBuilder); 90 90 } else if (node.Symbol is Subtraction) { 91 Format Operator(node, "-", strBuilder);91 FormatSubtraction(node, strBuilder); 92 92 } else if (node.Symbol is Tangent) { 93 93 FormatFunction(node, "Math.Tan", strBuilder); … … 145 145 } 146 146 147 private void FormatSubtraction(ISymbolicExpressionTreeNode node, StringBuilder strBuilder) { 148 if (node.SubtreeCount == 1) { 149 strBuilder.Append("-"); 150 FormatRecursively(node.GetSubtree(0), strBuilder); 151 return; 152 } 153 //Default case: more than 1 child 154 FormatOperator(node, "-", strBuilder); 155 } 156 147 157 private void FormatOperator(ISymbolicExpressionTreeNode node, string symbol, StringBuilder strBuilder) { 148 158 strBuilder.Append("("); … … 179 189 } 180 190 181 var orderedNames = varNames.OrderBy(n => n, new NaturalStringComparer()).Select(n => "double " + n);191 var orderedNames = varNames.OrderBy(n => n, new NaturalStringComparer()).Select(n => "double " + n); 182 192 strBuilder.Append(string.Join(", ", orderedNames)); 183 193
Note: See TracChangeset
for help on using the changeset viewer.