On Sat, Oct 3, 2009 at 7:44 AM, Sean Owen <[email protected]> wrote: > I looked at the APIs just now and thought they were pretty good -- > yes, RealVector seems a little overdone perhaps. It does seem more > complete and planned than the serviceable but ad-hoc APIs developed in > Mahout to date. But implementations are provided no? It does make the > job of writing a Writable wrapper implementation a little harder but > hey in my IDE it's still one click to create the skeleton. >
Some of RealVector is bad because of the silly mapXXX/mapXXXtoSelf which should be replaced with (like our own) map(UnaryFunction f) / mapToSelf(UnaryFunction f), which isn't so bad, just ugly. What's more problematic is that Vector doesn't have any iterator methods, either dense or nonZero. This means we have to subclass as well as wrap, which is a total pain. They also don't have the equivalent of the OrderedIntDoubleVector that Ted has in his patch ( MAHOUT-165 ), which is definitely by far the fastest implementation of immutable sparse vectors which don't need random access. We can always add that however, not a big problem. Our apis currently may be "ad-hoc", but as someone who's had to write a vector api quite a few times in my life now, I like the one you guys came up with here a lot better than the one in cmath (not quite as nice as Colt's, but with better names). -jake
