You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mahout.apache.org by Benson Margulies <bi...@gmail.com> on 2009/05/30 03:23:39 UTC

DenseMatrix and [][]

Folks,

In my experience, you can save a good deal of memory and some time by
implementing a 2d matrix as a single vector and some multiplication, instead
of the [][] resulting in a vector of pointers to vectors. Would a patch for
this purpose be viewed as helpful, or was my experience anomalous?

--benson

Re: DenseMatrix and [][]

Posted by Grant Ingersoll <gs...@apache.org>.
+1

On May 30, 2009, at 3:15 AM, Ted Dunning wrote:

> I would hold off a bit on much in the way of rewriting matrix and  
> vector
> code unless there is something truly hideous.  MTJ (roughly the best  
> linear
> algebra code for Java) is in the process of merging with  
> commons.math and
> very shortly the result will be much better than anything we have or  
> are
> likely to be able to write in the near future.  At that point, it  
> would
> behoove us to see if we can use their stuff instead of ours.
>
> On Sat, May 30, 2009 at 12:10 AM, Sean Owen <sr...@gmail.com> wrote:
>
>> I agree it would be an improvement -- seems like it wouldn't save
>> *that* much memory (about 12 bytes times number of rows?) but could
>> see it being a useful improvement on both counts at large scale. I am
>> all for it; think we need to start looking at how much of that core
>> code can be optimized.
>>
>> On Sat, May 30, 2009 at 2:23 AM, Benson Margulies <bimargulies@gmail.com 
>> >
>> wrote:
>>> Folks,
>>>
>>> In my experience, you can save a good deal of memory and some time  
>>> by
>>> implementing a 2d matrix as a single vector and some multiplication,
>> instead
>>> of the [][] resulting in a vector of pointers to vectors. Would a  
>>> patch
>> for
>>> this purpose be viewed as helpful, or was my experience anomalous?
>>>
>>> --benson
>>>

Re: DenseMatrix and [][]

Posted by Ted Dunning <te...@gmail.com>.
I would hold off a bit on much in the way of rewriting matrix and vector
code unless there is something truly hideous.  MTJ (roughly the best linear
algebra code for Java) is in the process of merging with commons.math and
very shortly the result will be much better than anything we have or are
likely to be able to write in the near future.  At that point, it would
behoove us to see if we can use their stuff instead of ours.

On Sat, May 30, 2009 at 12:10 AM, Sean Owen <sr...@gmail.com> wrote:

> I agree it would be an improvement -- seems like it wouldn't save
> *that* much memory (about 12 bytes times number of rows?) but could
> see it being a useful improvement on both counts at large scale. I am
> all for it; think we need to start looking at how much of that core
> code can be optimized.
>
> On Sat, May 30, 2009 at 2:23 AM, Benson Margulies <bi...@gmail.com>
> wrote:
> > Folks,
> >
> > In my experience, you can save a good deal of memory and some time by
> > implementing a 2d matrix as a single vector and some multiplication,
> instead
> > of the [][] resulting in a vector of pointers to vectors. Would a patch
> for
> > this purpose be viewed as helpful, or was my experience anomalous?
> >
> > --benson
> >
>



-- 
Ted Dunning, CTO
DeepDyve

111 West Evelyn Ave. Ste. 202
Sunnyvale, CA 94086
http://www.deepdyve.com
858-414-0013 (m)
408-773-0220 (fax)

Re: DenseMatrix and [][]

Posted by Sean Owen <sr...@gmail.com>.
I agree it would be an improvement -- seems like it wouldn't save
*that* much memory (about 12 bytes times number of rows?) but could
see it being a useful improvement on both counts at large scale. I am
all for it; think we need to start looking at how much of that core
code can be optimized.

On Sat, May 30, 2009 at 2:23 AM, Benson Margulies <bi...@gmail.com> wrote:
> Folks,
>
> In my experience, you can save a good deal of memory and some time by
> implementing a 2d matrix as a single vector and some multiplication, instead
> of the [][] resulting in a vector of pointers to vectors. Would a patch for
> this purpose be viewed as helpful, or was my experience anomalous?
>
> --benson
>