Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/14/22 14:15:52 (3 years ago)
Author:
pfleck
Message:

#3040 Added sub-vector, std dev and variance support for Tree to Tensor converter.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/VectorUnrollingNonlinearLeastSquaresConstantOptimizationEvaluator.cs

    r18234 r18237  
    182182      int i = 0;
    183183      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) {
    188185          constantTreeNode.Value = constants[i++];
    189         else if (updateVariableWeights && variableTreeNodeBase != null)
     186        } else if (updateVariableWeights && node is VariableTreeNodeBase variableTreeNodeBase) {
    190187          variableTreeNodeBase.Weight = constants[i++];
    191         else if (factorVarTreeNode != null) {
     188        } else if (node is FactorVariableTreeNode factorVarTreeNode) {
    192189          for (int j = 0; j < factorVarTreeNode.Weights.Length; j++)
    193190            factorVarTreeNode.Weights[j] = constants[i++];
Note: See TracChangeset for help on using the changeset viewer.