Interface SquareMatrixSupport.RealSquareMatrix

  • All Known Implementing Classes:
    SquareMatrixSupport.ArrayRealSquareMatrix
    Enclosing class:
    SquareMatrixSupport

    static interface SquareMatrixSupport.RealSquareMatrix
    Define a real-valued square matrix.

    This matrix supports a scale to protect against overflow. The true value of any matrix value is multiplied by 2^scale. This is readily performed using Math.scalb(double, int).

    • Method Detail

      • dimension

        int dimension()
        Gets the dimension for the rows and columns.
        Returns:
        the dimension
      • scale

        int scale()
        Gets the scale of the matrix values. The true value is the value returned from get(int, int) multiplied by 2^scale.
        Returns:
        the scale
      • get

        double get​(int i,
                   int j)
        Gets the value. This is a scaled value. The true value is the value returned multiplied by 2^scale.
        Parameters:
        i - Row
        j - Column
        Returns:
        the value
        See Also:
        scale()
      • power

        SquareMatrixSupport.RealSquareMatrix power​(int n)
        Returns the result of multiplying this with itself n times.
        Parameters:
        n - raise this to power n
        Returns:
        this^n
        Throws:
        java.lang.IllegalArgumentException - if n < 0