Changeset 7695 for trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionMATLABFormatter.cs
- Timestamp:
- 04/03/12 00:32:03 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionMATLABFormatter.cs
r7653 r7695 20 20 #endregion 21 21 22 using System.Globalization; 22 23 using System.Text; 23 using System.Linq;24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; 25 using HeuristicLab. Common;26 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 26 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Problems.DataAnalysis;28 using System.Collections.Generic;29 using System;30 using System.Globalization;31 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;32 28 33 29 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { … … 84 80 } 85 81 86 public string FormatOnlyExpression(ISymbolicExpressionTreeNode expressionNode) 87 { 82 public string FormatOnlyExpression(ISymbolicExpressionTreeNode expressionNode) { 88 83 var stringBuilder = new StringBuilder(); 89 84 stringBuilder.AppendLine(" for " + CurrentIndexVariable + " = 1:1:rows"); … … 151 146 } else if (symbol is Exponential) { 152 147 stringBuilder.Append("exp("); 148 stringBuilder.Append(FormatRecursively(node.GetSubtree(0))); 149 stringBuilder.Append(")"); 150 } else if (symbol is Square) { 151 stringBuilder.Append("("); 152 stringBuilder.Append(FormatRecursively(node.GetSubtree(0))); 153 stringBuilder.Append(").^2"); 154 } else if (symbol is SquareRoot) { 155 stringBuilder.Append("sqrt("); 153 156 stringBuilder.Append(FormatRecursively(node.GetSubtree(0))); 154 157 stringBuilder.Append(")"); … … 283 286 284 287 285 private string LagToString(int lag) 286 { 288 private string LagToString(int lag) { 287 289 if (lag < 0) { 288 290 return "(" + CurrentIndexVariable + "" + lag + ")";
Note: See TracChangeset
for help on using the changeset viewer.