commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles Sadowski <gil...@harfang.homelinux.org>
Subject Re: [math] RealLinearOperator and AbstractRealMatrix
Date Thu, 14 Jul 2011 10:49:55 GMT
On Wed, Jul 13, 2011 at 03:01:09PM -0700, Ted Dunning wrote:
> Actually, this is a major issue.

Indeed, it is an important design issue.

> Take, for instance, the example of considering a Lucene index as a linear
> operator.  The number of rows is the number of documents (which is changing
> as documents are added) and the number of columns is the number of unique
> terms (which is also changing as documents are added).
> 
> Matrix multiplication consists of translating a (hopefully sparse) vector
> into a query, running the query and interpreting the result as a (sparse)
> vector.
> 
> This is just one of a host of similar application oriented definitions of a
> LinearOperator, none of which define the number of rows and columns at
> construction time.
> 
> I can still do a singular value decomposition of this linear operator

Eventually it seems to come down to a programming style issue. What you
expose above (the decomposition algorithm) uses _fixed_ dimensions; when you
need another object (with different dimensions) you'll create a new one.

Both approaches are possible for your use case. But what I think should be
avoided is several programming styles within a single library.
The abstract accessor style is uncommon in CM and in the "linear" package,
the implementations use this style for no good reason (as I've indicated in
my previous mail).


Regards,
Gilles

> On Wed, Jul 13, 2011 at 1:52 PM, Phil Steitz <phil.steitz@gmail.com> wrote:
> 
> > This is not a huge issue, though, so I can live with it if you feel
> > strongly that the fields should be persisted at the top level.
> >

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message