Wednesday, 11 September 2013

Overriding Ordering[Int] in Scala

Overriding Ordering[Int] in Scala

I'm trying to sort an array of integers with a custom ordering.
E.g.
quickSort[Int](indices)(Ordering.by[Int, Double](value(_)))
Basically, I'm trying to sort indices of rows by the values of a
particular column. I end up with a stackoverflow error when I run this on
a fairly large data. If I use a more direct approach (e.g. sorting Tuple),
this is not a problem.
Is there a problem if you try to extend the default Ordering[Int]?

No comments:

Post a Comment