Changeset 13213
- Timestamp:
- 11/17/15 13:57:39 (9 years ago)
- Location:
- branches/DataAnalysis.ComplexityAnalyzer
- Files:
-
- 1 deleted
- 4 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic merged: 12982,13116,13186
- Property svn:mergeinfo changed
-
branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression merged: 12973,12977
- Property svn:mergeinfo changed
-
branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionCSharpFormatter.cs
r12850 r13213 56 56 57 57 private void FormatRecursively(ISymbolicExpressionTreeNode node, StringBuilder strBuilder) { 58 // TODO: adapt to interpreter semantics. The HL interpreter also allows Boolean operations on reals 58 59 if (node.Subtrees.Any()) { 59 60 if (node.Symbol is Addition) { … … 83 84 } else if (node.Symbol is Or) { 84 85 FormatOperator(node, "||", strBuilder); 86 } else if (node.Symbol is Xor) { 87 FormatOperator(node, "^", strBuilder); 85 88 } else if (node.Symbol is Sine) { 86 89 FormatFunction(node, "Math.Sin", strBuilder); 87 90 } else if (node.Symbol is Subtraction) { 88 Format Operator(node, "-", strBuilder);91 FormatSubtraction(node, strBuilder); 89 92 } else if (node.Symbol is Tangent) { 90 93 FormatFunction(node, "Math.Tan", strBuilder); … … 142 145 } 143 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 144 157 private void FormatOperator(ISymbolicExpressionTreeNode node, string symbol, StringBuilder strBuilder) { 145 158 strBuilder.Append("("); … … 176 189 } 177 190 178 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); 179 192 strBuilder.Append(string.Join(", ", orderedNames)); 180 193 -
branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj
r12547 r13213 198 198 <SubType>Code</SubType> 199 199 </Compile> 200 <Compile Include="Formatters\SymbolicDataAnalysisExpressionMathematicaFormatter.cs" /> 200 201 <Compile Include="Formatters\SymbolicDataAnalysisExpressionCSharpFormatter.cs" /> 201 202 <Compile Include="Importer\SymbolicExpressionImporter.cs" />
Note: See TracChangeset
for help on using the changeset viewer.