Great, I will update it to ListBuffer later today and update the pull req!

On Jul 7, 2013, at 11:22 AM, Mark Hamstra <notifications@github.com> wrote:

> In mllib/src/main/scala/spark/mllib/regression/RidgeRegression.scala:
> 
> > -      val highValue = crossValidate((high - mid) / 2 + mid)
> > -      val (newLow, newHigh) = if (lowValue._2 < highValue._2) {
> > -        (low, mid + (high-low)/4)
> > -      } else {
> > -        (mid - (high-low)/4, high)
> > -      }
> > -      if (newHigh - newLow > 1.0E-7) {
> > -        // :: is list prepend in Scala.
> > -        lowValue :: highValue :: binSearch(newLow, newHigh)
> > -      } else {
> > -        List(lowValue, highValue)
> > +      @tailrec
> > +      def loop(
> > +        low: Double,
> > +        high: Double,
> > +        acc: List[(Double, Double, DoubleMatrix)]): List[(Double, Double, DoubleMatrix)] = {
> Which then raises the question of whether the sort should be incorporated into binSearch, or whether there might be future uses of binSearch that will prefer unsorted output. The latter seems unlikely given that binSearch is a nested method.
> 
> —
> Reply to this email directly or view it on GitHub.