Module ojalgo

Class DiagonalStore<N extends Comparable<N>,D extends Access1D<?>>

java.lang.Object
org.ojalgo.matrix.store.DiagonalStore<N,D>
All Implemented Interfaces:
Group, Group.Additive<MatrixStore<N>>, NormedVectorSpace<MatrixStore<N>,N>, Operation, Operation.Addition<MatrixStore<N>>, Operation.Multiplication<MatrixStore<N>>, Operation.Subtraction<MatrixStore<N>>, ScalarOperation, ScalarOperation.Addition<MatrixStore<N>,N>, ScalarOperation.Division<MatrixStore<N>,N>, ScalarOperation.Multiplication<MatrixStore<N>,N>, ScalarOperation.Subtraction<MatrixStore<N>,N>, VectorSpace<MatrixStore<N>,N>, Matrix2D<N,MatrixStore<N>>, ElementsSupplier<N>, MatrixStore<N>, Access1D<N>, Access1D.Aggregatable<N>, Access1D.Collectable<N,Mutate1D>, Access1D.Sliceable<N>, Access1D.Visitable<N>, Access2D<N>, Access2D.Aggregatable<N>, Access2D.Collectable<N,TransformableRegion<N>>, Access2D.Sliceable<N>, Access2D.Visitable<N>, Operate2D<N,ElementsSupplier<N>>, Structure1D, Structure2D, Structure2D.Logical<Access2D<N>,MatrixStore<N>>, Structure2D.ReducibleTo1D<ElementsSupplier<N>>

public final class DiagonalStore<N extends Comparable<N>,D extends Access1D<?>> extends Object
  • Method Details

    • builder

      public static <N extends Comparable<N>, D extends Access1D<?>> DiagonalStore.Builder<N,D> builder(PhysicalStore.Factory<N,?> factory, D mainDiagonal)
    • wrap

      public static DiagonalStore<Double,Primitive1D> wrap(double... mainDiagonal)
    • 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
    • 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
    • get

      public N get(int row, int col)
    • getDimension

      public int getDimension()
      Returns:
      The main diagonal length
    • getMainDiagonal

      public Optional<D> getMainDiagonal()
    • getSubdiagonal

      public Optional<D> getSubdiagonal()
    • getSuperdiagonal

      public Optional<D> getSuperdiagonal()
    • 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.
      Specified by:
      limitOfColumn in interface Structure2D
      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.
      Specified by:
      limitOfRow in interface Structure2D
      Returns:
      The column index of the first zero element, after all non-zeros, in the specified row (index of the last non-zero + 1)
    • supplyMainDiagonalTo

      public void supplyMainDiagonalTo(double[] receiver)
    • supplySubdiagonalTo

      public void supplySubdiagonalTo(double[] receiver)
    • supplySuperdiagonalTo

      public void supplySuperdiagonalTo(double[] receiver)
    • supplyTo

      public void supplyTo(TransformableRegion<N> consumer)
    • toScalar

      public Scalar<N> toScalar(int row, int col)
      Description copied from interface: Matrix2D
      Extracts one element of this matrix as a Scalar.
      Parameters:
      row - A row index.
      col - A column index.
      Returns:
      One matrix element as a Scalar.
    • equals

      public boolean equals(Object obj)
    • hashCode

      public int hashCode()
    • physical

      public final PhysicalStore.Factory<N,?> physical()
    • countColumns

      public long countColumns()
      Description copied from interface: Structure2D
      Only need to implement if the structure may contain more than Integer.MAX_VALUE elements.
      Specified by:
      countColumns in interface Structure2D
      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.
      Specified by:
      countRows in interface Structure2D
      Returns:
      The number of rows
    • getColDim

      public final int getColDim()
      Specified by:
      getColDim in interface Structure2D
      Returns:
      The number of columns
    • getMaxDim

      public final int getMaxDim()
      Specified by:
      getMaxDim in interface Structure2D
    • getMinDim

      public final int getMinDim()
      Specified by:
      getMinDim in interface Structure2D
    • getRowDim

      public final int getRowDim()
      Specified by:
      getRowDim in interface Structure2D
      Returns:
      The number of rows
    • multiplyBoth

      public N multiplyBoth(Access1D<N> leftAndRight)
      Description copied from interface: MatrixStore
      Assumes [leftAndRight] is a vector and will calulate [leftAndRight]H[this][leftAndRight]
      Specified by:
      multiplyBoth in interface MatrixStore<N extends Comparable<N>>
      Parameters:
      leftAndRight - The argument vector
      Returns:
      A scalar (extracted from the resulting 1 x 1 matrix)
    • toString

      public final String toString()
      Overrides:
      toString in class Object
    • isPrimitive

      protected final boolean isPrimitive()