Changeset 18237 for branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression
- Timestamp:
- 03/14/22 14:15:52 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/VectorUnrollingNonlinearLeastSquaresConstantOptimizationEvaluator.cs
r18234 r18237 182 182 int i = 0; 183 183 foreach (var node in tree.Root.IterateNodesPrefix().OfType<SymbolicExpressionTreeTerminalNode>()) { 184 ConstantTreeNode constantTreeNode = node as ConstantTreeNode; 185 VariableTreeNodeBase variableTreeNodeBase = node as VariableTreeNodeBase; 186 FactorVariableTreeNode factorVarTreeNode = node as FactorVariableTreeNode; 187 if (constantTreeNode != null) 184 if (node is ConstantTreeNode constantTreeNode) { 188 185 constantTreeNode.Value = constants[i++]; 189 else if (updateVariableWeights && variableTreeNodeBase != null)186 } else if (updateVariableWeights && node is VariableTreeNodeBase variableTreeNodeBase) { 190 187 variableTreeNodeBase.Weight = constants[i++]; 191 else if (factorVarTreeNode != null) {188 } else if (node is FactorVariableTreeNode factorVarTreeNode) { 192 189 for (int j = 0; j < factorVarTreeNode.Weights.Length; j++) 193 190 factorVarTreeNode.Weights[j] = constants[i++];
Note: See TracChangeset
for help on using the changeset viewer.