Changeset 16290 for trunk/HeuristicLab.Problems.DataAnalysis.Symbolic
- Timestamp:
- 11/08/18 18:57:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisModel.cs
r16243 r16290 118 118 ConstantTreeNode alphaTreeNode = null; 119 119 ConstantTreeNode betaTreeNode = null; 120 // check if model has been scaled previously by analyzing the structure of the tree120 // check if model has a structure that can be re-used for scaling 121 121 var startNode = SymbolicExpressionTree.Root.GetSubtree(0); 122 if (startNode.GetSubtree(0).Symbol is Addition) { 123 var addNode = startNode.GetSubtree(0); 124 if (addNode.SubtreeCount == 2 && addNode.GetSubtree(0).Symbol is Multiplication && addNode.GetSubtree(1).Symbol is Constant) { 125 alphaTreeNode = addNode.GetSubtree(1) as ConstantTreeNode; 126 var mulNode = addNode.GetSubtree(0); 127 if (mulNode.SubtreeCount == 2 && mulNode.GetSubtree(1).Symbol is Constant) { 128 betaTreeNode = mulNode.GetSubtree(1) as ConstantTreeNode; 129 } 122 var addNode = startNode.GetSubtree(0); 123 if (addNode.Symbol is Addition && addNode.SubtreeCount == 2) { 124 alphaTreeNode = (ConstantTreeNode)addNode.Subtrees.LastOrDefault(n => n is ConstantTreeNode); 125 var mulNode = addNode.Subtrees.FirstOrDefault(n => n.Symbol is Multiplication); 126 if (mulNode != null) { 127 betaTreeNode = (ConstantTreeNode)mulNode.Subtrees.LastOrDefault(n => n is ConstantTreeNode); 130 128 } 131 129 }
Note: See TracChangeset
for help on using the changeset viewer.