- Timestamp:
- 04/23/14 15:51:41 (11 years ago)
- Location:
- branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/Filter/ComparisonFilter.cs
r10716 r10785 128 128 } 129 129 130 result[row] = base.Check(item);130 result[row] = !base.Check(item); 131 131 } 132 132 -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/FilterLogic.cs
r10783 r10785 35 35 } 36 36 37 public bool[] Preview(IList<IFilter> filters )37 public bool[] Preview(IList<IFilter> filters, bool isAndCombination) 38 38 { 39 39 IList<IFilter> activeFilters = filters.Where(f => f.Active && f.ConstraintData != null).ToList<IFilter>(); … … 44 44 45 45 bool[] result = Enumerable.Repeat<bool>(true, preprocessingData.Rows).ToArray(); 46 foreach (IFilter filter in activeFilters) 47 { 48 bool[] filterResult = filter.Check(); 49 for (int row = 0; row < result.Length; ++row) 50 { 51 result[row] = isAndCombination ? result[row] && filterResult[row] : result[row] || filterResult[row]; 52 } 53 } 46 54 47 foreach (IFilter filter in activeFilters)48 {49 bool[] filterResult = filter.Check();50 51 for(int row = 0; row < result.Length; ++row) {52 result[row] = result[row] && filterResult[row];53 }54 }55 55 56 56 preprocessingData.SetFilter(result); … … 59 59 } 60 60 61 public void Apply(IList<IFilter> filters )61 public void Apply(IList<IFilter> filters, bool isAndCombination) 62 62 { 63 preprocessingData.SetFilter(Preview(filters ));63 preprocessingData.SetFilter(Preview(filters, isAndCombination)); 64 64 preprocessingData.PersistFilter(); 65 65 } -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IFilterLogic.cs
r10638 r10785 24 24 namespace HeuristicLab.DataPreprocessing { 25 25 public interface IFilterLogic { 26 bool[] Preview(IList<IFilter> filters );27 void Apply(IList<IFilter> filters );26 bool[] Preview(IList<IFilter> filters, bool isAndCombination); 27 void Apply(IList<IFilter> filters, bool isAndCombination); 28 28 IPreprocessingData PreprocessingData{get;} 29 void Reset(); 29 30 } 30 31 }
Note: See TracChangeset
for help on using the changeset viewer.