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.
build() method is called.-
Nested Class Summary
Nested classes/interfaces inherited from interface Mutate1D
Mutate1D.SortableNested classes/interfaces inherited from interface Mutate2D
Mutate2D.Exchangeable, Mutate2D.Fillable<N>, Mutate2D.Mixable<N>, Mutate2D.Modifiable<N>, Mutate2D.ModifiableReceiver<N>, Mutate2D.Receiver<N>Nested classes/interfaces inherited from interface Structure1D
Structure1D.BasicMapper<T>, Structure1D.IndexMapper<T>, Structure1D.IntIndex, Structure1D.Logical<S,B>, Structure1D.LongIndex, Structure1D.LoopCallback Nested classes/interfaces inherited from interface Structure2D
Structure2D.IntRowColumn, Structure2D.Logical<S,B>, Structure2D.LongRowColumn, Structure2D.ReducibleTo1D<R>, Structure2D.Reshapable, Structure2D.RowColumnKey<R, C>, Structure2D.RowColumnMapper<R, C> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intprivate final Set<EntryPair.KeyedPrimitive<Comparable<?>>> private final PhysicalStore.Factory<N, ?> private final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()intintvoidset(int row, int col, double value) voidset(long row, long col, Comparable<?> value) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Mutate2D
set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, setMethods inherited from interface Structure2D
count, countColumns, countRows, firstInColumn, firstInRow, getMaxDim, getMinDim, isEmpty, isFat, isScalar, isSquare, isTall, isVector, limitOfColumn, limitOfRow, size
-
Field Details
-
myColDim
private final int myColDim -
myElements
-
myPhysicalFactory
-
myRowDim
private final int myRowDim
-
-
Constructor Details
-
Builder
Builder(PhysicalStore.Factory<N, ?> physicalFactory, int rowDim, int colDim)
-
-
Method Details
-
build
- Specified by:
buildin interfaceFactory2D.Builder<N extends Comparable<N>>
-
getColDim
public int getColDim()- Specified by:
getColDimin interfaceStructure2D- Returns:
- The number of columns
-
getRowDim
public int getRowDim()- Specified by:
getRowDimin interfaceStructure2D- Returns:
- The number of rows
-
set
-
set
-