mahout-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jake Mannix <jake.man...@gmail.com>
Subject Re: Profiling SequentialAccessSparseVector
Date Fri, 19 Feb 2010 20:37:19 GMT
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.anil@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;
>  }
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message