- Timestamp:
- 03/28/19 11:22:24 (5 years ago)
- Location:
- branches/2988_ModelsOfModels2
- Files:
-
- 6 added
- 1 deleted
- 23 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic
- Property svn:mergeinfo changed
-
branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Converters/TreeToAutoDiffTermConverter.cs
r16565 r16722 20 20 #endregion 21 21 22 using AutoDiff; 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 22 24 using System; 23 25 using System.Collections.Generic; 24 26 using System.Linq; 25 27 using System.Runtime.Serialization; 26 using AutoDiff;27 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;28 28 29 29 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { … … 76 76 eval: Math.Tan, 77 77 diff: x => 1 + Math.Tan(x) * Math.Tan(x)); 78 78 private static readonly Func<Term, UnaryFunc> tanh = UnaryFunc.Factory( 79 eval: Math.Tanh, 80 diff: x => 1 - Math.Tanh(x) * Math.Tanh(x)); 79 81 private static readonly Func<Term, UnaryFunc> erf = UnaryFunc.Factory( 80 82 eval: alglib.errorfunction, … … 249 251 if (node.Symbol is CubeRoot) { 250 252 return AutoDiff.TermBuilder.Power( 251 ConvertToAutoDiff(node.GetSubtree(0)), 1.0 /3.0);253 ConvertToAutoDiff(node.GetSubtree(0)), 1.0 / 3.0); 252 254 } 253 255 if (node.Symbol is Sine) { … … 261 263 if (node.Symbol is Tangent) { 262 264 return tan( 265 ConvertToAutoDiff(node.GetSubtree(0))); 266 } 267 if (node.Symbol is HyperbolicTangent) { 268 return tanh( 263 269 ConvertToAutoDiff(node.GetSubtree(0))); 264 270 } … … 321 327 !(n.Symbol is Cosine) && 322 328 !(n.Symbol is Tangent) && 329 !(n.Symbol is HyperbolicTangent) && 323 330 !(n.Symbol is Erf) && 324 331 !(n.Symbol is Norm) && -
branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/InfixExpressionFormatter.cs
r16565 r16722 51 51 } 52 52 53 public string Format(ISymbolicExpressionTree symbolicExpressionTree) { 53 /// <summary> 54 /// Produces an infix expression for a given expression tree. 55 /// </summary> 56 /// <param name="symbolicExpressionTree">The tree representation of the expression.</param> 57 /// <param name="numberFormat">Number format that should be used for numeric parameters (e.g. NumberFormatInfo.InvariantInfo (default)).</param> 58 /// <param name="formatString">The format string for numeric parameters (e.g. \"G4\" to limit to 4 digits, default is \"G\")</param> 59 /// <returns>Infix expression</returns> 60 public string Format(ISymbolicExpressionTree symbolicExpressionTree, NumberFormatInfo numberFormat, string formatString="G") { 54 61 // skip root and start symbols 55 62 StringBuilder strBuilder = new StringBuilder(); 56 FormatRecursively(symbolicExpressionTree.Root.GetSubtree(0).GetSubtree(0), strBuilder );63 FormatRecursively(symbolicExpressionTree.Root.GetSubtree(0).GetSubtree(0), strBuilder, numberFormat, formatString); 57 64 return strBuilder.ToString(); 58 65 } 59 66 60 private void FormatRecursively(ISymbolicExpressionTreeNode node, StringBuilder strBuilder) { 67 public string Format(ISymbolicExpressionTree symbolicExpressionTree) { 68 return Format(symbolicExpressionTree, NumberFormatInfo.InvariantInfo); 69 } 70 71 private static void FormatRecursively(ISymbolicExpressionTreeNode node, StringBuilder strBuilder, NumberFormatInfo numberFormat, string formatString) { 61 72 if (node.SubtreeCount > 1) { 62 73 var token = GetToken(node.Symbol); … … 66 77 token == "^") { 67 78 strBuilder.Append("("); 68 FormatRecursively(node.Subtrees.First(), strBuilder );79 FormatRecursively(node.Subtrees.First(), strBuilder, numberFormat, formatString); 69 80 70 81 foreach (var subtree in node.Subtrees.Skip(1)) { 71 82 strBuilder.Append(" ").Append(token).Append(" "); 72 FormatRecursively(subtree, strBuilder );83 FormatRecursively(subtree, strBuilder, numberFormat, formatString); 73 84 } 74 85 strBuilder.Append(")"); … … 76 87 // function with multiple arguments 77 88 strBuilder.Append(token).Append("("); 78 FormatRecursively(node.Subtrees.First(), strBuilder );89 FormatRecursively(node.Subtrees.First(), strBuilder, numberFormat, formatString); 79 90 foreach (var subtree in node.Subtrees.Skip(1)) { 80 91 strBuilder.Append(", "); 81 FormatRecursively(subtree, strBuilder );92 FormatRecursively(subtree, strBuilder, numberFormat, formatString); 82 93 } 83 94 strBuilder.Append(")"); … … 87 98 if (token == "-" || token == "NOT") { 88 99 strBuilder.Append("(").Append(token).Append("("); 89 FormatRecursively(node.GetSubtree(0), strBuilder );100 FormatRecursively(node.GetSubtree(0), strBuilder, numberFormat, formatString); 90 101 strBuilder.Append("))"); 91 102 } else if (token == "/") { 92 103 strBuilder.Append("1/"); 93 FormatRecursively(node.GetSubtree(0), strBuilder );104 FormatRecursively(node.GetSubtree(0), strBuilder, numberFormat, formatString); 94 105 } else if (token == "+" || token == "*") { 95 FormatRecursively(node.GetSubtree(0), strBuilder );106 FormatRecursively(node.GetSubtree(0), strBuilder, numberFormat, formatString); 96 107 } else { 97 108 // function with only one argument 98 109 strBuilder.Append(token).Append("("); 99 FormatRecursively(node.GetSubtree(0), strBuilder );110 FormatRecursively(node.GetSubtree(0), strBuilder, numberFormat, formatString); 100 111 strBuilder.Append(")"); 101 112 } … … 106 117 if (!varNode.Weight.IsAlmost(1.0)) { 107 118 strBuilder.Append("("); 108 strBuilder.Append Format(CultureInfo.InvariantCulture, "{0}", varNode.Weight);119 strBuilder.Append(varNode.Weight.ToString(formatString, numberFormat)); 109 120 strBuilder.Append("*"); 110 121 } … … 116 127 } 117 128 strBuilder.Append(", ") 118 .AppendFormat( CultureInfo.InvariantCulture, "{0}", varNode.Lag)129 .AppendFormat(numberFormat, "{0}", varNode.Lag) 119 130 .Append(")"); 120 131 } else if (node.Symbol is Variable) { … … 122 133 if (!varNode.Weight.IsAlmost(1.0)) { 123 134 strBuilder.Append("("); 124 strBuilder.Append Format(CultureInfo.InvariantCulture, "{0}", varNode.Weight);135 strBuilder.Append(varNode.Weight.ToString(formatString, numberFormat)); 125 136 strBuilder.Append("*"); 126 137 } … … 141 152 } 142 153 strBuilder.AppendFormat("[{0}]", 143 string.Join(", ", factorNode.Weights.Select(w => w.ToString( CultureInfo.InvariantCulture))));154 string.Join(", ", factorNode.Weights.Select(w => w.ToString(formatString, numberFormat)))); 144 155 } else if (node.Symbol is BinaryFactorVariable) { 145 156 var factorNode = node as BinaryFactorVariableTreeNode; 146 157 if (!factorNode.Weight.IsAlmost(1.0)) { 147 158 strBuilder.Append("("); 148 strBuilder.Append Format(CultureInfo.InvariantCulture, "{0}", factorNode.Weight);159 strBuilder.Append(factorNode.Weight.ToString(formatString, numberFormat)); 149 160 strBuilder.Append("*"); 150 161 } … … 168 179 var constNode = node as ConstantTreeNode; 169 180 if (constNode.Value >= 0.0) 170 strBuilder.Append Format(CultureInfo.InvariantCulture, "{0}", constNode.Value);181 strBuilder.Append(constNode.Value.ToString(formatString, numberFormat)); 171 182 else 172 strBuilder.Append Format(CultureInfo.InvariantCulture, "({0})", constNode.Value); // (-1183 strBuilder.Append("(").Append(constNode.Value.ToString(formatString, numberFormat)).Append(")"); // (-1 173 184 } 174 185 } 175 186 } 176 187 177 private st ring GetToken(ISymbol symbol) {188 private static string GetToken(ISymbol symbol) { 178 189 var tok = InfixExpressionParser.knownSymbols.GetBySecond(symbol).FirstOrDefault(); 179 190 if (tok == null) -
branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionCSharpFormatter.cs
r16565 r16722 26 26 using System.Text; 27 27 using System.Text.RegularExpressions; 28 using HEAL.Attic; 28 29 using HeuristicLab.Common; 29 30 using HeuristicLab.Core; 30 31 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 31 using HEAL.Attic;32 32 33 33 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { … … 56 56 } 57 57 58 private string VariableName2Identifier(string name) { 58 private string VariableName2Identifier(string name) { 59 59 /* 60 60 * identifier-start-character: … … 131 131 } else if (node.Symbol is Tangent) { 132 132 FormatFunction(node, "Math.Tan", strBuilder); 133 } else if (node.Symbol is HyperbolicTangent) { 134 FormatFunction(node, "Math.Tanh", strBuilder); 133 135 } else if (node.Symbol is Square) { 134 136 FormatSquare(node, strBuilder); -
branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionExcelFormatter.cs
r16565 r16722 25 25 using System.Linq; 26 26 using System.Text; 27 using HEAL.Attic; 27 28 using HeuristicLab.Common; 28 29 using HeuristicLab.Core; 29 30 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 30 using HEAL.Attic;31 31 32 32 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { … … 192 192 stringBuilder.Append(FormatRecursively(node.GetSubtree(0))); 193 193 stringBuilder.Append(")"); 194 194 } else if (symbol is HyperbolicTangent) { 195 stringBuilder.Append("TANH("); 196 stringBuilder.Append(FormatRecursively(node.GetSubtree(0))); 197 stringBuilder.Append(")"); 195 198 } else if (symbol is Variable) { 196 199 VariableTreeNode variableTreeNode = node as VariableTreeNode; -
branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionLatexFormatter.cs
r16565 r16722 24 24 using System.Linq; 25 25 using System.Text; 26 using HEAL.Attic; 26 27 using HeuristicLab.Common; 27 28 using HeuristicLab.Core; 28 29 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 29 using HEAL.Attic;30 30 31 31 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { … … 137 137 } else if (node.Symbol is Tangent) { 138 138 strBuilder.Append(@"\tan \left( "); 139 } else if (node.Symbol is HyperbolicTangent) { 140 strBuilder.Append(@"\tanh \left( "); 139 141 } else if (node.Symbol is AiryA) { 140 142 strBuilder.Append(@"\operatorname{airy}_a \left( "); … … 303 305 } else if (node.Symbol is Tangent) { 304 306 throw new InvalidOperationException(); 307 } else if (node.Symbol is HyperbolicTangent) { 308 throw new InvalidOperationException(); 305 309 } else if (node.Symbol is AiryA) { 306 310 throw new InvalidOperationException(); … … 399 403 } else if (node.Symbol is Tangent) { 400 404 strBuilder.Append(@" \right) "); 405 } else if (node.Symbol is HyperbolicTangent) { 406 strBuilder.Append(@" \right) "); 401 407 } else if (node.Symbol is AiryA) { 402 408 strBuilder.Append(@" \right) "); -
branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionMATLABFormatter.cs
r16565 r16722 23 23 using System.Linq; 24 24 using System.Text; 25 using HEAL.Attic; 25 26 using HeuristicLab.Common; 26 27 using HeuristicLab.Core; 27 28 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 28 using HEAL.Attic;29 29 30 30 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { … … 252 252 } else if (symbol is Tangent) { 253 253 stringBuilder.Append("tan("); 254 stringBuilder.Append(FormatRecursively(node.GetSubtree(0))); 255 stringBuilder.Append(")"); 256 } else if (symbol is HyperbolicTangent) { 257 stringBuilder.Append("tanh("); 254 258 stringBuilder.Append(FormatRecursively(node.GetSubtree(0))); 255 259 stringBuilder.Append(")"); -
branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionMathematicaFormatter.cs
r16565 r16722 24 24 using System.Linq; 25 25 using System.Text; 26 using HEAL.Attic; 26 27 using HeuristicLab.Common; 27 28 using HeuristicLab.Core; 28 29 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 29 using HEAL.Attic;30 30 31 31 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { … … 70 70 } else if (node.Symbol is Tangent) { 71 71 FormatFunction(node, "Tan", strBuilder); 72 } else if (node.Symbol is HyperbolicTangent) { 73 FormatFunction(node, "Tanh", strBuilder); 72 74 } else if (node.Symbol is Exponential) { 73 75 FormatFunction(node, "Exp", strBuilder); -
branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionSmalltalkFormatter.cs
r16565 r16722 160 160 stringBuilder.Append(FormatRecursively(node.GetSubtree(0))); 161 161 stringBuilder.Append(" tan"); 162 } else if (symbol is HyperbolicTangent) { 163 stringBuilder.Append(FormatRecursively(node.GetSubtree(0))); 164 stringBuilder.Append(" tanh"); 162 165 } else if (symbol is Variable) { 163 166 VariableTreeNode variableTreeNode = node as VariableTreeNode; -
branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/FullFunctionalExpressionGrammar.cs
r16565 r16722 55 55 var log = new Logarithm(); 56 56 var abs = new Absolute(); 57 var tanh = new HyperbolicTangent(); 57 58 var pow = new Power(); 58 59 pow.InitialFrequency = 0.0; … … 120 121 constant.MinValue = -20; 121 122 constant.MaxValue = 20; 123 124 var treeModel = new TreeModel(); 125 122 126 var variableSymbol = new HeuristicLab.Problems.DataAnalysis.Symbolic.Variable(); 123 127 var binFactorVariable = new BinaryFactorVariable(); … … 129 133 autoregressiveVariable.Enabled = false; 130 134 131 var allSymbols = new List<Symbol>() { add, sub, mul, div, aq, mean, abs, sin, cos, tan, log, square, cube, pow, sqrt, cubeRoot, root, exp, 135 var allSymbols = new List<Symbol>() { add, sub, mul, div, aq, mean, abs, sin, cos, tan, log, square, cube, pow, sqrt, cubeRoot, root, exp, tanh, 132 136 airyA, airyB, bessel, cosineIntegral, dawson, erf, expIntegralEi, fresnelCosineIntegral, fresnelSineIntegral, gamma, hypCosineIntegral, hypSineIntegral, norm, psi, sineIntegral, 133 137 @if, gt, lt, and, or, not,xor, timeLag, integral, derivative, constant, variableSymbol, binFactorVariable, factorVariable, laggedVariable,autoregressiveVariable, variableCondition }; 134 var unaryFunctionSymbols = new List<Symbol>() { abs, square, sqrt, cube, cubeRoot, sin, cos, tan, log, exp, not, timeLag, integral, derivative,138 var unaryFunctionSymbols = new List<Symbol>() { abs, square, sqrt, cube, cubeRoot, sin, cos, tan, log, exp, tanh, not, timeLag, integral, derivative, 135 139 airyA, airyB, bessel, cosineIntegral, dawson, erf, expIntegralEi, fresnelCosineIntegral, fresnelSineIntegral, gamma, hypCosineIntegral, hypSineIntegral, norm, psi, sineIntegral 136 140 }; … … 138 142 var binaryFunctionSymbols = new List<Symbol>() { pow, root, gt, lt, aq, variableCondition }; 139 143 var ternarySymbols = new List<Symbol>() { add, sub, mul, div, mean, and, or, xor }; 140 var terminalSymbols = new List<Symbol>() { variableSymbol, binFactorVariable, factorVariable, constant, laggedVariable, autoregressiveVariable };144 var terminalSymbols = new List<Symbol>() { variableSymbol, binFactorVariable, factorVariable, constant, laggedVariable, autoregressiveVariable, treeModel }; 141 145 142 146 foreach (var symb in allSymbols) -
branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentExpressionGrammar.cs
r16565 r16722 85 85 var gamma = new Gamma(); 86 86 var hypCosineIntegral = new HyperbolicCosineIntegral(); 87 var tanh = new HyperbolicTangent(); 87 88 var hypSineIntegral = new HyperbolicSineIntegral(); 88 89 var norm = new Norm(); … … 107 108 constant.MinValue = -20; 108 109 constant.MaxValue = 20; 110 109 111 var variableSymbol = new Variable(); 110 112 var binFactorVariable = new BinaryFactorVariable(); … … 112 114 var laggedVariable = new LaggedVariable(); 113 115 var autoregressiveVariable = new AutoregressiveTargetVariable(); 116 117 var treeModel = new TreeModel(); 114 118 #endregion 115 119 116 120 #region group symbol declaration 117 121 var arithmeticSymbols = new GroupSymbol(ArithmeticFunctionsName, new List<ISymbol>() { add, sub, mul, div, mean }); 118 var trigonometricSymbols = new GroupSymbol(TrigonometricFunctionsName, new List<ISymbol>() { sin, cos, tan 119 var exponentialAndLogarithmicSymbols = new GroupSymbol(ExponentialFunctionsName, new List<ISymbol> { exp, log 122 var trigonometricSymbols = new GroupSymbol(TrigonometricFunctionsName, new List<ISymbol>() { sin, cos, tan, tanh}); 123 var exponentialAndLogarithmicSymbols = new GroupSymbol(ExponentialFunctionsName, new List<ISymbol> { exp, log}); 120 124 var specialFunctions = new GroupSymbol(SpecialFunctionsName, new List<ISymbol> { abs, airyA, airyB, bessel, cosineIntegral, dawson, erf, expIntegralEi, 121 125 fresnelCosineIntegral,fresnelSineIntegral,gamma,hypCosineIntegral,hypSineIntegral,norm, psi, sineIntegral, analyticalQuotient}); 122 var terminalSymbols = new GroupSymbol(TerminalsName, new List<ISymbol> { constant, variableSymbol, binFactorVariable, factorVariable });126 var terminalSymbols = new GroupSymbol(TerminalsName, new List<ISymbol> { constant, variableSymbol, binFactorVariable, factorVariable, treeModel }); 123 127 var realValuedSymbols = new GroupSymbol(RealValuedSymbolsName, new List<ISymbol>() { arithmeticSymbols, trigonometricSymbols, exponentialAndLogarithmicSymbols, specialFunctions, terminalSymbols }); 124 128 … … 242 246 Symbols.First(s => s is Average).Enabled = false; 243 247 Symbols.First(s => s is Absolute).Enabled = false; 248 Symbols.First(s => s is HyperbolicTangent).Enabled = false; 244 249 Symbols.First(s => s.Name == TrigonometricFunctionsName).Enabled = false; 245 250 Symbols.First(s => s.Name == PowerFunctionsName).Enabled = false; … … 254 259 Symbols.First(s => s is Xor).Enabled = false; 255 260 Symbols.First(s => s is Absolute).Enabled = false; 261 Symbols.First(s => s is HyperbolicTangent).Enabled = false; 256 262 Symbols.First(s => s.Name == TrigonometricFunctionsName).Enabled = false; 257 263 Symbols.First(s => s.Name == ExponentialFunctionsName).Enabled = false; … … 264 270 Symbols.First(s => s is Average).Enabled = false; 265 271 Symbols.First(s => s is Absolute).Enabled = false; 272 Symbols.First(s => s is HyperbolicTangent).Enabled = false; 266 273 Symbols.First(s => s.Name == TrigonometricFunctionsName).Enabled = false; 267 274 Symbols.First(s => s.Name == PowerFunctionsName).Enabled = false; -
branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj
r16568 r16722 41 41 <DebugType>full</DebugType> 42 42 <Optimize>false</Optimize> 43 <OutputPath> $(SolutionDir)\bin\</OutputPath>43 <OutputPath>..\..\..\..\trunk\bin\</OutputPath> 44 44 <DefineConstants>DEBUG;TRACE</DefineConstants> 45 45 <ErrorReport>prompt</ErrorReport> … … 51 51 <DebugType>pdbonly</DebugType> 52 52 <Optimize>true</Optimize> 53 <OutputPath> $(SolutionDir)\bin\</OutputPath>53 <OutputPath>..\..\..\..\trunk\bin\</OutputPath> 54 54 <DefineConstants>TRACE</DefineConstants> 55 55 <ErrorReport>prompt</ErrorReport> … … 100 100 <ItemGroup> 101 101 <Reference Include="ALGLIB-3.7.0, Version=3.7.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 102 <HintPath>..\..\ bin\ALGLIB-3.7.0.dll</HintPath>102 <HintPath>..\..\..\..\trunk\bin\ALGLIB-3.7.0.dll</HintPath> 103 103 <Private>False</Private> 104 104 </Reference> 105 105 <Reference Include="AutoDiff-1.0, Version=1.0.0.14388, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 106 <HintPath>..\..\bin\AutoDiff-1.0.dll</HintPath> 107 <Private>False</Private> 108 </Reference> 109 <Reference Include="Google.Protobuf, Version=3.6.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL"> 110 <HintPath>..\..\packages\Google.Protobuf.3.6.1\lib\net45\Google.Protobuf.dll</HintPath> 106 <HintPath>..\..\..\..\trunk\bin\AutoDiff-1.0.dll</HintPath> 107 <Private>False</Private> 111 108 </Reference> 112 109 <Reference Include="HEAL.Attic, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 113 110 <HintPath>..\..\packages\HEAL.Attic.1.0.0-pre02\lib\net461\HEAL.Attic.dll</HintPath> 111 <Private>False</Private> 112 </Reference> 113 <Reference Include="HeuristicLab.Analysis-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 114 <SpecificVersion>False</SpecificVersion> 115 <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Analysis-3.3.dll</HintPath> 116 <Private>False</Private> 117 </Reference> 118 <Reference Include="HeuristicLab.Collections-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 119 <SpecificVersion>False</SpecificVersion> 120 <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Collections-3.3.dll</HintPath> 121 <Private>False</Private> 122 </Reference> 123 <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 124 <SpecificVersion>False</SpecificVersion> 125 <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Common-3.3.dll</HintPath> 126 <Private>False</Private> 127 </Reference> 128 <Reference Include="HeuristicLab.Common.Resources-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 129 <SpecificVersion>False</SpecificVersion> 130 <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Common.Resources-3.3.dll</HintPath> 131 <Private>False</Private> 132 </Reference> 133 <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 134 <SpecificVersion>False</SpecificVersion> 135 <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Core-3.3.dll</HintPath> 136 <Private>False</Private> 137 </Reference> 138 <Reference Include="HeuristicLab.Data-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 139 <SpecificVersion>False</SpecificVersion> 140 <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Data-3.3.dll</HintPath> 141 <Private>False</Private> 142 </Reference> 143 <Reference Include="HeuristicLab.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 144 <SpecificVersion>False</SpecificVersion> 145 <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Operators-3.3.dll</HintPath> 146 </Reference> 147 <Reference Include="HeuristicLab.Optimization-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 148 <SpecificVersion>False</SpecificVersion> 149 <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Optimization-3.3.dll</HintPath> 150 <Private>False</Private> 151 </Reference> 152 <Reference Include="HeuristicLab.Optimization.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 153 <SpecificVersion>False</SpecificVersion> 154 <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Optimization.Operators-3.3.dll</HintPath> 155 <Private>False</Private> 156 </Reference> 157 <Reference Include="HeuristicLab.Parameters-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 158 <SpecificVersion>False</SpecificVersion> 159 <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Parameters-3.3.dll</HintPath> 160 <Private>False</Private> 161 </Reference> 162 <Reference Include="HeuristicLab.Persistence-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 163 <SpecificVersion>False</SpecificVersion> 164 <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Persistence-3.3.dll</HintPath> 165 <Private>False</Private> 166 </Reference> 167 <Reference Include="HeuristicLab.PluginInfrastructure-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 168 <SpecificVersion>False</SpecificVersion> 169 <HintPath>..\..\..\..\trunk\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath> 170 <Private>False</Private> 171 </Reference> 172 <Reference Include="HeuristicLab.Problems.DataAnalysis-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 173 <SpecificVersion>False</SpecificVersion> 174 <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Problems.DataAnalysis-3.4.dll</HintPath> 175 <Private>False</Private> 114 176 </Reference> 115 177 <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic.NativeInterpreter-0.1, Version=0.0.0.1, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 116 178 <SpecificVersion>False</SpecificVersion> 117 <HintPath>..\..\bin\HeuristicLab.Problems.DataAnalysis.Symbolic.NativeInterpreter-0.1.dll</HintPath> 179 <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Problems.DataAnalysis.Symbolic.NativeInterpreter-0.1.dll</HintPath> 180 <Private>False</Private> 181 </Reference> 182 <Reference Include="HeuristicLab.Problems.Instances-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 183 <SpecificVersion>False</SpecificVersion> 184 <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Problems.Instances-3.3.dll</HintPath> 185 <Private>False</Private> 186 </Reference> 187 <Reference Include="HeuristicLab.Random-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 188 <SpecificVersion>False</SpecificVersion> 189 <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Random-3.3.dll</HintPath> 190 <Private>False</Private> 191 </Reference> 192 <Reference Include="HeuristicLab.Selection-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 193 <SpecificVersion>False</SpecificVersion> 194 <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Selection-3.3.dll</HintPath> 118 195 <Private>False</Private> 119 196 </Reference> … … 136 213 </ItemGroup> 137 214 <ItemGroup> 215 <Compile Include="Analyzers\MinAverageMaxSymbolicExpressionNeastedTreeSyzeAnalyzer.cs" /> 216 <Compile Include="Analyzers\MinAverageMaxSymbolicExpressionTreeVariablesNumberAnalyzer.cs" /> 217 <Compile Include="Analyzers\MinAverageMaxSymbolicExpressionTreeComplexcityAnalyzer.cs" /> 138 218 <Compile Include="Analyzers\SymbolicDataAnalysisBottomUpDiversityAnalyzer.cs" /> 139 219 <Compile Include="Analyzers\SymbolicDataAnalysisBuildingBlockAnalyzer.cs" /> … … 176 256 <Compile Include="Interpreter\SymbolicDataAnalysisExpressionTreeBatchInterpreter.cs" /> 177 257 <Compile Include="Interpreter\SymbolicDataAnalysisExpressionTreeNativeInterpreter.cs" /> 258 <Compile Include="Selectors\DiversitySelector.cs" /> 178 259 <Compile Include="SymbolicDataAnalysisExpressionTreeSimplificationOperator.cs" /> 179 260 <Compile Include="SymbolicDataAnalysisModelComplexityCalculator.cs" /> … … 239 320 <Compile Include="Symbols\Absolute.cs" /> 240 321 <Compile Include="Symbols\CubeRoot.cs" /> 322 <Compile Include="Symbols\HyperbolicTangent.cs" /> 323 <Compile Include="Symbols\ModelTreeNode.cs" /> 241 324 <Compile Include="Symbols\VariableBase.cs" /> 242 325 <Compile Include="Symbols\VariableTreeNodeBase.cs" /> … … 293 376 <Compile Include="TreeMatching\SymbolicExpressionTreeNodeEqualityComparer.cs" /> 294 377 <Compile Include="TreeMatching\SymbolicExpressionTreePhenotypicSimilarityCalculator.cs" /> 378 <Compile Include="Symbols\TreeModel.cs" /> 295 379 <None Include="HeuristicLab.snk" /> 296 380 <None Include="packages.config" /> … … 328 412 </ItemGroup> 329 413 <ItemGroup> 330 <ProjectReference Include="..\..\HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj">331 <Project>{887425B4-4348-49ED-A457-B7D2C26DDBF9}</Project>332 <Name>HeuristicLab.Analysis-3.3</Name>333 <Private>False</Private>334 </ProjectReference>335 <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj">336 <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project>337 <Name>HeuristicLab.Collections-3.3</Name>338 <Private>False</Private>339 </ProjectReference>340 <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj">341 <Project>{0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}</Project>342 <Name>HeuristicLab.Common.Resources-3.3</Name>343 <Private>False</Private>344 </ProjectReference>345 <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">346 <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>347 <Name>HeuristicLab.Common-3.3</Name>348 <Private>False</Private>349 </ProjectReference>350 <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj">351 <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project>352 <Name>HeuristicLab.Core-3.3</Name>353 <Private>False</Private>354 </ProjectReference>355 <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj">356 <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project>357 <Name>HeuristicLab.Data-3.3</Name>358 <Private>False</Private>359 </ProjectReference>360 414 <ProjectReference Include="..\..\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding\3.4\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj"> 361 415 <Project>{06D4A186-9319-48A0-BADE-A2058D462EEA}</Project> 362 416 <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4</Name> 363 <Private>False</Private>364 </ProjectReference>365 <ProjectReference Include="..\..\HeuristicLab.Operators\3.3\HeuristicLab.Operators-3.3.csproj">366 <Project>{23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}</Project>367 <Name>HeuristicLab.Operators-3.3</Name>368 <Private>False</Private>369 </ProjectReference>370 <ProjectReference Include="..\..\HeuristicLab.Optimization.Operators\3.3\HeuristicLab.Optimization.Operators-3.3.csproj">371 <Project>{25087811-F74C-4128-BC86-8324271DA13E}</Project>372 <Name>HeuristicLab.Optimization.Operators-3.3</Name>373 <Private>False</Private>374 </ProjectReference>375 <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">376 <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project>377 <Name>HeuristicLab.Optimization-3.3</Name>378 </ProjectReference>379 <ProjectReference Include="..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj">380 <Project>{56F9106A-079F-4C61-92F6-86A84C2D84B7}</Project>381 <Name>HeuristicLab.Parameters-3.3</Name>382 <Private>False</Private>383 </ProjectReference>384 <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj">385 <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project>386 <Name>HeuristicLab.Persistence-3.3</Name>387 <Private>False</Private>388 </ProjectReference>389 <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj">390 <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>391 <Name>HeuristicLab.PluginInfrastructure-3.3</Name>392 <Private>False</Private>393 </ProjectReference>394 <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis\3.4\HeuristicLab.Problems.DataAnalysis-3.4.csproj">395 <Project>{DF87C13E-A889-46FF-8153-66DCAA8C5674}</Project>396 <Name>HeuristicLab.Problems.DataAnalysis-3.4</Name>397 <Private>False</Private>398 </ProjectReference>399 <ProjectReference Include="..\..\HeuristicLab.Problems.Instances\3.3\HeuristicLab.Problems.Instances-3.3.csproj">400 <Project>{3540E29E-4793-49E7-8EE2-FEA7F61C3994}</Project>401 <Name>HeuristicLab.Problems.Instances-3.3</Name>402 <Private>False</Private>403 </ProjectReference>404 <ProjectReference Include="..\..\HeuristicLab.Random\3.3\HeuristicLab.Random-3.3.csproj">405 <Project>{F4539FB6-4708-40C9-BE64-0A1390AEA197}</Project>406 <Name>HeuristicLab.Random-3.3</Name>407 417 <Private>False</Private> 408 418 </ProjectReference> -
branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Importer/InfixExpressionParser.cs
r16565 r16722 84 84 private Constant constant = new Constant(); 85 85 private Variable variable = new Variable(); 86 private TreeModel treeModel = new TreeModel(); 86 87 private BinaryFactorVariable binaryFactorVar = new BinaryFactorVariable(); 87 88 private FactorVariable factorVar = new FactorVariable(); … … 111 112 { "COS", new Cosine()}, 112 113 { "TAN", new Tangent()}, 114 { "TANH", new HyperbolicTangent()}, 113 115 { "AIRYA", new AiryA()}, 114 116 { "AIRYB", new AiryB()}, -
branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Importer/SymbolicExpressionImporter.cs
r16565 r16722 53 53 {"COS", new Cosine()}, 54 54 {"TAN", new Tangent()}, 55 {"TANH", new HyperbolicTangent ()}, 55 56 {"AIRYA", new AiryA()}, 56 57 {"AIRYB", new AiryB()}, -
branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/BatchOperations.cs
r16356 r16722 69 69 a[i] = Math.Tan(b[i]); 70 70 } 71 public static void Tanh(double[] a, double[] b) { 72 for (int i = 0; i < BATCHSIZE; ++i) 73 a[i] = Math.Tanh(b[i]); 74 } 71 75 72 76 public static void Pow(double[] a, double[] b) { -
branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/IntervalInterpreter.cs
r16565 r16722 88 88 var outputInterval = Evaluate(instructions, ref instructionCount); 89 89 90 return outputInterval; 90 // because of numerical errors the bounds might be incorrect 91 if (outputInterval.LowerBound <= outputInterval.UpperBound) 92 return outputInterval; 93 else 94 return new Interval(outputInterval.UpperBound, outputInterval.LowerBound); 91 95 } 92 96 … … 102 106 var outputInterval = Evaluate(instructions, ref instructionCount, intervals); 103 107 104 nodeIntervals = intervals; 105 106 return outputInterval; 108 // fix incorrect intervals if necessary (could occur because of numerical errors) 109 nodeIntervals = new Dictionary<ISymbolicExpressionTreeNode, Interval>(); 110 foreach(var kvp in intervals) { 111 var interval = kvp.Value; 112 if (interval.IsInfiniteOrUndefined || interval.LowerBound <= interval.UpperBound) 113 nodeIntervals.Add(kvp.Key, interval); 114 else 115 nodeIntervals.Add(kvp.Key, new Interval(interval.UpperBound, interval.LowerBound)); 116 } 117 118 // because of numerical errors the bounds might be incorrect 119 if (outputInterval.IsInfiniteOrUndefined || outputInterval.LowerBound <= outputInterval.UpperBound) 120 return outputInterval; 121 else 122 return new Interval(outputInterval.UpperBound, outputInterval.LowerBound); 107 123 } 108 124 -
branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/OpCodes.cs
r16565 r16722 90 90 public const byte CubeRoot = 51; 91 91 92 public const byte Tanh = 52; 93 public const byte TreeModel = 53; 94 92 95 93 96 private static Dictionary<Type, byte> symbolToOpcode = new Dictionary<Type, byte>() { … … 99 102 { typeof(Cosine), OpCodes.Cos }, 100 103 { typeof(Tangent), OpCodes.Tan }, 104 { typeof (HyperbolicTangent), OpCodes.Tanh}, 101 105 { typeof(Logarithm), OpCodes.Log }, 102 106 { typeof(Exponential), OpCodes.Exp }, … … 114 118 { typeof(AutoregressiveTargetVariable),OpCodes.LagVariable}, 115 119 { typeof(Constant), OpCodes.Constant }, 120 { typeof(TreeModel), OpCodes.TreeModel }, 116 121 { typeof(Argument), OpCodes.Arg }, 117 122 { typeof(Power),OpCodes.Power}, -
branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionCompiledTreeInterpreter.cs
r16565 r16722 45 45 private static readonly MethodInfo Cos = typeof(Math).GetMethod("Cos", new[] { typeof(double) }); 46 46 private static readonly MethodInfo Tan = typeof(Math).GetMethod("Tan", new[] { typeof(double) }); 47 private static readonly MethodInfo Tanh = typeof(Math).GetMethod("Tanh", new[] { typeof(double) }); 47 48 private static readonly MethodInfo Sqrt = typeof(Math).GetMethod("Sqrt", new[] { typeof(double) }); 48 49 private static readonly MethodInfo Floor = typeof(Math).GetMethod("Floor", new[] { typeof(double) }); … … 223 224 return Expression.Call(Tan, arg); 224 225 } 226 case OpCodes.Tanh: { 227 var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns); 228 return Expression.Call(Tanh, arg); 229 } 225 230 case OpCodes.Square: { 226 231 var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns); -
branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeBatchInterpreter.cs
r16565 r16722 51 51 } 52 52 } 53 53 private void SubTreeEvoluate(BatchInstruction instr, int[] rows, int rowIndex, int batchSize) { 54 for (int i = 0; i < batchSize; ++i) { 55 var row = rows[rowIndex] + i; 56 instr.buf[i] = instr.data[row]; // не забыть заполнить 57 } 58 } 54 59 private void Evaluate(BatchInstruction[] code, int[] rows, int rowIndex, int batchSize) { 55 60 for (int i = code.Length - 1; i >= 0; --i) { … … 61 66 case OpCodes.Variable: { 62 67 LoadData(instr, rows, rowIndex, batchSize); 68 break; 69 } 70 case OpCodes.TreeModel: { 71 SubTreeEvoluate(instr, rows, rowIndex, batchSize); 63 72 break; 64 73 } … … 159 168 break; 160 169 } 161 170 case OpCodes.Tanh: { 171 Tanh(instr.buf, code[c].buf); 172 break; 173 } 162 174 case OpCodes.Absolute: { 163 175 Absolute(instr.buf, code[c].buf); … … 201 213 } 202 214 203 var code = Compile(tree, dataset, OpCodes.MapSymbolToOpCode );215 var code = Compile(tree, dataset, OpCodes.MapSymbolToOpCode, rows); 204 216 var remainingRows = rows.Length % BATCHSIZE; 205 217 var roundedTotal = rows.Length - remainingRows; … … 233 245 } 234 246 235 private BatchInstruction[] Compile(ISymbolicExpressionTree tree, IDataset dataset, Func<ISymbolicExpressionTreeNode, byte> opCodeMapper ) {247 private BatchInstruction[] Compile(ISymbolicExpressionTree tree, IDataset dataset, Func<ISymbolicExpressionTreeNode, byte> opCodeMapper, int[] rows) { 236 248 var root = tree.Root.GetSubtree(0).GetSubtree(0); 237 249 var code = new BatchInstruction[root.GetLength()]; 238 250 if (root.SubtreeCount > ushort.MaxValue) throw new ArgumentException("Number of subtrees is too big (>65.535)"); 239 251 int c = 1, i = 0; 252 var allRows = Enumerable.Range(0, dataset.Rows).ToArray(); 240 253 foreach (var node in root.IterateNodesBreadth()) { 241 254 if (node.SubtreeCount > ushort.MaxValue) throw new ArgumentException("Number of subtrees is too big (>65.535)"); … … 258 271 for (int j = 0; j < BATCHSIZE; ++j) 259 272 code[i].buf[j] = code[i].value; 273 } else if (node is TreeModelTreeNode subtree) { 274 code[i].data = GetValues(subtree.Tree, dataset, allRows); 275 EvaluatedSolutions--; 260 276 } 261 277 c += node.SubtreeCount; -
branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeILEmittingInterpreter.cs
r16565 r16722 45 45 private static MethodInfo sin = typeof(Math).GetMethod("Sin", new Type[] { typeof(double) }); 46 46 private static MethodInfo tan = typeof(Math).GetMethod("Tan", new Type[] { typeof(double) }); 47 private static MethodInfo tanh = typeof(Math).GetMethod("Tanh", new Type[] { typeof(double) }); 47 48 private static MethodInfo exp = typeof(Math).GetMethod("Exp", new Type[] { typeof(double) }); 48 49 private static MethodInfo log = typeof(Math).GetMethod("Log", new Type[] { typeof(double) }); … … 285 286 return; 286 287 } 288 case OpCodes.Tanh: { 289 CompileInstructions(il, state, ds); 290 il.Emit(System.Reflection.Emit.OpCodes.Call, tanh); 291 return; 292 } 287 293 case OpCodes.Power: { 288 294 CompileInstructions(il, state, ds); … … 425 431 Label c1 = il.DefineLabel(); 426 432 CompileInstructions(il, state, ds); 427 il.Emit(System.Reflection.Emit.OpCodes.Ldc_ I4_0); // > 0433 il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 0.0); // > 0 428 434 il.Emit(System.Reflection.Emit.OpCodes.Cgt); 429 435 il.Emit(System.Reflection.Emit.OpCodes.Brfalse, c1); … … 440 446 CompileInstructions(il, state, ds); 441 447 for (int i = 1; i < nArgs; i++) { 442 il.Emit(System.Reflection.Emit.OpCodes.Ldc_ I4_0); // > 0448 il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 0.0); // > 0 443 449 il.Emit(System.Reflection.Emit.OpCodes.Cgt); 444 450 il.Emit(System.Reflection.Emit.OpCodes.Brfalse, falseBranch); 445 451 CompileInstructions(il, state, ds); 446 452 } 447 il.Emit(System.Reflection.Emit.OpCodes.Ldc_ I4_0); // > 0453 il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 0.0); // > 0 448 454 il.Emit(System.Reflection.Emit.OpCodes.Cgt); 449 455 il.Emit(System.Reflection.Emit.OpCodes.Brfalse, falseBranch); … … 465 471 // complex definition because of special properties of NaN 466 472 il.Emit(System.Reflection.Emit.OpCodes.Dup); 467 il.Emit(System.Reflection.Emit.OpCodes.Ldc_ I4_0); // <= 0473 il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 0.0); // <= 0 468 474 il.Emit(System.Reflection.Emit.OpCodes.Ble, nextArgBranch); 469 475 il.Emit(System.Reflection.Emit.OpCodes.Br, resultBranch); … … 473 479 } 474 480 il.MarkLabel(resultBranch); 475 il.Emit(System.Reflection.Emit.OpCodes.Ldc_ I4_0); // > 0481 il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 0.0); // > 0 476 482 il.Emit(System.Reflection.Emit.OpCodes.Cgt); 477 483 il.Emit(System.Reflection.Emit.OpCodes.Brtrue, trueBranch); … … 486 492 case OpCodes.NOT: { 487 493 CompileInstructions(il, state, ds); 488 il.Emit(System.Reflection.Emit.OpCodes.Ldc_ I4_0); // > 0494 il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 0.0); // > 0 489 495 il.Emit(System.Reflection.Emit.OpCodes.Cgt); 490 496 il.Emit(System.Reflection.Emit.OpCodes.Conv_R8); // convert to float64 … … 498 504 case OpCodes.XOR: { 499 505 CompileInstructions(il, state, ds); 500 il.Emit(System.Reflection.Emit.OpCodes.Ldc_ I4_0);506 il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 0.0); 501 507 il.Emit(System.Reflection.Emit.OpCodes.Cgt);// > 0 502 508 503 509 for (int i = 1; i < nArgs; i++) { 504 510 CompileInstructions(il, state, ds); 505 il.Emit(System.Reflection.Emit.OpCodes.Ldc_ I4_0);511 il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 0.0); 506 512 il.Emit(System.Reflection.Emit.OpCodes.Cgt);// > 0 507 513 il.Emit(System.Reflection.Emit.OpCodes.Xor); -
branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeInterpreter.cs
r16565 r16722 205 205 return Math.Abs(Evaluate(dataset, ref row, state)); 206 206 } 207 case OpCodes.Tanh: { 208 return Math.Tanh(Evaluate(dataset, ref row, state)); 209 } 207 210 case OpCodes.Cos: { 208 211 return Math.Cos(Evaluate(dataset, ref row, state)); -
branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeLinearInterpreter.cs
r16565 r16722 226 226 } else if (instr.opCode == OpCodes.Absolute) { 227 227 instr.value = Math.Abs(code[instr.childIndex].value); 228 } else if (instr.opCode == OpCodes.Tanh) { 229 instr.value = Math.Tanh(code[instr.childIndex].value); 228 230 } else if (instr.opCode == OpCodes.Cos) { 229 231 instr.value = Math.Cos(code[instr.childIndex].value); -
branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Plugin.cs.frame
r16565 r16722 42 42 [PluginDependency("HeuristicLab.Optimization.Operators", "3.3")] 43 43 [PluginDependency("HeuristicLab.Parameters", "3.3")] 44 [PluginDependency("HeuristicLab. Persistence", "3.3")]44 [PluginDependency("HeuristicLab.Attic", "1.0")] 45 45 [PluginDependency("HeuristicLab.Problems.DataAnalysis", "3.4")] 46 46 [PluginDependency("HeuristicLab.Problems.Instances", "3.3")] 47 47 [PluginDependency("HeuristicLab.Random", "3.3")] 48 [PluginDependency("HeuristicLab.Selection", "3.3")] 48 49 public class HeuristicLabProblemsDataAnalysisSymbolicPlugin : PluginBase { 49 50 } -
branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Selectors/DiversitySelector.cs
r16623 r16722 20 20 #endregion 21 21 22 using System;23 using System.Collections.Generic;24 22 using HEAL.Attic; 25 23 using HeuristicLab.Common; … … 30 28 using HeuristicLab.Parameters; 31 29 using HeuristicLab.Selection; 30 using System; 31 using System.Collections.Generic; 32 32 33 33 namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
Note: See TracChangeset
for help on using the changeset viewer.