Advertisement
Guest User

Untitled

a guest
May 27th, 2015
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. class Analyzer(private val outlierFilter: Seq[Double] => Seq[Double]) {
  2. def analyze(inputs: Seq[Double]): BasicStats = {
  3. val filteredInputs = outlierFilter(inputs)
  4. // TODO: implement stub
  5. null
  6. }
  7. }
  8.  
  9. object Analyzer extends App {
  10.  
  11. def filterNothing(inputs: Seq[Double]): Seq[Double] = inputs
  12. def filterStandard(inputs: Seq[Double]): Seq[Double] = {
  13. // TODO: implement stub
  14. inputs
  15. }
  16. def filterAggressive(inputs: Seq[Double]): Seq[Double] = {
  17. // TODO: implement stub
  18. inputs
  19. }
  20.  
  21. val inputs = Seq(1.2, 3.6, 2.1, 14738.3)
  22.  
  23. val analyzer1 = new Analyzer(filterNothing)
  24. val stats1 = analyzer1.analyze(inputs)
  25.  
  26. val analyzer2 = new Analyzer(filterStandard)
  27. val stats2 = analyzer2.analyze(inputs)
  28.  
  29. val analyzer3 = new Analyzer(filterAggressive)
  30. val stats3 = analyzer3.analyze(inputs)
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement