mahout-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robin Anil <robin.a...@gmail.com>
Subject Re: Profiling SequentialAccessSparseVector
Date Sat, 20 Feb 2010 16:05:18 GMT
Adding to that current tests dont cover all cases and at all levels of
sparseness and across multiple implementations
Seq.fn(Rand)
Rand.fn(Dense) and so on, so need to add a framework which does that

Robin

On Sat, Feb 20, 2010 at 9:10 PM, Jake Mannix <jake.mannix@gmail.com> wrote:

> On Sat, Feb 20, 2010 at 7:27 AM, Robin Anil <robin.anil@gmail.com> wrote:
> >
> > > And we do have v1.plus() vs. v1.plusMutable() - the latter is addTo().
> > >
> >  What about other things like minus, divide etc etc
> >
> >
> Those methods all return copies, and the mutable versions are simply
> generalizations of the fact that
>
>  v.addTo(w) is just shorthand for w.assign(v, Functions.plus);
>
>  Vector.assign(Vector v, BinaryFunctin map), with map chosen to be
> Functions.minus, Functions.div, etc, does what you want.
>
> The only trick here is we need another flag to the assign method saying
> whether iteration should be sparse or not, because unlike for
> UnaryFunction,
> which you can tell should be sparse or not by checking apply(0) == 0,
> there's no canonical way to tell whether BinaryFunction.apply(x,0) = 0
> for all x.  So either we need BinaryFunction itself to have some way of
> notifying this ( like say a marker interface: ZeroPreservingBinaryFunction
> )
> or we need an optional boolean flag in this method, otherwise this method
> has to use dense iteration.
>
>  -jake
>

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