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 Summary

    Modifier and Type
    Method
    Description
    int
    Gets the dimension for the rows and columns.
    double
    get(int i, int j)
    Gets the value.
    power(int n)
    Returns the result of multiplying this with itself n times.
    int
    Gets the scale of the matrix values.
  • Method Details

    • 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:
    • power

      Returns the result of multiplying this with itself n times.
      Parameters:
      n - raise this to power n
      Returns:
      this^n
      Throws:
      IllegalArgumentException - if n < 0