jphase

## Class MarkovMatrix

- java.lang.Object
- - Jama.Matrix
  - - jphase.MarkovMatrix

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable

      public class MarkovMatrix
      extends Jama.Matrix

  This class extends Jama's Matrix to include new operations like the Kronecker product
  Author:
    German Riano. Universidad de los Andes. (C) 2007
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static boolean` | `useUniformization`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MarkovMatrix(double[][] mat)`
    `MarkovMatrix(Jama.Matrix mat)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `MarkovMatrix` | `compExp()`
    `MarkovMatrix` | `compLog()` Computes the entry-wise logarithm of this matrix
    `static Jama.Matrix` | `concatCols(Jama.Matrix A, Jama.Matrix B)` Concatenates matrices A and B by columns
    `static Jama.Matrix` | `concatRows(Jama.Matrix A, Jama.Matrix B)` Concatenates matrices A and B by rows
    `MarkovMatrix` | `exp(double x)`
    `MarkovMatrix` | `exp(double x, Jama.Matrix leftMat, Jama.Matrix rightMat)`
    `MarkovMatrix[]` | `exp(int n, double delta, Jama.Matrix leftMat, Jama.Matrix rightMat)`
    `MarkovMatrix[]` | `expRunge(int n, double delta, Jama.Matrix leftMat, Jama.Matrix rightMat)`
    `MarkovMatrix` | `expTimesOnes(double x)`
    `MarkovMatrix` | `expTimesOnes(double x, Jama.Matrix leftMatrix)`
    `MarkovMatrix[]` | `expTimesOnes(int N, double delta, Jama.Matrix leftMatrix)`
    `MarkovMatrix[]` | `expUnif(double[] times, Jama.Matrix leftMat, Jama.Matrix rightMat)` Computes leftMat * exp(A x) * rightMat, for all values x.
    `MarkovMatrix[]` | `expUnif(double[] times, Jama.Matrix leftMat, Jama.Matrix rightMat, int truncate)` Computes leftMat * exp(A x) * rightMat, for all values x.
    `MarkovMatrix[]` | `expUnif(double x, Jama.Matrix leftMat, Jama.Matrix rightMat)` Computes leftMat * exp(A x) * rightMat, for the value x.
    `MarkovMatrix[]` | `expUnif(int n, double delta, Jama.Matrix leftMat, Jama.Matrix rightMat)` Computes leftMat * exp(A x) * rightMat, for all values x.
    `MarkovMatrix[]` | `expUnif(int n, double delta, Jama.Matrix leftMat, Jama.Matrix rightMat, int truncate)` Computes leftMat * exp(A x) * rightMat, for all values x= 0, delta, 2delta, 3delta,....
    `static Jama.Matrix` | `identity(int n)`
    `Jama.Matrix` | `inverse()`
    `boolean` | `isStochastic()` Determines if the matrix is stochastic.
    `Jama.Matrix` | `kronecker(Jama.Matrix B)` Computes the kronecker sum of this and B
    `static Jama.Matrix` | `kronecker(Jama.Matrix A, Jama.Matrix B)` Computes the kronecker product of A and B
    `Jama.Matrix` | `kroneckerSum(Jama.Matrix B)` Computes the kronecker sum of this matrix and B
    `static Jama.Matrix` | `kroneckerSum(Jama.Matrix A, Jama.Matrix B)` Computes the kronecker sum of A and B
    `MarkovMatrix` | `oldExp(double x, Jama.Matrix rightMat)`
    `MarkovMatrix` | `plus(double x)`
    `Jama.Matrix` | `pow(int k)`
    `MarkovMatrix` | `power(int k)`
    `static MarkovMatrix` | `readTxt(java.lang.String stg)`
    `double` | `scalar()`
    `int` | `size()`
    `Jama.Matrix` | `solveTranspose(Jama.Matrix B)` Solves X*A = B, actually solved as A'*X' = B'
    `Jama.Matrix` | `times(double s)`
    `Jama.Matrix` | `times(Jama.Matrix B)`
    `MarkovMatrix` | `timesOne()`
    `static MarkovMatrix` | `toMarkovMatrix(Jama.Matrix A)`
    `java.lang.String` | `toString()`
    `java.lang.String` | `toStringRTF()`
    `java.lang.String` | `toTxt()`
    `Jama.Matrix` | `uminus()`
    `static MarkovMatrix` | `Zeros(int rows, int cols)`

    - ### Methods inherited from class Jama.Matrix

      `arrayLeftDivide, arrayLeftDivideEquals, arrayRightDivide, arrayRightDivideEquals, arrayTimes, arrayTimesEquals, chol, clone, cond, constructWithCopy, copy, det, eig, get, getArray, getArrayCopy, getColumnDimension, getColumnPackedCopy, getMatrix, getMatrix, getMatrix, getMatrix, getRowDimension, getRowPackedCopy, identity, lu, minus, minusEquals, norm1, norm2, normF, normInf, plus, plusEquals, print, print, print, print, qr, random, rank, read, set, setMatrix, setMatrix, setMatrix, setMatrix, solve, svd, timesEquals, trace, transpose`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### useUniformization

          public static boolean useUniformization

  - ### Constructor Detail

    - #### MarkovMatrix

          public MarkovMatrix(double[][] mat)

    - #### MarkovMatrix

          public MarkovMatrix(Jama.Matrix mat)

  - ### Method Detail

    - #### readTxt

          public static MarkovMatrix readTxt(java.lang.String stg)

    - #### Zeros

          public static MarkovMatrix Zeros(int rows,
                           int cols)

    - #### inverse

          public Jama.Matrix inverse()

      Overrides:
        `inverse` in class `Jama.Matrix`

    - #### uminus

          public Jama.Matrix uminus()

      Overrides:
        `uminus` in class `Jama.Matrix`

    - #### identity

          public static Jama.Matrix identity(int n)

    - #### times

          public Jama.Matrix times(double s)

      Overrides:
        `times` in class `Jama.Matrix`

    - #### size

          public int size()

    - #### times

          public Jama.Matrix times(Jama.Matrix B)

      Overrides:
        `times` in class `Jama.Matrix`

    - #### toMarkovMatrix

          public static MarkovMatrix toMarkovMatrix(Jama.Matrix A)

    - #### solveTranspose

          public Jama.Matrix solveTranspose(Jama.Matrix B)

      Solves X*A = B, actually solved as A'*X' = B'
      Overrides:
        `solveTranspose` in class `Jama.Matrix`
      Parameters:
        `B` - right hand side
      Returns:
        solution if A is square, least squares solution otherwise.

    - #### isStochastic

          public boolean isStochastic()

      Determines if the matrix is stochastic.
      Returns:
        true if the matrix is stochastic.

    - #### power

          public MarkovMatrix power(int k)

      Returns:
        k-th power of A

    - #### timesOne

          public MarkovMatrix timesOne()

      Returns:
        This matrix times a vector of ones

    - #### scalar

          public double scalar()

    - #### compExp

          public MarkovMatrix compExp()

    - #### compLog

          public MarkovMatrix compLog()

      Computes the entry-wise logarithm of this matrix
      Returns:
        The entry-wise logarithm of this matrix

    - #### plus

          public MarkovMatrix plus(double x)

    - #### pow

          public Jama.Matrix pow(int k)

    - #### expTimesOnes

          public MarkovMatrix expTimesOnes(double x)

    - #### expTimesOnes

          public MarkovMatrix expTimesOnes(double x,
                                  Jama.Matrix leftMatrix)

    - #### expTimesOnes

          public MarkovMatrix[] expTimesOnes(int N,
                                    double delta,
                                    Jama.Matrix leftMatrix)

    - #### exp

          public MarkovMatrix exp(double x,
                         Jama.Matrix leftMat,
                         Jama.Matrix rightMat)

    - #### exp

          public MarkovMatrix exp(double x)

    - #### exp

          public MarkovMatrix[] exp(int n,
                           double delta,
                           Jama.Matrix leftMat,
                           Jama.Matrix rightMat)

    - #### expRunge

          public MarkovMatrix[] expRunge(int n,
                                double delta,
                                Jama.Matrix leftMat,
                                Jama.Matrix rightMat)

    - #### expUnif

          public MarkovMatrix[] expUnif(double x,
                               Jama.Matrix leftMat,
                               Jama.Matrix rightMat)

      Computes leftMat * exp(A x) * rightMat, for the value x. It uses the uniformization algorithm as described in page 60 of Latouche and Ramaswami

    - #### expUnif

          public MarkovMatrix[] expUnif(int n,
                               double delta,
                               Jama.Matrix leftMat,
                               Jama.Matrix rightMat)

      Computes leftMat * exp(A x) * rightMat, for all values x. It uses the uniformization algorithm as described in page 60 of Latouche and Ramaswami

    - #### expUnif

          public MarkovMatrix[] expUnif(double[] times,
                               Jama.Matrix leftMat,
                               Jama.Matrix rightMat)

      Computes leftMat * exp(A x) * rightMat, for all values x. It uses the uniformization algorithm as described in page 60 of Latouche and Ramaswami

    - #### expUnif

          public MarkovMatrix[] expUnif(int n,
                               double delta,
                               Jama.Matrix leftMat,
                               Jama.Matrix rightMat,
                               int truncate)

      Computes leftMat * exp(A x) * rightMat, for all values x= 0, delta, 2delta, 3delta,.... It uses the uniformization algorithm as described in page 60 of Latouche and Ramaswami

    - #### expUnif

          public MarkovMatrix[] expUnif(double[] times,
                               Jama.Matrix leftMat,
                               Jama.Matrix rightMat,
                               int truncate)

      Computes leftMat * exp(A x) * rightMat, for all values x. It uses the uniformization algorithm as described in page 60 of Latouche and Ramaswami
      Returns:
        leftMat * exp(A x) * rightMat, for all values x

    - #### kroneckerSum

          public Jama.Matrix kroneckerSum(Jama.Matrix B)

      Computes the kronecker sum of this matrix and B
      Parameters:
        `B` - matrix to sum to this
      Returns:
        Kronecker sum of this matrix and B

    - #### kroneckerSum

          public static Jama.Matrix kroneckerSum(Jama.Matrix A,
                                 Jama.Matrix B)

      Computes the kronecker sum of A and B
      Parameters:
        `A` - matrix to sum
        `B` - matrix to sum
      Returns:
        Kronecker sum of A and B

    - #### kronecker

          public static Jama.Matrix kronecker(Jama.Matrix A,
                              Jama.Matrix B)

      Computes the kronecker product of A and B
      Parameters:
        `A` - matrix to multiply
        `B` - matrix to multiply
      Returns:
        Kronecker product of A and B

    - #### kronecker

          public Jama.Matrix kronecker(Jama.Matrix B)

      Computes the kronecker sum of this and B
      Parameters:
        `B` - matrix to sum
      Returns:
        Kronecker sum of this and B

    - #### concatCols

          public static Jama.Matrix concatCols(Jama.Matrix A,
                               Jama.Matrix B)

      Concatenates matrices A and B by columns
      Parameters:
        `A` - matrix to concatenate
        `B` - matrix to concatenate
      Returns:
        Matrix with the columns of A and B

    - #### concatRows

          public static Jama.Matrix concatRows(Jama.Matrix A,
                               Jama.Matrix B)

      Concatenates matrices A and B by rows
      Parameters:
        `A` - matrix to concatenate
        `B` - matrix to concatenate
      Returns:
        Matrix with the rows of A and B

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### toTxt

          public java.lang.String toTxt()

    - #### toStringRTF

          public java.lang.String toStringRTF()

    - #### oldExp

          public MarkovMatrix oldExp(double x,
                            Jama.Matrix rightMat)