# Package org.grouplens.lenskit.vectors

Sparse vectors and their operations.

See: Description

## Package org.grouplens.lenskit.vectors Description

Sparse vectors and their operations. Sparse vectors map arbitrary long keys to values sparsely and efficiently. The keys can be negative.

Sparse vectors come in three flavors. Read-only vectors (SparseVector); this type is the base of the remaining types for each vector, and provides a read-only interface to the vector. Immutable vectors (ImmutableSparseVector) are immutable and cannot be changed once created. They can also be freely shared between threads. Finally, mutable vectors (MutableSparseVector) are mutable and not thread-safe.

This design allows read-only operations to be performed on any type of vector, while allowing components to specifically work with and store vectors guaranteed to be immutable.

The Vectors class provides utility methods for working with vectors.