- Timestamp:
- 12/06/11 18:13:42 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionLatexFormatter.cs
r7136 r7140 77 77 strBuilder.Append(FormatRecursively(node.GetSubtree(0))); 78 78 } 79 int i = 1; 79 80 foreach (SymbolicExpressionTreeNode subTree in node.Subtrees.Skip(1)) { 80 FormatSep(node, strBuilder );81 FormatSep(node, strBuilder, i); 81 82 // format the whole subtree 82 83 strBuilder.Append(FormatRecursively(subTree)); 84 i++; 83 85 } 84 86 … … 190 192 } 191 193 192 private void FormatSep(ISymbolicExpressionTreeNode node, StringBuilder strBuilder ) {194 private void FormatSep(ISymbolicExpressionTreeNode node, StringBuilder strBuilder, int step) { 193 195 if (node.Symbol is Addition) { 194 196 strBuilder.Append(" + "); … … 198 200 strBuilder.Append(@" \cdot "); 199 201 } else if (node.Symbol is Division) { 200 strBuilder.Append(@" }{ \cfrac{ "); 202 if (step + 1 == node.SubtreeCount) 203 strBuilder.Append(@"}{"); 204 else 205 strBuilder.Append(@" }{ \cfrac{ "); 201 206 } else if (node.Symbol is Average) { 202 207 strBuilder.Append(@" + "); … … 253 258 } else if (node.Symbol is Multiplication) { 254 259 } else if (node.Symbol is Division) { 255 strBuilder.Append("} "); 256 if (node.SubtreeCount > 1) 257 strBuilder.Append("{1} "); 258 for (int i = 1; i < node.SubtreeCount; i++) { 260 strBuilder.Append(" } "); 261 for (int i = 2; i < node.SubtreeCount; i++) 259 262 strBuilder.Append(" } "); 260 }261 263 } else if (node.Symbol is Average) { 262 264 strBuilder.Append(@" ) ");
Note: See TracChangeset
for help on using the changeset viewer.