Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/23/14 15:51:41 (10 years ago)
Author:
psteiner
Message:

filter or combination
filter control: checkedlistview

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  
    128128                }
    129129
    130                 result[row] = base.Check(item);
     130                result[row] = !base.Check(item);
    131131            }
    132132
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/FilterLogic.cs

    r10783 r10785  
    3535    }
    3636
    37     public bool[] Preview(IList<IFilter> filters)
     37    public bool[] Preview(IList<IFilter> filters, bool isAndCombination)
    3838    {
    3939       IList<IFilter> activeFilters = filters.Where(f => f.Active && f.ConstraintData != null).ToList<IFilter>();
     
    4444
    4545       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         }
    4654
    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         }
    5555
    5656        preprocessingData.SetFilter(result);
     
    5959    }
    6060
    61     public void Apply(IList<IFilter> filters)
     61    public void Apply(IList<IFilter> filters, bool isAndCombination)
    6262    {
    63         preprocessingData.SetFilter(Preview(filters));
     63        preprocessingData.SetFilter(Preview(filters, isAndCombination));
    6464        preprocessingData.PersistFilter();
    6565    }
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IFilterLogic.cs

    r10638 r10785  
    2424namespace HeuristicLab.DataPreprocessing {
    2525  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);
    2828    IPreprocessingData PreprocessingData{get;}
     29    void Reset();
    2930  }
    3031}
Note: See TracChangeset for help on using the changeset viewer.