Changeset 17497 for stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeBatchInterpreter.cs
- Timestamp:
- 04/06/20 17:45:12 (5 years ago)
- Location:
- stable
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
-
stable/HeuristicLab.Problems.DataAnalysis.Symbolic
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Problems.DataAnalysis.Symbolic merged: 17402
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeBatchInterpreter.cs
r17170 r17497 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.Collections.Generic; 3 24 using System.Linq; … … 181 202 182 203 [ThreadStatic] 183 private Dictionary<string, double[]> cachedData;204 private static Dictionary<string, double[]> cachedData; 184 205 185 206 [ThreadStatic] 186 private IDataset dataset;207 private static IDataset cachedDataset; 187 208 188 209 private void InitCache(IDataset dataset) { 189 this.dataset = dataset;210 cachedDataset = dataset; 190 211 cachedData = new Dictionary<string, double[]>(); 191 212 foreach (var v in dataset.DoubleVariables) { … … 196 217 public void InitializeState() { 197 218 cachedData = null; 198 dataset = null;219 cachedDataset = null; 199 220 EvaluatedSolutions = 0; 200 221 } 201 222 202 223 private double[] GetValues(ISymbolicExpressionTree tree, IDataset dataset, int[] rows) { 203 if (cachedData == null || this.dataset != dataset) {224 if (cachedData == null || cachedDataset != dataset) { 204 225 InitCache(dataset); 205 226 }
Note: See TracChangeset
for help on using the changeset viewer.