Package org.ojalgo.matrix.store
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 org.ojalgo.structure.Mutate1D
Mutate1D.Sortable
Nested classes/interfaces inherited from interface org.ojalgo.structure.Mutate2D
Mutate2D.Exchangeable, Mutate2D.Fillable<N extends Comparable<N>>, Mutate2D.Mixable<N extends Comparable<N>>, Mutate2D.Modifiable<N extends Comparable<N>>, Mutate2D.ModifiableReceiver<N extends Comparable<N>>, Mutate2D.Receiver<N extends Comparable<N>>
Nested classes/interfaces inherited from interface org.ojalgo.structure.Structure1D
Structure1D.BasicMapper<T>, Structure1D.IndexMapper<T>, Structure1D.IntIndex, Structure1D.Logical<S extends Structure1D,
B extends Structure1D.Logical<S, B>>, Structure1D.LongIndex, Structure1D.LoopCallback Nested classes/interfaces inherited from interface org.ojalgo.structure.Structure2D
Structure2D.IntRowColumn, Structure2D.Logical<S extends Structure2D,
B extends Structure2D.Logical<S, B>>, Structure2D.LongRowColumn, Structure2D.ReducibleTo1D<R extends Structure1D>, Structure2D.Reshapable, Structure2D.RowColumnKey<R, C>, Structure2D.RowColumnMapper<R, C> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
private final Set
<EntryPair.KeyedPrimitive<Comparable<?>>> private final PhysicalStore.Factory
<N, ?> private final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
int
int
void
set
(int row, int col, double value) void
set
(long row, long col, Comparable<?> value) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ojalgo.structure.Mutate2D
set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set
Methods inherited from interface org.ojalgo.structure.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:
build
in interfaceFactory2D.Builder<N extends Comparable<N>>
-
getColDim
public int getColDim()- Specified by:
getColDim
in interfaceStructure2D
- Returns:
- The number of columns
-
getRowDim
public int getRowDim()- Specified by:
getRowDim
in interfaceStructure2D
- Returns:
- The number of rows
-
set
public void set(int row, int col, double value) -
set
-