commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luc Maisonobe <Luc.Maison...@free.fr>
Subject Re: [math] Questions about sparse implementations
Date Mon, 26 Jan 2009 18:54:16 GMT
Bill Barker a écrit :
> I've been working on a SparseRealVector that implements RealVector but is 
> backed by OpenIntToDoubleHashMap.  Unlike SparseRealMatrix, the goal is more 
> speed than space.  Mostly it is going well, but running into a few problems 
> where some RealVector methods are almost nonsensical for sparse vectors 
> (e.g. mapInvToSelf).
> 
> Since the default value of OpenIntToDoubleHashMap is final, this means that 
> I currently have to replace the map in this case (so it really isn't 'self' 
> afterwards).  So what i'm asking is if it is better to have the default 
> value mutable or to allow the backing to be replaced in a "*ToSelf" method. 

I suppose you are speaking about the missingEntries field of
OpenIntToDoubleHashMap ? I would prefer this field remains final. The
*ToSelf methods on the other hand really imply values can change, so
changing the underlying backing store seems fair.

Luc

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


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


Mime
View raw message