- Timestamp:
- 11/27/16 12:58:44 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4/SymbolicTimeSeriesPrognosisExpressionTreeInterpreter.cs
r14185 r14423 45 45 } 46 46 47 [ThreadStatic]48 private static double[] targetVariableCache;49 [ThreadStatic]50 private static List<int> invalidateCacheIndexes;51 52 47 [StorableConstructor] 53 48 private SymbolicTimeSeriesPrognosisExpressionTreeInterpreter(bool deserializing) : base(deserializing) { } … … 77 72 if (CheckExpressionsWithIntervalArithmetic) 78 73 throw new NotSupportedException("Interval arithmetic is not yet supported in the symbolic data analysis interpreter."); 79 if (targetVariableCache == null || targetVariableCache.GetLength(0) < dataset.Rows)80 targetVariableCache = dataset.GetDoubleValues(TargetVariable).ToArray();81 if (invalidateCacheIndexes == null)82 invalidateCacheIndexes = new List<int>(10);83 74 84 75 string targetVariable = TargetVariable; 76 double[] targetVariableCache = dataset.GetDoubleValues(targetVariable).ToArray(); 85 77 lock (syncRoot) { 86 78 EvaluatedSolutions++; // increment the evaluated solutions counter … … 100 92 vProgs[i] = Evaluate(dataset, ref localRow, state); 101 93 targetVariableCache[localRow] = vProgs[i]; 102 invalidateCacheIndexes.Add(localRow);103 94 state.Reset(); 104 95 } 105 96 yield return vProgs; 106 107 int j = 0;108 foreach (var targetValue in dataset.GetDoubleValues(targetVariable, invalidateCacheIndexes)) {109 targetVariableCache[invalidateCacheIndexes[j]] = targetValue;110 j++;111 }112 invalidateCacheIndexes.Clear();113 97 } 114 98
Note: See TracChangeset
for help on using the changeset viewer.