Package org.ojalgo.matrix.store
Class Subregion2D.SynchronizedRegion<N extends java.lang.Comparable<N>>
- java.lang.Object
-
- org.ojalgo.matrix.store.Subregion2D<N>
-
- org.ojalgo.matrix.store.Subregion2D.SynchronizedRegion<N>
-
- All Implemented Interfaces:
java.util.function.Consumer<Access2D<?>>
,TransformableRegion<N>
,Access1D<N>
,Access2D<N>
,Mutate1D
,Mutate1D.Fillable<N>
,Mutate1D.Modifiable<N>
,Mutate2D
,Mutate2D.Exchangeable
,Mutate2D.Fillable<N>
,Mutate2D.Modifiable<N>
,Mutate2D.ModifiableReceiver<N>
,Mutate2D.Receiver<N>
,Structure1D
,Structure2D
- Enclosing class:
- Subregion2D<N extends java.lang.Comparable<N>>
static final class Subregion2D.SynchronizedRegion<N extends java.lang.Comparable<N>> extends Subregion2D<N>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.ojalgo.matrix.store.Subregion2D
Subregion2D.ColumnsRegion<N extends java.lang.Comparable<N>>, Subregion2D.LimitRegion<N extends java.lang.Comparable<N>>, Subregion2D.OffsetRegion<N extends java.lang.Comparable<N>>, Subregion2D.RowsRegion<N extends java.lang.Comparable<N>>, Subregion2D.SynchronizedRegion<N extends java.lang.Comparable<N>>, Subregion2D.TransposedRegion<N extends java.lang.Comparable<N>>, Subregion2D.WrapperRegion<N extends java.lang.Comparable<N>>
-
Nested classes/interfaces inherited from interface org.ojalgo.structure.Access2D
Access2D.Aggregatable<N extends java.lang.Comparable<N>>, Access2D.Collectable<N extends java.lang.Comparable<N>,R extends Mutate2D>, Access2D.ColumnView<N extends java.lang.Comparable<N>>, Access2D.ElementView<N extends java.lang.Comparable<N>>, Access2D.RowView<N extends java.lang.Comparable<N>>, Access2D.SelectionView<N extends java.lang.Comparable<N>>, Access2D.Sliceable<N extends java.lang.Comparable<N>>, Access2D.Visitable<N extends java.lang.Comparable<N>>
-
Nested classes/interfaces inherited from interface org.ojalgo.structure.Mutate1D
Mutate1D.Fillable<N extends java.lang.Comparable<N>>, Mutate1D.Mixable<N extends java.lang.Comparable<N>>, Mutate1D.Modifiable<N extends java.lang.Comparable<N>>, Mutate1D.ModifiableReceiver<N extends java.lang.Comparable<N>>, Mutate1D.Receiver<N extends java.lang.Comparable<N>>, Mutate1D.Sortable
-
Nested classes/interfaces inherited from interface org.ojalgo.structure.Mutate2D
Mutate2D.Exchangeable, Mutate2D.Fillable<N extends java.lang.Comparable<N>>, Mutate2D.Mixable<N extends java.lang.Comparable<N>>, Mutate2D.Modifiable<N extends java.lang.Comparable<N>>, Mutate2D.ModifiableReceiver<N extends java.lang.Comparable<N>>, Mutate2D.Receiver<N extends java.lang.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>
-
Nested classes/interfaces inherited from interface org.ojalgo.matrix.store.TransformableRegion
TransformableRegion.FillByMultiplying<N extends java.lang.Comparable<N>>
-
-
Field Summary
Fields Modifier and Type Field Description private TransformableRegion<N>
myDelegate
-
Constructor Summary
Constructors Constructor Description SynchronizedRegion(TransformableRegion<N> base)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(Access2D<?> supplied)
void
add(long index, byte addend)
void
add(long index, double addend)
void
add(long index, float addend)
void
add(long index, int addend)
void
add(long index, long addend)
void
add(long row, long col, byte addend)
void
add(long row, long col, double addend)
void
add(long row, long col, float addend)
void
add(long row, long col, int addend)
void
add(long row, long col, long addend)
void
add(long row, long col, short addend)
void
add(long row, long col, java.lang.Comparable<?> addend)
void
add(long index, short addend)
void
add(long index, java.lang.Comparable<?> addend)
java.util.function.Consumer<Access2D<?>>
andThen(java.util.function.Consumer<? super Access2D<?>> after)
<NN extends java.lang.Comparable<NN>,R extends Mutate1D.Receiver<NN>>
Access1D.Collectable<NN,R>asCollectable1D()
<NN extends java.lang.Comparable<NN>,R extends Mutate2D.Receiver<NN>>
Access2D.Collectable<NN,R>asCollectable2D()
<K> Keyed1D<K,N>
asKeyed1D(Structure1D.IndexMapper<K> indexMapper)
<R,C>
Keyed2D<R,C,N>asKeyed2D(Structure1D.IndexMapper<R> rowMapper, Structure1D.IndexMapper<C> columnMapper)
void
axpy(double a, Mutate1D.Modifiable<?> y)
Will calculate y = y + a x, will add "a" times "this" to "y"byte
byteValue(int index)
byte
byteValue(int row, int col)
byte
byteValue(long index)
byte
byteValue(long row, long col)
Access2D.ColumnView<N>
columns()
Access2D<N>
columns(int... columns)
Access2D<N>
columns(long... columns)
long
count()
count() == countRows() * countColumns()long
countColumns()
Only need to implement if the structure may contain more than Integer.MAX_VALUE elements.long
countRows()
Only need to implement if the structure may contain more than Integer.MAX_VALUE elements.double
dot(Access1D<?> vector)
Will calculate and return the dot product of this 1D-structure and another input 1D-vector.double
doubleValue(int index)
double
doubleValue(int row, int col)
Extracts one element of this matrix as a double.double
doubleValue(long index)
double
doubleValue(long row, long col)
ElementView2D<N,?>
elements()
Returns an Iterable of ElementView1D.void
exchangeColumns(long colA, long colB)
void
exchangeRows(long rowA, long rowB)
void
fillAll(N value)
void
fillAll(NullaryFunction<?> supplier)
void
fillColumn(long row, long col, N value)
void
fillColumn(long row, long col, NullaryFunction<?> supplier)
void
fillColumn(long row, long col, Access1D<N> values)
void
fillColumn(long col, N value)
void
fillColumn(long col, NullaryFunction<?> supplier)
void
fillColumn(long col, Access1D<N> values)
void
fillCompatible(Access1D<N> left, BinaryFunction<N> operator, Access1D<N> right)
void
fillCompatible(Access2D<N> left, BinaryFunction<N> operator, Access2D<N> right)
'this' needs to be of a size compatible with the 'left' and 'right' matrices.void
fillDiagonal(long row, long col, N value)
void
fillDiagonal(long row, long col, NullaryFunction<?> supplier)
void
fillDiagonal(long row, long col, Access1D<N> values)
void
fillDiagonal(N value)
void
fillDiagonal(NullaryFunction<?> supplier)
void
fillDiagonal(Access1D<N> values)
void
fillMatching(UnaryFunction<N> function, Access1D<N> arguments)
void
fillMatching(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:void
fillMatching(Access1D<N> left, BinaryFunction<N> function, Access1D<N> right)
void
fillRange(long first, long limit, N value)
void
fillRange(long first, long limit, NullaryFunction<?> supplier)
void
fillRow(long row, long col, N value)
void
fillRow(long row, long col, NullaryFunction<?> supplier)
void
fillRow(long row, long col, Access1D<N> values)
void
fillRow(long row, N value)
void
fillRow(long row, NullaryFunction<?> supplier)
void
fillRow(long row, Access1D<N> values)
int
firstInColumn(int col)
The default value is simply0
, and if all elements are zeros thenthis.countRows()
.int
firstInRow(int row)
The default value is simply0
, and if all elements are zeros thenthis.countColumns()
.float
floatValue(int index)
float
floatValue(int row, int col)
float
floatValue(long index)
float
floatValue(long row, long col)
N
get(long index)
N
get(long row, long col)
int
getColDim()
int
getMaxDim()
int
getMinDim()
int
getRowDim()
int
intValue(int index)
int
intValue(int row, int col)
int
intValue(long index)
int
intValue(long row, long col)
boolean
isAcceptable(Structure2D supplier)
boolean
isEmpty()
2D data structures are either square, tall, fat or empty.boolean
isFat()
2D data structures are either square, tall, fat or empty.boolean
isScalar()
boolean
isSquare()
2D data structures are either square, tall, fat or empty.boolean
isTall()
2D data structures are either square, tall, fat or empty.boolean
isVector()
int
limitOfColumn(int col)
The default value is simplythis.countRows()
, and if all elements are zeros then0
.int
limitOfRow(int row)
The default value is simplythis.countColumns()
, and if all elements are zeros then0
.long
longValue(int index)
long
longValue(int row, int col)
long
longValue(long index)
long
longValue(long row, long col)
void
modifyAll(UnaryFunction<N> modifier)
void
modifyAny(Transformation2D<N> modifier)
void
modifyColumn(long row, long col, UnaryFunction<N> modifier)
void
modifyColumn(long col, UnaryFunction<N> modifier)
void
modifyCompatible(BinaryFunction<N> operator, Access2D<N> right)
void
modifyCompatible(Access2D<N> left, BinaryFunction<N> operator)
The "compatible" part of the method name references MATLAB's terminology "Compatible Array Sizes".void
modifyDiagonal(long row, long col, UnaryFunction<N> modifier)
void
modifyDiagonal(UnaryFunction<N> modifier)
void
modifyMatching(BinaryFunction<N> function, Access1D<N> right)
void
modifyMatching(Access1D<N> left, BinaryFunction<N> function)
void
modifyMatchingInColumns(BinaryFunction<N> function, Access1D<N> right)
Same asMutate2D.Modifiable.modifyMatchingInColumns(Access1D, BinaryFunction)
but with the arguments to the modifier function swapped.void
modifyMatchingInColumns(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.void
modifyMatchingInRows(BinaryFunction<N> function, Access1D<N> right)
Same asMutate2D.Modifiable.modifyMatchingInRows(Access1D, BinaryFunction)
but with the arguments to the modifier function swapped.void
modifyMatchingInRows(Access1D<N> left, BinaryFunction<N> function)
Same asMutate2D.Modifiable.modifyMatchingInColumns(Access1D, BinaryFunction)
but now the supplied left data structure is treated as a row.void
modifyOne(long row, long col, UnaryFunction<N> modifier)
void
modifyOne(long index, UnaryFunction<N> modifier)
void
modifyRange(long first, long limit, UnaryFunction<N> modifier)
void
modifyRow(long row, long col, UnaryFunction<N> modifier)
void
modifyRow(long row, UnaryFunction<N> modifier)
ElementView2D<N,?>
nonzeros()
Similar toAccess1D.elements()
but avoids elements that are structurally known to be zero.TransformableRegion<N>
regionByTransposing()
void
reset()
Reset this mutable structure to some standard (all zeros) initial state.Access2D.RowView<N>
rows()
Access2D<N>
rows(int... rows)
Access2D<N>
rows(long... rows)
Access2D<N>
select(int[] rows, int[] columns)
Access1D<N>
select(long... selection)
Creates a view of the underlying data structure of only the selected elements.Access2D<N>
select(long[] rows, long[] columns)
Creates a view of the underlying data structure of only the selected elements.void
set(int index, byte value)
void
set(int index, double value)
void
set(int index, float value)
void
set(int index, int value)
void
set(int row, int col, byte value)
void
set(int row, int col, double value)
void
set(int row, int col, float value)
void
set(int row, int col, int value)
void
set(int row, int col, long value)
void
set(int row, int col, short value)
void
set(int index, long value)
void
set(int index, short value)
void
set(long index, byte value)
void
set(long index, double value)
void
set(long index, float value)
void
set(long index, int value)
void
set(long index, long value)
void
set(long row, long col, byte value)
void
set(long row, long col, double value)
void
set(long row, long col, float value)
void
set(long row, long col, int value)
void
set(long row, long col, long value)
void
set(long row, long col, short value)
void
set(long row, long col, java.lang.Comparable<?> value)
void
set(long index, short value)
void
set(long index, java.lang.Comparable<?> value)
short
shortValue(int index)
short
shortValue(int row, int col)
short
shortValue(long index)
short
shortValue(long row, long col)
int
size()
size() == getRowDim() * getColDim()void
supplyTo(double[] receiver)
double[]
toRawCopy1D()
double[][]
toRawCopy2D()
-
Methods inherited from class org.ojalgo.matrix.store.Subregion2D
fillByMultiplying, findMultiplier, regionByColumns, regionByLimits, regionByOffsets, regionByRows, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.ojalgo.matrix.store.TransformableRegion
synchronised
-
-
-
-
Field Detail
-
myDelegate
private final TransformableRegion<N extends java.lang.Comparable<N>> myDelegate
-
-
Constructor Detail
-
SynchronizedRegion
SynchronizedRegion(TransformableRegion<N> base)
-
-
Method Detail
-
accept
public void accept(Access2D<?> supplied)
-
add
public void add(long index, byte addend)
-
add
public void add(long index, java.lang.Comparable<?> addend)
-
add
public void add(long index, double addend)
-
add
public void add(long index, float addend)
-
add
public void add(long index, int addend)
-
add
public void add(long index, long addend)
-
add
public void add(long row, long col, byte addend)
-
add
public void add(long row, long col, java.lang.Comparable<?> addend)
-
add
public void add(long row, long col, double addend)
-
add
public void add(long row, long col, float addend)
-
add
public void add(long row, long col, int addend)
-
add
public void add(long row, long col, long addend)
-
add
public void add(long row, long col, short addend)
-
add
public void add(long index, short addend)
-
andThen
public java.util.function.Consumer<Access2D<?>> andThen(java.util.function.Consumer<? super Access2D<?>> after)
-
asCollectable1D
public <NN extends java.lang.Comparable<NN>,R extends Mutate1D.Receiver<NN>> Access1D.Collectable<NN,R> asCollectable1D()
Description copied from interface:Access1D
-
asCollectable2D
public <NN extends java.lang.Comparable<NN>,R extends Mutate2D.Receiver<NN>> Access2D.Collectable<NN,R> asCollectable2D()
-
asKeyed1D
public <K> Keyed1D<K,N> asKeyed1D(Structure1D.IndexMapper<K> indexMapper)
-
asKeyed2D
public <R,C> Keyed2D<R,C,N> asKeyed2D(Structure1D.IndexMapper<R> rowMapper, Structure1D.IndexMapper<C> columnMapper)
-
axpy
public void axpy(double a, Mutate1D.Modifiable<?> y)
Description copied from interface:Access1D
Will calculate y = y + a x, will add "a" times "this" to "y"- Parameters:
a
- The scaley
- The "vector" to update
-
byteValue
public byte byteValue(int index)
-
byteValue
public byte byteValue(int row, int col)
-
byteValue
public byte byteValue(long index)
-
byteValue
public byte byteValue(long row, long col)
-
columns
public Access2D.ColumnView<N> columns()
-
count
public long count()
Description copied from interface:Structure2D
count() == countRows() * countColumns()
-
countColumns
public long countColumns()
Description copied from interface:Structure2D
Only need to implement if the structure may contain more than Integer.MAX_VALUE elements.- Returns:
- The number of columns
-
countRows
public long countRows()
Description copied from interface:Structure2D
Only need to implement if the structure may contain more than Integer.MAX_VALUE elements.- Returns:
- The number of rows
-
dot
public double dot(Access1D<?> vector)
Description copied from interface:Access1D
Will calculate and return the dot product of this 1D-structure and another input 1D-vector.- Parameters:
vector
- Another 1D-structure- Returns:
- The dot product
-
doubleValue
public double doubleValue(int index)
-
doubleValue
public double doubleValue(int row, int col)
Description copied from interface:Access2D
Extracts one element of this matrix as a double.- Parameters:
row
- A row index.col
- A column index.- Returns:
- One matrix element
-
doubleValue
public double doubleValue(long index)
-
doubleValue
public double doubleValue(long row, long col)
-
elements
public ElementView2D<N,?> elements()
Description copied from interface:Access1D
Returns an Iterable of ElementView1D. It allows to iterate over the instance's element "positions" without actually extracting the elements (unless you explicitly do so).
-
exchangeColumns
public void exchangeColumns(long colA, long colB)
-
exchangeRows
public void exchangeRows(long rowA, long rowB)
-
fillAll
public void fillAll(N value)
-
fillAll
public void fillAll(NullaryFunction<?> supplier)
-
fillColumn
public void fillColumn(long row, long col, N value)
-
fillColumn
public void fillColumn(long row, long col, NullaryFunction<?> supplier)
-
fillColumn
public void fillColumn(long col, N value)
-
fillColumn
public void fillColumn(long col, NullaryFunction<?> supplier)
-
fillCompatible
public void fillCompatible(Access1D<N> left, BinaryFunction<N> operator, Access1D<N> right)
-
fillCompatible
public void fillCompatible(Access2D<N> left, BinaryFunction<N> operator, Access2D<N> right)
Description copied from interface:Mutate2D.Fillable
'this' needs to be of a size compatible with the 'left' and 'right' matrices. No checks are performed. The term "compatible" refers to MATLAB's rules for "array broadcasting". The result will be the same as if the 'left' and 'right' matrices where expanded (repeated) so that all three where of the same size, and then the operation was performed. The actual implementation may be more efficient than that.
-
fillDiagonal
public void fillDiagonal(long row, long col, N value)
-
fillDiagonal
public void fillDiagonal(long row, long col, NullaryFunction<?> supplier)
-
fillDiagonal
public void fillDiagonal(N value)
-
fillDiagonal
public void fillDiagonal(NullaryFunction<?> supplier)
-
fillMatching
public void fillMatching(Access1D<?> values)
Description copied from interface:Mutate1D.Fillable
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)
- Specified by:
fillMatching
in interfaceMutate1D.Fillable<N extends java.lang.Comparable<N>>
- Overrides:
fillMatching
in classSubregion2D<N extends java.lang.Comparable<N>>
-
fillMatching
public void fillMatching(Access1D<N> left, BinaryFunction<N> function, Access1D<N> right)
-
fillMatching
public void fillMatching(UnaryFunction<N> function, Access1D<N> arguments)
-
fillRange
public void fillRange(long first, long limit, N value)
-
fillRange
public void fillRange(long first, long limit, NullaryFunction<?> supplier)
-
fillRow
public void fillRow(long row, long col, N value)
-
fillRow
public void fillRow(long row, long col, NullaryFunction<?> supplier)
-
fillRow
public void fillRow(long row, N value)
-
fillRow
public void fillRow(long row, NullaryFunction<?> supplier)
-
firstInColumn
public int firstInColumn(int col)
Description copied from interface:Structure2D
The default value is simply0
, and if all elements are zeros thenthis.countRows()
.- Parameters:
col
- The column index- Returns:
- The row index of the first non-zero element in the specified column
-
firstInRow
public int firstInRow(int row)
Description copied from interface:Structure2D
The default value is simply0
, and if all elements are zeros thenthis.countColumns()
.- Returns:
- The column index of the first non-zero element in the specified row
-
floatValue
public float floatValue(int index)
-
floatValue
public float floatValue(int row, int col)
-
floatValue
public float floatValue(long index)
-
floatValue
public float floatValue(long row, long col)
-
get
public N get(long index)
-
get
public N get(long row, long col)
-
getColDim
public int getColDim()
- Returns:
- The number of columns
-
getMaxDim
public int getMaxDim()
-
getMinDim
public int getMinDim()
-
getRowDim
public int getRowDim()
- Returns:
- The number of rows
-
intValue
public int intValue(int index)
-
intValue
public int intValue(int row, int col)
-
intValue
public int intValue(long index)
-
intValue
public int intValue(long row, long col)
-
isAcceptable
public boolean isAcceptable(Structure2D supplier)
-
isEmpty
public boolean isEmpty()
Description copied from interface:Structure2D
2D data structures are either square, tall, fat or empty.m <= 0 or n <= 0
Historically some ojAlgo data structures did allow to create "empty" instances. Currently this is not encouraged, but still possible in some instances.- Returns:
- true if matrix is empty
-
isFat
public boolean isFat()
Description copied from interface:Structure2D
2D data structures are either square, tall, fat or empty.1 <= m < n
- Returns:
- true if matrix is fat
-
isScalar
public boolean isScalar()
- Returns:
- true if both the row and column dimensions are equal to 1.
-
isSquare
public boolean isSquare()
Description copied from interface:Structure2D
2D data structures are either square, tall, fat or empty.m = n <> 0
- Returns:
- true if matrix is square
-
isTall
public boolean isTall()
Description copied from interface:Structure2D
2D data structures are either square, tall, fat or empty.m < n >= 1
- Returns:
- true if matrix is tall
-
isVector
public boolean isVector()
- Returns:
- true if either the row or column dimensions are equal to 1.
-
limitOfColumn
public int limitOfColumn(int col)
Description copied from interface:Structure2D
The default value is simplythis.countRows()
, and if all elements are zeros then0
.- Returns:
- The row index of the first zero element, after all non-zeros, in the specified column (index of the last non-zero + 1)
-
limitOfRow
public int limitOfRow(int row)
Description copied from interface:Structure2D
The default value is simplythis.countColumns()
, and if all elements are zeros then0
.- Returns:
- The column index of the first zero element, after all non-zeros, in the specified row (index of the last non-zero + 1)
-
longValue
public long longValue(int index)
-
longValue
public long longValue(int row, int col)
-
longValue
public long longValue(long index)
-
longValue
public long longValue(long row, long col)
-
modifyAll
public void modifyAll(UnaryFunction<N> modifier)
-
modifyAny
public void modifyAny(Transformation2D<N> modifier)
-
modifyColumn
public void modifyColumn(long row, long col, UnaryFunction<N> modifier)
-
modifyColumn
public void modifyColumn(long col, UnaryFunction<N> modifier)
-
modifyCompatible
public void modifyCompatible(Access2D<N> left, BinaryFunction<N> operator)
Description copied from interface:Mutate2D.ModifiableReceiver
The "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.
-
modifyCompatible
public void modifyCompatible(BinaryFunction<N> operator, Access2D<N> right)
-
modifyDiagonal
public void modifyDiagonal(long row, long col, UnaryFunction<N> modifier)
-
modifyDiagonal
public void modifyDiagonal(UnaryFunction<N> modifier)
-
modifyMatching
public void modifyMatching(Access1D<N> left, BinaryFunction<N> function)
-
modifyMatching
public void modifyMatching(BinaryFunction<N> function, Access1D<N> right)
-
modifyMatchingInColumns
public void modifyMatchingInColumns(Access1D<N> left, BinaryFunction<N> function)
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.
-
modifyMatchingInColumns
public void modifyMatchingInColumns(BinaryFunction<N> function, Access1D<N> right)
Description copied from interface:Mutate2D.Modifiable
Same asMutate2D.Modifiable.modifyMatchingInColumns(Access1D, BinaryFunction)
but with the arguments to the modifier function swapped.
-
modifyMatchingInRows
public void modifyMatchingInRows(Access1D<N> left, BinaryFunction<N> function)
Description copied from interface:Mutate2D.Modifiable
Same 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.)
-
modifyMatchingInRows
public void modifyMatchingInRows(BinaryFunction<N> function, Access1D<N> right)
Description copied from interface:Mutate2D.Modifiable
Same asMutate2D.Modifiable.modifyMatchingInRows(Access1D, BinaryFunction)
but with the arguments to the modifier function swapped.
-
modifyOne
public void modifyOne(long row, long col, UnaryFunction<N> modifier)
-
modifyOne
public void modifyOne(long index, UnaryFunction<N> modifier)
-
modifyRange
public void modifyRange(long first, long limit, UnaryFunction<N> modifier)
-
modifyRow
public void modifyRow(long row, long col, UnaryFunction<N> modifier)
-
modifyRow
public void modifyRow(long row, UnaryFunction<N> modifier)
-
nonzeros
public ElementView2D<N,?> nonzeros()
Description copied from interface:Access1D
Similar toAccess1D.elements()
but avoids elements that are structurally known to be zero. (That does not eliminate all zero-values from this view.) With an arbitrary (dense) unstructured implementation theAccess1D.nonzeros()
andAccess1D.elements()
methods do the same thing! Only some specific implementations are able to actually exploit structure/sparsity to view fewer elements.
-
regionByTransposing
public TransformableRegion<N> regionByTransposing()
- Specified by:
regionByTransposing
in interfaceTransformableRegion<N extends java.lang.Comparable<N>>
- Overrides:
regionByTransposing
in classSubregion2D<N extends java.lang.Comparable<N>>
- Returns:
- A transposed consumer region
-
reset
public void reset()
Description copied from interface:Mutate1D
Reset this mutable structure to some standard (all zeros) initial state. It must still be usuable after this call, and the structure/size/shape must not change.
-
rows
public Access2D.RowView<N> rows()
-
select
public Access1D<N> select(long... selection)
Description copied from interface:Access1D
Creates a view of the underlying data structure of only the selected elements.
-
select
public Access2D<N> select(long[] rows, long[] columns)
Description copied from interface:Access2D
Creates a view of the underlying data structure of only the selected elements. If either the rows or columns input arguments are null or empty arrays, then that transaltes to all rows and/or columns.
-
set
public void set(int index, byte value)
-
set
public void set(int index, double value)
-
set
public void set(int index, float value)
-
set
public void set(int index, int value)
-
set
public void set(int row, int col, byte value)
-
set
public void set(int row, int col, double value)
-
set
public void set(int row, int col, float value)
-
set
public void set(int row, int col, int value)
-
set
public void set(int row, int col, long value)
-
set
public void set(int row, int col, short value)
-
set
public void set(int index, long value)
-
set
public void set(int index, short value)
-
set
public void set(long index, byte value)
-
set
public void set(long index, java.lang.Comparable<?> value)
-
set
public void set(long index, double value)
-
set
public void set(long index, float value)
-
set
public void set(long index, int value)
-
set
public void set(long index, long value)
-
set
public void set(long row, long col, byte value)
-
set
public void set(long row, long col, java.lang.Comparable<?> value)
-
set
public void set(long row, long col, double value)
-
set
public void set(long row, long col, float value)
-
set
public void set(long row, long col, int value)
-
set
public void set(long row, long col, long value)
-
set
public void set(long row, long col, short value)
-
set
public void set(long index, short value)
-
shortValue
public short shortValue(int index)
-
shortValue
public short shortValue(int row, int col)
-
shortValue
public short shortValue(long index)
-
shortValue
public short shortValue(long row, long col)
-
size
public int size()
Description copied from interface:Structure2D
size() == getRowDim() * getColDim()
-
supplyTo
public void supplyTo(double[] receiver)
-
toRawCopy1D
public double[] toRawCopy1D()
-
toRawCopy2D
public double[][] toRawCopy2D()
-
-