Another tidbit: The getDistanceSquared of AbstractVector is much faster than the overridden function of RandomAccessSparseVector
On Sat, Feb 20, 2010 at 5:10 AM, Robin Anil <robin.a...@gmail.com> wrote: > One more issue I found, > > The length squared is not reset to -1 after any mutable operation causing > incorrect length square to be used, messing up all distance measures and > hence clustering. I suspect the issues with fuzzy kmeans was due to this. > > Robin > > > > > > > On Sat, Feb 20, 2010 at 2:27 AM, Robin Anil <robin.a...@gmail.com> wrote: > >> Anyone wants to take a shot at it >> https://issues.apache.org/jira/browse/MAHOUT-300 . I am stuck with some >> work at the moment >> >> Robin >> >> >> On Sat, Feb 20, 2010 at 2:07 AM, Jake Mannix <jake.man...@gmail.com>wrote: >> >>> Yes, I have no idea why that is not implemented like you describe. It >>> should be. >>> >>> -jake >>> >>> On Fri, Feb 19, 2010 at 12:21 PM, Robin Anil <robin.a...@gmail.com> >>> wrote: >>> >>> > A question on the performance of AbstractVector operations like times >>> > >>> > public Vector times(double x) { >>> > Vector result = clone(); >>> > Iterator<Element> iter = iterateNonZero(); >>> > while (iter.hasNext()) { >>> > Element element = iter.next(); >>> > int index = element.index(); >>> > result.setQuick(index, element.get() * x); >>> > } >>> > return result; >>> > } >>> > >>> > shouldnt this be like the assign mult function. Would make a big diff >>> for >>> > SeqAccSparseVector right? >>> > >>> > public Vector times(double x) { >>> > Vector result = clone(); >>> > Iterator<Element> iter = *result.*iterateNonZero(); >>> > while (iter.hasNext()) { >>> > Element element = iter.next(); >>> > *element.set(element.get() * x);* >>> > } >>> > return result; >>> > } >>> > >>> >> >> >