You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hama.apache.org by Yexi Jiang <ye...@gmail.com> on 2013/06/13 22:32:45 UTC

About Vector/Matrix operation

I read some of the code from apache mahout and find that their
Vector/Matrix contain some useful methods. These methods borrow the style
of functional programming by allowing a function to apply to all the
elements of a Vector/Matrix.

For example, given a matrix m, if we want to apply a function f(x) to all
the elements, we can simply use *m.assign(DoubleDoubleFunction f)* instead
of a nested loop. This style can simply the coding, especially for those
algorithms where Vector/Matrix operations are heavily used.

I'm wondering can we also add such methods as well as the associated
classes?

Regards,
Yexi

Re: About Vector/Matrix operation

Posted by "Edward J. Yoon" <ed...@apache.org>.
Yes we can.

On Fri, Jun 14, 2013 at 5:32 AM, Yexi Jiang <ye...@gmail.com> wrote:
> I read some of the code from apache mahout and find that their
> Vector/Matrix contain some useful methods. These methods borrow the style
> of functional programming by allowing a function to apply to all the
> elements of a Vector/Matrix.
>
> For example, given a matrix m, if we want to apply a function f(x) to all
> the elements, we can simply use *m.assign(DoubleDoubleFunction f)* instead
> of a nested loop. This style can simply the coding, especially for those
> algorithms where Vector/Matrix operations are heavily used.
>
> I'm wondering can we also add such methods as well as the associated
> classes?
>
> Regards,
> Yexi



--
Best Regards, Edward J. Yoon
@eddieyoon