- Timestamp:
- 11/09/17 11:51:37 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing Cleanup/HeuristicLab.DataPreprocessing/3.4/Content/FilterContent.cs
r15274 r15466 20 20 #endregion 21 21 22 using System.Collections.Generic; 22 23 using System.Drawing; 24 using System.Linq; 23 25 using HeuristicLab.Common; 24 26 using HeuristicLab.Core; … … 38 40 [Storable] 39 41 public bool IsAndCombination { get; set; } 42 43 public IEnumerable<IFilter> ActiveFilters { 44 get { return Filters.Where(f => f.Active && f.ConstraintData != null); } 45 } 46 47 public bool[] GetRemainingRows() { 48 var remainingRows = new bool[PreprocessingData.Rows]; 49 if (ActiveFilters.Any()) { 50 var filterResults = ActiveFilters.Select(f => f.Check()).ToList(); 51 var rowFilterResults = new bool[filterResults.Count]; 52 for (int row = 0; row < remainingRows.Length; row++) { 53 for (int i = 0; i < filterResults.Count; i++) 54 rowFilterResults[i] = filterResults[i][row]; 55 56 remainingRows[row] = IsAndCombination 57 ? rowFilterResults.All(x => x) 58 : rowFilterResults.Any(x => x); 59 } 60 } else { 61 // if not filters active => all rows are remaining 62 for (int i = 0; i < remainingRows.Length; i++) 63 remainingRows[i] = true; 64 } 65 return remainingRows; 66 } 40 67 41 68 #region Constructor, Cloning & Persistence
Note: See TracChangeset
for help on using the changeset viewer.