Skip to content

Commit

Permalink
Added ability to create arbitrary reducers from the Reducer object …
Browse files Browse the repository at this point in the history
…in dynaml-pipes module
  • Loading branch information
mandar2812 committed Dec 21, 2016
1 parent eb82d45 commit 1058d26
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,11 @@ object Reducer {
* Represents product of values
* */
val :*: = ProductReducer

/**
* Create an arbitrary reducer
* */
def apply(reducerFunc: (Array[Double]) => Double): Reducer = new Reducer {
override def run(data: Array[Double]) = reducerFunc(data)
}
}

0 comments on commit 1058d26

Please sign in to comment.