Class SquareMatrixSupport.ArrayRealSquareMatrix

java.lang.Object
org.apache.commons.statistics.inference.SquareMatrixSupport.ArrayRealSquareMatrix
All Implemented Interfaces:
SquareMatrixSupport.RealSquareMatrix
Enclosing class:
SquareMatrixSupport

private static class SquareMatrixSupport.ArrayRealSquareMatrix extends Object implements SquareMatrixSupport.RealSquareMatrix
Implementation of SquareMatrixSupport.RealSquareMatrix using a double[] array to store entries. Values are addressed using i*dim + j where dim is the square dimension.

Scaling is supported using the central element [m][m] where m = dimension/2. Scaling is only implemented post-multiplication to protect against overflow during repeat multiplication operations.

Note: The scaling is implemented to support computation of Kolmogorov's distribution as described in:

Since:
1.1
  • Field Details

    • SCALE_THRESHOLD

      private static final double SCALE_THRESHOLD
      The scaling threshold. Marsaglia used 1e140. This uses 2^400 ~ 2.58e120
      See Also:
    • dim

      private final int dim
      Dimension.
    • data

      private final double[] data
      Entries of the matrix.
    • exp

      private final int exp
      Matrix scale.
  • Constructor Details

    • ArrayRealSquareMatrix

      ArrayRealSquareMatrix(int dimension, double[] data, int scale)
      Parameters:
      dimension - Matrix dimension.
      data - Matrix data.
      scale - Matrix scale.
  • Method Details