Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/06/17 16:40:33 (7 years ago)
Author:
gkronber
Message:

#2650: use a dictionary of variable values instead of a list in FactorVariable (symbol) to remove sequential search for variable value in FactorVariableTreeNode

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Importer/SymbolicExpressionImporter.cs

    r14540 r14717  
    228228      // create a set of (virtual) values to match the number of weights
    229229      t.Symbol.VariableNames = new string[] { t.VariableName };
    230       t.Symbol.VariableValues = new KeyValuePair<string, List<string>>[] { new KeyValuePair<string, List<string>>(t.VariableName, weights.Select((_, i) => "X" + i).ToList()) };
     230      t.Symbol.VariableValues = new[]
     231      { new KeyValuePair<string, Dictionary<string,int>>(
     232        t.VariableName,
     233        weights.Select((_, i) => Tuple.Create(_,i)).ToDictionary(tup=>"X" + tup.Item2, tup=>tup.Item2)) };
    231234      return t;
    232235    }
Note: See TracChangeset for help on using the changeset viewer.