Class SparseStore.Builder<N extends Comparable<N>>

java.lang.Object
org.ojalgo.matrix.store.SparseStore.Builder<N>
All Implemented Interfaces:
Factory2D.Builder<SparseStore<N>>, Mutate1D, Mutate2D, Structure1D, Structure2D
Enclosing class:
SparseStore<N extends Comparable<N>>

public static final class SparseStore.Builder<N extends Comparable<N>> extends Object implements Factory2D.Builder<SparseStore<N>>
May be a preferable way to build a sparse matrix if:
  • You don't know the number of nonzero elements in advance.
  • Setting elements in strictly increasing column major order is not possible.
  • Multiple threads are used to set elements.
This builder uses separate/additional memory to store the elements before they are copied to the actual sparse matrix. The actual sparse matrix is built when the build() method is called.