mahout-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grant Ingersoll <gsing...@apache.org>
Subject Re: Matrix and Vector classes: Read-only semantics
Date Fri, 19 Nov 2010 11:05:02 GMT

On Nov 19, 2010, at 4:28 AM, Lance Norskog wrote:

> I'm writing classes for read-only, repeatable random vector and and
> matrix. V[i] always returns the same number. M[i,j] always returns the
> same random number. I'm making a patch and will contribute when it
> gets some real-world testing.
> 
> These are the first read-only Vector and Matrix classes. There were a
> few hiccups. The only real problem I encountered was Vector.like() and
> Matrix.like().
> 
> The javadoc is:
>           Return an empty vector/matrix of the same underlying class
> as the receiver.
> 
> Here's the problem: "empty" means writable. A read-only class cannot
> do this. I think the semantics meant are: "return a writable Vector
> with the same dense/sparse styleas this Vector": a dense read-only
> vector class would create a DenseVector, for example.
> 
> Yes? No?

I believe so, but it also is the same size as the original, too, and has the same other properties
w/ the exception of the actual data.  
Mime
View raw message