Changeset 18100 for branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Converters
- Timestamp:
- 12/01/21 13:40:55 (3 years ago)
- Location:
- branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Converters
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Converters/LinearModelToTreeConverter.cs
r18093 r18100 58 58 59 59 if (@const!=0.0) { 60 Num TreeNode cNode = (NumTreeNode)new Num().CreateTreeNode();60 NumberTreeNode cNode = (NumberTreeNode)new Number().CreateTreeNode(); 61 61 cNode.Value = @const; 62 62 add.AddSubtree(cNode); … … 99 99 100 100 if (!@const.IsAlmost(0.0)) { 101 Num TreeNode cNode = (NumTreeNode)new Num().CreateTreeNode();101 NumberTreeNode cNode = (NumberTreeNode)new Number().CreateTreeNode(); 102 102 cNode.Value = @const; 103 103 addition.AddSubtree(cNode); … … 130 130 131 131 if (!@const.IsAlmost(0.0)) { 132 Num TreeNode cNode = (NumTreeNode)new Num().CreateTreeNode();132 NumberTreeNode cNode = (NumberTreeNode)new Number().CreateTreeNode(); 133 133 cNode.Value = @const; 134 134 addition.AddSubtree(cNode); -
branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Converters/TreeToAutoDiffTermConverter.cs
r18093 r18100 145 145 146 146 private AutoDiff.Term ConvertToAutoDiff(ISymbolicExpressionTreeNode node) { 147 if (node.Symbol is Num ) {148 initialConstants.Add(((Num TreeNode)node).Value);147 if (node.Symbol is Number) { 148 initialConstants.Add(((NumberTreeNode)node).Value); 149 149 var var = new AutoDiff.Variable(); 150 150 variables.Add(var); … … 152 152 } 153 153 154 if (node.Symbol is RealConstant) {155 initialConstants.Add((( RealConstantTreeNode)node).Value);154 if (node.Symbol is Constant) { 155 initialConstants.Add(((ConstantTreeNode)node).Value); 156 156 var var = new AutoDiff.Variable(); 157 157 variables.Add(var); … … 267 267 } 268 268 if (node.Symbol is Power) { 269 var powerNode = node.GetSubtree(1) as Num TreeNode;269 var powerNode = node.GetSubtree(1) as NumberTreeNode; 270 270 if (powerNode == null) 271 271 throw new NotSupportedException("Only integer powers are allowed in parameter optimization. Try to use exp() and log() instead of the power symbol."); … … 337 337 !(n.Symbol is FactorVariable) && 338 338 !(n.Symbol is LaggedVariable) && 339 !(n.Symbol is Num ) &&340 !(n.Symbol is RealConstant) &&339 !(n.Symbol is Number) && 340 !(n.Symbol is Constant) && 341 341 !(n.Symbol is Addition) && 342 342 !(n.Symbol is Subtraction) &&
Note: See TracChangeset
for help on using the changeset viewer.