scalanlp/breeze — pull request #194 by ktakagaki (2014-03-13 15:34:15+00:00)
Title: minMax

Added a minMax() function, copied off ptp()

1. a lot of code for `class SumVisitor extends ValuesVisitor[S]` is duplicated from ptp, since `@expand` doesn't seem to work with classes

2. I wrote tests for `min`/`max`/`ptp`/`minMax`, and found a bug in `ptp`... the intial values for min/max were being initialized for `Int` with `min = - Int.MinValue` and `max = Int.MinValue`, but - Int.MinValue is actually larger than `Int.MaxValue`, so it wraps around, becomes negative, and `ptp` was giving the wrong result. Fixed... fortunately, `ptp` does not seem to be used elsewhere, at least in the `breeze` package.

3. Is the method `zeros()` in `ValuesVisitor[S]` necessary? IntelliJ is telling me that it is never called in the package...

Kenta