Interface Matrix<U extends Unit<U>,​S extends Scalar<U,​S>,​V extends Vector<U,​S,​V>,​M extends Matrix<U,​S,​V,​M>>

    • Method Detail

      • rows

        int rows()
        Retrieve the number of rows of the matrix.
        Returns:
        int; the number of rows of the matrix
      • cols

        int cols()
        Retrieve the number of columns of the matrix.
        Returns:
        int; the number of columns of the matrix
      • getVectorClass

        Class<V> getVectorClass()
        Return the class of the corresponding vector.
        Returns:
        Class<V>; the class of the corresponding vector
      • get

        S get​(int row,
              int column)
        throws ValueRuntimeException
        Retrieve a value from the matrix.
        Parameters:
        row - int; row of the value to retrieve
        column - int; column of the value to retrieve
        Returns:
        S; the value as a Scalar
        Throws:
        ValueRuntimeException - in case row or column is out of bounds
      • getScalars

        S[][] getScalars()
        Return the vector as a 2D-array of scalars.
        Returns:
        S[][]; the vector as a 2D-array of scalars
      • getRow

        V getRow​(int row)
          throws ValueRuntimeException
        Retrieve a row from the matrix as a vector.
        Parameters:
        row - int; row of the values to retrieve
        Returns:
        V; the row as a Vector
        Throws:
        ValueRuntimeException - in case row is out of bounds
      • getColumn

        V getColumn​(int column)
             throws ValueRuntimeException
        Retrieve a column from the matrix as a vector.
        Parameters:
        column - int; column of the values to retrieve
        Returns:
        V; the column as a Vector
        Throws:
        ValueRuntimeException - in case column is out of bounds
      • getDiagonal

        V getDiagonal()
               throws ValueRuntimeException
        Retrieve the main diagonal of the matrix as a vector.
        Returns:
        V; the main diagonal as a Vector
        Throws:
        ValueRuntimeException - in case the matrix is not square
      • getRowScalars

        S[] getRowScalars​(int row)
                   throws ValueRuntimeException
        Retrieve a row from the matrix as an array of scalars.
        Parameters:
        row - int; row of the values to retrieve
        Returns:
        S[]; the row as a Scalar array
        Throws:
        ValueRuntimeException - in case row is out of bounds
      • getColumnScalars

        S[] getColumnScalars​(int column)
                      throws ValueRuntimeException
        Retrieve a column from the matrix as an array of scalars.
        Parameters:
        column - int; column of the values to retrieve
        Returns:
        S[]; the column as a Scalar array
        Throws:
        ValueRuntimeException - in case column is out of bounds
      • getDiagonalScalars

        S[] getDiagonalScalars()
                        throws ValueRuntimeException
        Retrieve the main diagonal of the matrix as an array of scalars.
        Returns:
        V; the main diagonal as a Scalar array
        Throws:
        ValueRuntimeException - in case the matrix is not square