Class DenseMutator2D<N extends Comparable<N>, M extends BasicMatrix<N,M> >
java.lang.Object
org.ojalgo.matrix.DenseMutator2D<N,M>
- All Implemented Interfaces:
Consumer<Access2D<?>>, Supplier<M>, Access1D<N>, Access2D<N>, Access2D.Collectable<N, TransformableRegion<N>>, Factory2D.Builder<M>, Mutate1D, Mutate1D.Fillable<N>, Mutate1D.Modifiable<N>, Mutate2D, Mutate2D.Exchangeable, Mutate2D.Fillable<N>, Mutate2D.Modifiable<N>, Mutate2D.ModifiableReceiver<N>, Mutate2D.Receiver<N>, Structure1D, Structure2D
- Direct Known Subclasses:
MatrixC128.DenseReceiver, MatrixH256.DenseReceiver, MatrixQ128.DenseReceiver, MatrixR032.DenseReceiver, MatrixR064.DenseReceiver, MatrixR128.DenseReceiver
abstract class DenseMutator2D<N extends Comparable<N>, M extends BasicMatrix<N,M>>
extends Object
implements Mutate2D.ModifiableReceiver<N>, Supplier<M>, Access2D.Collectable<N, TransformableRegion<N>>, Factory2D.Builder<M>
-
Nested Class Summary
Nested classes/interfaces inherited from interface Access2D
Access2D.Aggregatable<N>, Access2D.Collectable<N,R>, Access2D.ColumnView<N>, Access2D.ElementView<N>, Access2D.RowView<N>, Access2D.SelectionView<N>, Access2D.Sliceable<N>, Access2D.Visitable<N> Nested classes/interfaces inherited from interface Mutate1D
Mutate1D.Fillable<N>, Mutate1D.Mixable<N>, Mutate1D.Modifiable<N>, Mutate1D.ModifiableReceiver<N>, Mutate1D.Receiver<N>, 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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidadd(int row, int col, double value) voidadd(long index, double addend) voidadd(long row, long col, double value) voidadd(long row, long col, Comparable<?> value) voidadd(long index, Comparable<?> addend) build()longcount()count() == countRows() * countColumns()longOnly need to implement if the structure may contain more than Integer.MAX_VALUE elements.longOnly need to implement if the structure may contain more than Integer.MAX_VALUE elements.doubledoubleValue(int row, int col) Extracts one element of this matrix as a double.voidexchangeColumns(long colA, long colB) voidexchangeRows(long rowA, long rowB) voidvoidfillAll(NullaryFunction<?> supplier) voidfillColumn(long row, long column, N value) voidfillColumn(long row, long col, NullaryFunction<?> supplier) voidfillColumn(long row, long col, Access1D<N> values) voidfillColumn(long col, N value) voidfillColumn(long col, NullaryFunction<?> supplier) voidfillColumn(long col, Access1D<N> values) voidfillDiagonal(long row, long column, N value) voidfillDiagonal(long row, long col, NullaryFunction<?> supplier) voidfillDiagonal(long row, long col, Access1D<N> values) voidfillDiagonal(N value) voidfillDiagonal(NullaryFunction<?> supplier) voidfillDiagonal(Access1D<N> values) voidfillMatching(UnaryFunction<N> function, Access1D<N> arguments) voidfillMatching(Access1D<?> values) Will fill the elements of [this] with the corresponding input values, and in the process (if necessary) convert the elements to the correct type:this(i) = values(i)voidfillMatching(Access1D<N> left, BinaryFunction<N> function, Access1D<N> right) voidvoidfillRange(long first, long limit, NullaryFunction<?> supplier) voidvoidfillRow(long row, long col, NullaryFunction<?> supplier) voidvoidvoidfillRow(long row, NullaryFunction<?> supplier) voidget()get(long row, long col) intint(package private) abstract Minstantiate(MatrixStore<N> store) voidmodifyAll(UnaryFunction<N> modifier) voidmodifyAny(Transformation2D<N> modifier) voidmodifyColumn(long row, long col, UnaryFunction<N> modifier) voidmodifyColumn(long col, UnaryFunction<N> modifier) voidmodifyCompatible(BinaryFunction<N> operator, Access2D<N> right) voidmodifyCompatible(Access2D<N> left, BinaryFunction<N> operator) The "compatible" part of the method name references MATLAB's terminology "Compatible Array Sizes".voidmodifyDiagonal(long row, long col, UnaryFunction<N> modifier) voidmodifyDiagonal(UnaryFunction<N> modifier) voidmodifyMatching(BinaryFunction<N> function, Access1D<N> right) voidmodifyMatching(Access1D<N> left, BinaryFunction<N> function) voidmodifyMatchingInColumns(BinaryFunction<N> function, Access1D<N> right) Same asMutate2D.Modifiable.modifyMatchingInColumns(Access1D, BinaryFunction)but with the arguments to the modifier function swapped.voidmodifyMatchingInColumns(Access1D<N> left, BinaryFunction<N> function) "Matching In Columns" refers to that the supplied, left, data structure will be treated as a column, matching the columns of this structure.voidmodifyMatchingInRows(BinaryFunction<N> function, Access1D<N> right) Same asMutate2D.Modifiable.modifyMatchingInRows(Access1D, BinaryFunction)but with the arguments to the modifier function swapped.voidmodifyMatchingInRows(Access1D<N> left, BinaryFunction<N> function) Same asMutate2D.Modifiable.modifyMatchingInColumns(Access1D, BinaryFunction)but now the supplied left data structure is treated as a row.voidmodifyOne(long row, long col, UnaryFunction<N> modifier) voidmodifyOne(long index, UnaryFunction<N> modifier) voidmodifyRange(long first, long limit, UnaryFunction<N> modifier) voidmodifyRow(long row, long col, UnaryFunction<N> modifier) voidmodifyRow(long row, UnaryFunction<N> modifier) voidreset()Reset this mutable structure to some standard (all zeros) initial state.voidset(int row, int col, double value) voidset(long index, double value) voidset(long row, long col, Comparable<?> value) voidset(long index, Comparable<?> value) intsize()size() == getRowDim() * getColDim()voidsupplyTo(TransformableRegion<N> receiver) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Access1D
asCollectable1D, asKeyed1D, asList, axpy, dot, select, supplyTo, toList, toRawCopy1DMethods inherited from interface Access2D
asCollectable2D, asKeyed2D, byteValue, byteValue, byteValue, byteValue, columns, columns, columns, doubleValue, doubleValue, doubleValue, elements, floatValue, floatValue, floatValue, floatValue, get, intValue, intValue, intValue, intValue, longValue, longValue, longValue, longValue, nonzeros, rows, rows, rows, select, select, shortValue, shortValue, shortValue, shortValue, toRawCopy2DMethods inherited from interface Access2D.Collectable
collectMethods inherited from interface Mutate1D.Fillable
fillCompatible, fillMatchingMethods 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, setMethods inherited from interface Mutate2D.Fillable
fillCompatibleMethods inherited from interface Mutate2D.Modifiable
add, add, add, add, add, add, add, add, add, add, addMethods inherited from interface Mutate2D.Receiver
isAcceptableMethods inherited from interface Structure2D
firstInColumn, firstInRow, getMaxDim, getMinDim, isEmpty, isFat, isScalar, isSquare, isTall, isVector, limitOfColumn, limitOfRow
-
Field Details
-
myDelegate
-
mySafe
private boolean mySafe
-
-
Constructor Details
-
DenseMutator2D
DenseMutator2D(PhysicalStore<N> delegate)
-
-
Method Details
-
accept
- Specified by:
acceptin interfaceConsumer<N extends Comparable<N>>- Specified by:
acceptin interfaceMutate2D.Receiver<N extends Comparable<N>>
-
add
public void add(int row, int col, double value) - Specified by:
addin interfaceMutate2D.Modifiable<N extends Comparable<N>>
-
add
- Specified by:
addin interfaceMutate1D.Modifiable<N extends Comparable<N>>- Specified by:
addin interfaceMutate2D.Modifiable<N extends Comparable<N>>
-
add
public void add(long index, double addend) - Specified by:
addin interfaceMutate1D.Modifiable<N extends Comparable<N>>- Specified by:
addin interfaceMutate2D.Modifiable<N extends Comparable<N>>
-
add
- Specified by:
addin interfaceMutate2D.Modifiable<N extends Comparable<N>>
-
add
public void add(long row, long col, double value) - Specified by:
addin interfaceMutate2D.Modifiable<N extends Comparable<N>>
-
build
- Specified by:
buildin interfaceFactory2D.Builder<N extends Comparable<N>>
-
count
public long count()Description copied from interface:Structure2Dcount() == countRows() * countColumns()- Specified by:
countin interfaceStructure1D- Specified by:
countin interfaceStructure2D
-
countColumns
public long countColumns()Description copied from interface:Structure2DOnly need to implement if the structure may contain more than Integer.MAX_VALUE elements.- Specified by:
countColumnsin interfaceStructure2D- Returns:
- The number of columns
-
countRows
public long countRows()Description copied from interface:Structure2DOnly need to implement if the structure may contain more than Integer.MAX_VALUE elements.- Specified by:
countRowsin interfaceStructure2D- Returns:
- The number of rows
-
doubleValue
public double doubleValue(int row, int col) Description copied from interface:Access2DExtracts one element of this matrix as a double.- Specified by:
doubleValuein interfaceAccess2D<N extends Comparable<N>>- Parameters:
row- A row index.col- A column index.- Returns:
- One matrix element
-
exchangeColumns
public void exchangeColumns(long colA, long colB) - Specified by:
exchangeColumnsin interfaceMutate2D.Exchangeable
-
exchangeRows
public void exchangeRows(long rowA, long rowB) - Specified by:
exchangeRowsin interfaceMutate2D.Exchangeable
-
fillAll
- Specified by:
fillAllin interfaceMutate1D.Fillable<N extends Comparable<N>>
-
fillAll
- Specified by:
fillAllin interfaceMutate1D.Fillable<N extends Comparable<N>>
-
fillColumn
- Specified by:
fillColumnin interfaceMutate2D.Fillable<N extends Comparable<N>>
-
fillColumn
- Specified by:
fillColumnin interfaceMutate2D.Fillable<N extends Comparable<N>>
-
fillColumn
- Specified by:
fillColumnin interfaceMutate2D.Fillable<N extends Comparable<N>>
-
fillColumn
- Specified by:
fillColumnin interfaceMutate2D.Fillable<N extends Comparable<N>>
-
fillColumn
- Specified by:
fillColumnin interfaceMutate2D.Fillable<N extends Comparable<N>>
-
fillColumn
- Specified by:
fillColumnin interfaceMutate2D.Fillable<N extends Comparable<N>>
-
fillDiagonal
- Specified by:
fillDiagonalin interfaceMutate2D.Fillable<N extends Comparable<N>>
-
fillDiagonal
- Specified by:
fillDiagonalin interfaceMutate2D.Fillable<N extends Comparable<N>>
-
fillDiagonal
- Specified by:
fillDiagonalin interfaceMutate2D.Fillable<N extends Comparable<N>>
-
fillDiagonal
- Specified by:
fillDiagonalin interfaceMutate2D.Fillable<N extends Comparable<N>>
-
fillDiagonal
- Specified by:
fillDiagonalin interfaceMutate2D.Fillable<N extends Comparable<N>>
-
fillDiagonal
- Specified by:
fillDiagonalin interfaceMutate2D.Fillable<N extends Comparable<N>>
-
fillMatching
Description copied from interface:Mutate1D.FillableWill fill the elements of [this] with the corresponding input values, and in the process (if necessary) convert the elements to the correct type:this(i) = values(i)- Specified by:
fillMatchingin interfaceMutate1D.Fillable<N extends Comparable<N>>
-
fillMatching
- Specified by:
fillMatchingin interfaceMutate1D.Fillable<N extends Comparable<N>>
-
fillMatching
- Specified by:
fillMatchingin interfaceMutate1D.Fillable<N extends Comparable<N>>
-
fillRange
- Specified by:
fillRangein interfaceMutate1D.Fillable<N extends Comparable<N>>
-
fillRange
- Specified by:
fillRangein interfaceMutate1D.Fillable<N extends Comparable<N>>
-
fillRow
- Specified by:
fillRowin interfaceMutate2D.Fillable<N extends Comparable<N>>
-
fillRow
- Specified by:
fillRowin interfaceMutate2D.Fillable<N extends Comparable<N>>
-
fillRow
- Specified by:
fillRowin interfaceMutate2D.Fillable<N extends Comparable<N>>
-
fillRow
- Specified by:
fillRowin interfaceMutate2D.Fillable<N extends Comparable<N>>
-
fillRow
- Specified by:
fillRowin interfaceMutate2D.Fillable<N extends Comparable<N>>
-
fillRow
- Specified by:
fillRowin interfaceMutate2D.Fillable<N extends Comparable<N>>
-
get
-
get
-
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
-
modifyAll
- Specified by:
modifyAllin interfaceMutate1D.Modifiable<N extends Comparable<N>>
-
modifyAny
- Specified by:
modifyAnyin interfaceMutate2D.ModifiableReceiver<N extends Comparable<N>>
-
modifyColumn
- Specified by:
modifyColumnin interfaceMutate2D.Modifiable<N extends Comparable<N>>
-
modifyColumn
- Specified by:
modifyColumnin interfaceMutate2D.Modifiable<N extends Comparable<N>>
-
modifyCompatible
Description copied from interface:Mutate2D.ModifiableReceiverThe "compatible" part of the method name references MATLAB's terminology "Compatible Array Sizes". Here the possible combinations are somewhat limited as 'this' is modified in-place.- Specified by:
modifyCompatiblein interfaceMutate2D.ModifiableReceiver<N extends Comparable<N>>
-
modifyCompatible
- Specified by:
modifyCompatiblein interfaceMutate2D.ModifiableReceiver<N extends Comparable<N>>
-
modifyDiagonal
- Specified by:
modifyDiagonalin interfaceMutate2D.Modifiable<N extends Comparable<N>>
-
modifyDiagonal
- Specified by:
modifyDiagonalin interfaceMutate2D.Modifiable<N extends Comparable<N>>
-
modifyMatching
- Specified by:
modifyMatchingin interfaceMutate1D.Modifiable<N extends Comparable<N>>
-
modifyMatching
- Specified by:
modifyMatchingin interfaceMutate1D.Modifiable<N extends Comparable<N>>
-
modifyMatchingInColumns
Description copied from interface:Mutate2D.Modifiable"Matching In Columns" refers to that the supplied, left, data structure will be treated as a column, matching the columns of this structure. Matching columns have the same number of rows.This method will modify all elements of this structure by applying the modifier function to each of them. The left/first argument to the modifier function is taken from the supplied data structure, and the row-index determines which element.
- Specified by:
modifyMatchingInColumnsin interfaceMutate2D.Modifiable<N extends Comparable<N>>
-
modifyMatchingInColumns
Description copied from interface:Mutate2D.ModifiableSame asMutate2D.Modifiable.modifyMatchingInColumns(Access1D, BinaryFunction)but with the arguments to the modifier function swapped.- Specified by:
modifyMatchingInColumnsin interfaceMutate2D.Modifiable<N extends Comparable<N>>
-
modifyMatchingInRows
Description copied from interface:Mutate2D.ModifiableSame asMutate2D.Modifiable.modifyMatchingInColumns(Access1D, BinaryFunction)but now the supplied left data structure is treated as a row. (Matching rows have the same number of columns.)- Specified by:
modifyMatchingInRowsin interfaceMutate2D.Modifiable<N extends Comparable<N>>
-
modifyMatchingInRows
Description copied from interface:Mutate2D.ModifiableSame asMutate2D.Modifiable.modifyMatchingInRows(Access1D, BinaryFunction)but with the arguments to the modifier function swapped.- Specified by:
modifyMatchingInRowsin interfaceMutate2D.Modifiable<N extends Comparable<N>>
-
modifyOne
- Specified by:
modifyOnein interfaceMutate2D.Modifiable<N extends Comparable<N>>
-
modifyOne
- Specified by:
modifyOnein interfaceMutate1D.Modifiable<N extends Comparable<N>>- Specified by:
modifyOnein interfaceMutate2D.Modifiable<N extends Comparable<N>>
-
modifyRange
- Specified by:
modifyRangein interfaceMutate1D.Modifiable<N extends Comparable<N>>
-
modifyRow
- Specified by:
modifyRowin interfaceMutate2D.Modifiable<N extends Comparable<N>>
-
modifyRow
- Specified by:
modifyRowin interfaceMutate2D.Modifiable<N extends Comparable<N>>
-
reset
-
set
-
set
-
set
-
set
-
size
public int size()Description copied from interface:Structure2Dsize() == getRowDim() * getColDim()- Specified by:
sizein interfaceStructure1D- Specified by:
sizein interfaceStructure2D
-
supplyTo
- Specified by:
supplyToin interfaceAccess2D.Collectable<N extends Comparable<N>, M extends BasicMatrix<N,M>>
-
instantiate
-