Changeset 10802


Ignore:
Timestamp:
05/07/14 10:27:44 (5 years ago)
Author:
mleitner
Message:

Refactoring

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/FilterLogic.cs

    r10785 r10802  
    4343       }
    4444
    45        bool[] result = Enumerable.Repeat<bool>(true, preprocessingData.Rows).ToArray();
     45       bool[] result = TrueBoolArray(preprocessingData.Rows);
     46
    4647         foreach (IFilter filter in activeFilters)
    4748         {
     
    4950           for (int row = 0; row < result.Length; ++row)
    5051           {
    51              result[row] = isAndCombination ?  result[row] && filterResult[row] : result[row] || filterResult[row];
     52             result[row] = Result(result[row], filterResult[row], isAndCombination);
    5253           }
    5354         }
    54 
    5555
    5656        preprocessingData.SetFilter(result);
    5757       
    5858        return result;
     59    }
     60
     61    public bool[] TrueBoolArray(int rows) {
     62      return Enumerable.Repeat<bool>(true, rows).ToArray();
     63    }
     64
     65    public bool Result(bool current, bool addition, bool isAndCombination) {
     66      return isAndCombination ? current && addition : current || addition;
    5967    }
    6068
Note: See TracChangeset for help on using the changeset viewer.