Changeset 17827 for branches/3073_IA_constraint_splitting/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters
- Timestamp:
- 01/31/21 08:08:32 (4 years ago)
- Location:
- branches/3073_IA_constraint_splitting/HeuristicLab.Problems.DataAnalysis.Symbolic
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3073_IA_constraint_splitting/HeuristicLab.Problems.DataAnalysis.Symbolic
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Problems.DataAnalysis.Symbolic merged: 17811,17817,17820,17826
- Property svn:mergeinfo changed
-
branches/3073_IA_constraint_splitting/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/InfixExpressionFormatter.cs
r17790 r17827 29 29 using HeuristicLab.Core; 30 30 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 31 using Microsoft.SqlServer.Server;32 31 33 32 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { … … 39 38 // operators 40 39 if (token == "+" || token == "-" || token == "OR" || token == "XOR" || 41 token == "*" || token == "/" || token == "AND" || 42 token == "^") { 40 token == "*" || token == "/" || token == "AND") { 43 41 strBuilder.Append("("); 44 42 FormatRecursively(node.Subtrees.First(), strBuilder, numberFormat, formatString, constants); … … 47 45 strBuilder.Append(" ").Append(token).Append(" "); 48 46 FormatRecursively(subtree, strBuilder, numberFormat, formatString, constants); 47 } 48 49 strBuilder.Append(")"); 50 } else if (token == "^") { 51 // handle integer powers directly 52 strBuilder.Append("("); 53 FormatRecursively(node.Subtrees.First(), strBuilder, numberFormat, formatString, constants); 54 55 var power = node.GetSubtree(1); 56 if(power is ConstantTreeNode constNode && Math.Truncate(constNode.Value) == constNode.Value) { 57 strBuilder.Append(" ").Append(token).Append(" ").Append(constNode.Value.ToString(formatString, numberFormat)); 58 } else { 59 strBuilder.Append(" ").Append(token).Append(" "); 60 FormatRecursively(power, strBuilder, numberFormat, formatString, constants); 49 61 } 50 62 … … 131 143 } else if (node.Symbol is Constant) { 132 144 var constNode = node as ConstantTreeNode; 133 if (constants==null && constNode.Value < 0) {145 if (constants == null && constNode.Value < 0) { 134 146 strBuilder.Append("(").Append(constNode.Value.ToString(formatString, numberFormat)) 135 147 .Append(")"); // (-1 -
branches/3073_IA_constraint_splitting/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionLatexFormatter.cs
r17790 r17827 517 517 518 518 private void FormatStartSymbol(StringBuilder strBuilder) { 519 strBuilder.Append( EscapeLatexString(targetVariable) ?? "target_{" + targetCount++ + "}");519 strBuilder.Append(targetVariable != null ? EscapeLatexString(targetVariable) : "\\text{target}_{" + targetCount++ + "}"); 520 520 if (containsTimeSeriesSymbol) 521 521 strBuilder.Append("(t)");
Note: See TracChangeset
for help on using the changeset viewer.