Changeset 13240
- Timestamp:
- 11/18/15 10:33:51 (9 years ago)
- Location:
- stable
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 13116
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis.Symbolic
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic merged: 13116
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionCSharpFormatter.cs
r13047 r13240 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.