Interface DoubleMatrixInterface<U extends Unit<U>,​S extends DoubleScalarInterface<U,​S>,​V extends DoubleVectorInterface<U,​S,​V>,​M extends DoubleMatrixInterface<U,​S,​V,​M>>

    • Method Detail

      • getSI

        double getSI​(int row,
                     int column)
              throws ValueRuntimeException
        Retrieve the value stored at a specified row and column in the standard SI unit.
        Parameters:
        row - int; row of the value to retrieve
        column - int; column of the value to retrieve
        Returns:
        double; value at position row, column in the standard SI unit
        Throws:
        ValueRuntimeException - when row or column out of range (row < 0 or row >= rows() or column < 0 or column >= columns())
      • getInUnit

        double getInUnit​(int row,
                         int column)
                  throws ValueRuntimeException
        Retrieve the value stored at a specified row and column in the original unit.
        Parameters:
        row - int; row of the value to retrieve
        column - int; column of the value to retrieve
        Returns:
        double; value at position row, column in the original unit
        Throws:
        ValueRuntimeException - when row or column out of range (row < 0 or row >= rows() or column < 0 or column >= columns())
      • getInUnit

        double getInUnit​(int row,
                         int column,
                         U targetUnit)
                  throws ValueRuntimeException
        Retrieve the value stored at a specified row and column converted into a specified unit.
        Parameters:
        row - int; row of the value to retrieve
        column - int; column of the value to retrieve
        targetUnit - U; the unit for the result
        Returns:
        double; value at position row, column converted into the specified unit
        Throws:
        ValueRuntimeException - when row or column out of range (row < 0 or row >= rows() or column < 0 or column >= columns())
      • getRowSI

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

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

        double[] getDiagonalSI()
                        throws ValueRuntimeException
        Retrieve the main diagonal of the matrix as an array of double.
        Returns:
        V; the main diagonal as a double array
        Throws:
        ValueRuntimeException - in case the matrix is not square
      • getValuesSI

        double[][] getValuesSI()
        Create a dense double[][] array filled with the values in the standard SI unit.
        Returns:
        double[][]; array of values in the standard SI unit
      • getValuesInUnit

        double[][] getValuesInUnit()
        Create a dense double[][] array filled with the values in the original unit.
        Returns:
        double[][]; the values in the original unit
      • getValuesInUnit

        double[][] getValuesInUnit​(U targetUnit)
        Create a dense double[][] array filled with the values converted into a specified unit.
        Parameters:
        targetUnit - U; the unit into which the values are converted for use
        Returns:
        double[][]; the values converted into the specified unit
      • determinantSI

        double determinantSI()
                      throws ValueRuntimeException
        Compute the determinant of the matrix, based on the SI values in the matrix.
        Returns:
        double; the determinant of the matrix
        Throws:
        ValueRuntimeException - when matrix is neither sparse, nor dense, or not square
      • setSI

        void setSI​(int row,
                   int column,
                   double valueSI)
            throws ValueRuntimeException
        Set the value, specified in the standard SI unit, at the specified position.
        Parameters:
        row - int; row of the value to set
        column - int; column of the value to set
        valueSI - double; the value, specified in the standard SI unit
        Throws:
        ValueRuntimeException - when index out of range (index < 0 or index >= size())
      • setInUnit

        void setInUnit​(int row,
                       int column,
                       double valueInUnit)
                throws ValueRuntimeException
        Set the value, specified in the (current) display unit, at the specified position.
        Parameters:
        row - int; row of the value to set
        column - int; column of the value to set
        valueInUnit - double; the value, specified in the (current) display unit
        Throws:
        ValueRuntimeException - when index out of range (index < 0 or index >= size())
      • setInUnit

        void setInUnit​(int row,
                       int column,
                       double valueInUnit,
                       U valueUnit)
                throws ValueRuntimeException
        Set the value, specified in the valueUnit, at the specified position.
        Parameters:
        row - int; row of the value to set
        column - int; column of the value to set
        valueInUnit - double; the value, specified in the (current) display unit
        valueUnit - U; the unit in which the valueInUnit is expressed
        Throws:
        ValueRuntimeException - when index out of range (index < 0 or index >= size())
      • set

        void set​(int row,
                 int column,
                 S value)
          throws ValueRuntimeException
        Set the scalar value at the specified position.
        Parameters:
        row - int; row of the value to set
        column - int; column of the value to set
        value - S; the value to set
        Throws:
        ValueRuntimeException - when index out of range (index < 0 or index >= size())
      • assign

        M assign​(DoubleFunction doubleFunction)
        Execute a function on a cell by cell basis. Note: May be expensive when used on sparse data.
        Parameters:
        doubleFunction - DoubleFunction; the function to apply
        Returns:
        M; this updated matrix
      • instantiateMatrix

        M instantiateMatrix​(DoubleMatrixData dmd,
                            U displayUnit)
        Instantiate a new matrix of the class of this matrix. This can be used instead of the DoubleMatrix.instiantiate() methods in case another matrix of this class is known. The method is faster than DoubleMatrix.instantiate, and it will also work if the matrix is user-defined.
        Parameters:
        dmd - DoubleMatrixData; the data used to instantiate the matrix
        displayUnit - U; the display unit of the matrix
        Returns:
        V; a matrix of the correct type
      • instantiateVector

        V instantiateVector​(DoubleVectorData dvd,
                            U displayUnit)
        Instantiate a new vector of the class of this matrix. This can be used instead of the DoubleVector.instiantiate() methods in case another matrix of this class is known. The method is faster than DoubleVector.instantiate, and it will also work if the matrix and/or vector are user-defined.
        Parameters:
        dvd - DoubleVectorData; the data used to instantiate the vector
        displayUnit - U; the display unit of the vector
        Returns:
        V; a vector of the correct type
      • instantiateScalarSI

        S instantiateScalarSI​(double valueSI,
                              U displayUnit)
        Instantiate a new scalar for the class of this matrix. This can be used instead of the DoubleScalar.instiantiate() methods in case a matrix of this class is known. The method is faster than DoubleScalar.instantiate, and it will also work if the matrix and/or scalar are user-defined.
        Parameters:
        valueSI - double; the SI value of the scalar
        displayUnit - U; the unit in which the value will be displayed
        Returns:
        S; a scalar of the correct type, belonging to the matrix type