Sean Owen wrote:
SparseVector will materialize the entire array, including zero-valued elements. I'm not sure this would ever be a desired outcome and am ok removing the operation.While leafing through the Vector API today, I had a few questions...toArray() -- should we really have this? the values, without the dimensions/indices, don't seem necessarily meaningful. It is used in one place, DenseMatrix.assignRow(), but seems like there is a potential bug there. The way its used, assumes the vector is non-sparse.
get()/getQuick() -- can these be merged now? seems like we would rather not have this distinction.
The difference is getQuick does not check bounds.
copy() -- the semantics here seem identical to the standard clone() method on Object. Should we just switch to clone()?
IIRC, clone of a SparseVector would share the map. Not desirable IMHO.
Cardinality is the actual dimension and size is the current number of elements. It only differs from cardinality in the case of SparseVector, in which case size returns the number of non-zero elements.Also what is the intended difference between size and cardinality -- size is number of elements actually set to a non-zero value, cardinality is the actual dimension of the vector?
PGP.sig
Description: PGP signature