Class Subregion2D.SynchronizedRegion<N extends Comparable<N>>

java.lang.Object
org.ojalgo.matrix.store.Subregion2D<N>
org.ojalgo.matrix.store.Subregion2D.SynchronizedRegion<N>
All Implemented Interfaces:
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 Comparable<N>>

static final class Subregion2D.SynchronizedRegion<N extends Comparable<N>> extends Subregion2D<N>
  • Field Details

  • Constructor Details

  • Method Details

    • accept

      public void accept(Access2D<?> supplied)
    • add

      public void add(long index, byte addend)
    • add

      public void add(long index, 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, 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 Consumer<Access2D<?>> andThen(Consumer<? super Access2D<?>> after)
    • asCollectable1D

      public <NN extends Comparable<NN>, R extends Mutate1D.Receiver<NN>> Access1D.Collectable<NN,R> asCollectable1D()
      Description copied from interface: Access1D
      Transforms this Access1D to a Access1D.Collectable of a different Comparable type.
    • asCollectable2D

      public <NN extends 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 scale
      y - 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()
    • columns

      public Access2D<N> columns(int... columns)
    • columns

      public Access2D<N> columns(long... 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 col, Access1D<N> values)
    • fillColumn

      public void fillColumn(long row, long col, Access1D<N> values)
    • 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(Access1D<N> values)
    • fillDiagonal

      public void fillDiagonal(long row, long col, Access1D<N> values)
    • 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 interface Mutate1D.Fillable<N extends Comparable<N>>
      Overrides:
      fillMatching in class Subregion2D<N extends 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, Access1D<N> values)
    • fillRow

      public void fillRow(long row, long col, Access1D<N> values)
    • 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 simply 0, and if all elements are zeros then this.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 simply 0, and if all elements are zeros then this.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 simply this.countRows(), and if all elements are zeros then 0.
      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 simply this.countColumns(), and if all elements are zeros then 0.
      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 as Mutate2D.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 as Mutate2D.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 as Mutate2D.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 to Access1D.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 the Access1D.nonzeros() and Access1D.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 interface TransformableRegion<N extends Comparable<N>>
      Overrides:
      regionByTransposing in class Subregion2D<N extends 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()
    • rows

      public Access2D<N> rows(int... rows)
    • rows

      public Access2D<N> rows(long... rows)
    • select

      public Access2D<N> select(int[] rows, int[] columns)
    • 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, 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, 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()