jphase

## Class MatrixUtils

- java.lang.Object
- - jphase.MatrixUtils

-     public class MatrixUtils
      extends java.lang.Object

  Utilities class for the jPhase package
  Version:
    1.0
  Author:
    German Riaño, Juan F. Pérez

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MatrixUtils()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static double` | `average(double[] datos)` Computes data average
    `static double` | `average2(double[] data)` Computes the second moment of the data
    `static no.uib.cipr.matrix.DenseMatrix` | `concatCols(no.uib.cipr.matrix.DenseMatrix A, no.uib.cipr.matrix.DenseMatrix B)` Concatenates the columns of the matrices, keeping the same number of rows in dense format
    `static no.uib.cipr.matrix.Matrix` | `concatCols(no.uib.cipr.matrix.Matrix A, no.uib.cipr.matrix.Matrix B, no.uib.cipr.matrix.Matrix res)` Concatenates the columns of the matrices, keeping the same number of rows in the predefined format
    `static no.uib.cipr.matrix.Matrix` | `concatQuad(no.uib.cipr.matrix.Matrix leftUp, no.uib.cipr.matrix.Matrix rightUp, no.uib.cipr.matrix.Matrix leftDown, no.uib.cipr.matrix.Matrix rightDown, no.uib.cipr.matrix.Matrix res)` Concatenates the colums of the left and right upper matrices and the result is concatenated by rows with the concatenation of left and right lower matrices
    `static no.uib.cipr.matrix.DenseMatrix` | `concatRows(no.uib.cipr.matrix.DenseMatrix A, no.uib.cipr.matrix.DenseMatrix B)` Concatenates the rows of the matrices, keeping the same number of colums in dense format
    `static no.uib.cipr.matrix.Matrix` | `concatRows(no.uib.cipr.matrix.Matrix A, no.uib.cipr.matrix.Matrix B, no.uib.cipr.matrix.Matrix res)` Concatenates the rows of the matrices, keeping the same number of colums in the predefined format
    `static no.uib.cipr.matrix.DenseVector` | `concatVectors(no.uib.cipr.matrix.DenseVector A, no.uib.cipr.matrix.DenseVector B)` Concatenates the vectors in dense format
    `static no.uib.cipr.matrix.Vector` | `concatVectors(no.uib.cipr.matrix.Vector A, no.uib.cipr.matrix.Vector B, no.uib.cipr.matrix.Vector res)` Concatenates the vectors in the predefined format
    `static double` | `CV(double[] data)` Return the Coefficient of Variation of the data trace
    `static double` | `distance(double[] v1, double[] v2)` Calculates the distance between two arrays, defined as the maximum Euclidean distance between every entry in those arrays
    `static no.uib.cipr.matrix.Matrix` | `exp(no.uib.cipr.matrix.Matrix A, double x)` Returns exp(A x), for the value x.
    `static no.uib.cipr.matrix.Matrix` | `exp(no.uib.cipr.matrix.Matrix A, double x, no.uib.cipr.matrix.Matrix leftMat, no.uib.cipr.matrix.Matrix rightMat)` Returns leftMat * exp(A x) * rightMat, for the value x.
    `static no.uib.cipr.matrix.Matrix` | `exp(no.uib.cipr.matrix.Matrix A, double x, no.uib.cipr.matrix.Matrix leftMat, no.uib.cipr.matrix.Matrix rightMat, boolean useUniformization)` Returns leftMat * exp(A x) * rightMat, for the value x.
    `static double` | `exp(no.uib.cipr.matrix.Matrix A, double x, no.uib.cipr.matrix.Vector leftVec, no.uib.cipr.matrix.Vector rightVec)` Returns leftVec * exp(A x) * rightVec, for the value x.
    `static no.uib.cipr.matrix.Matrix[]` | `exp(no.uib.cipr.matrix.Matrix A, int n, double delta, no.uib.cipr.matrix.Matrix leftMat, no.uib.cipr.matrix.Matrix rightMat, boolean useUniformization)` Computes leftMat * exp(A x) * rightMat, for all values x = 0 + i*delta, i=0,...
    `static double[]` | `exp(no.uib.cipr.matrix.Matrix A, int n, double delta, no.uib.cipr.matrix.Vector leftVec, no.uib.cipr.matrix.Vector rightVec, boolean useUniformization)` Returns leftVec * exp(A x) * rightVec, for all values x = 0 + i*delta, i=0,...
    `static no.uib.cipr.matrix.Matrix[]` | `expRunge(no.uib.cipr.matrix.Matrix A, int n, double delta, no.uib.cipr.matrix.Matrix leftMat, no.uib.cipr.matrix.Matrix rightMat)` Computes leftMat * exp(A x) * rightMat, for all values x = 0 + i*delta, i=0,...
    `static no.uib.cipr.matrix.Matrix` | `expTimesOnes(no.uib.cipr.matrix.Matrix A, double x)` Returns exp(A x) * Ones, for the value x.
    `static no.uib.cipr.matrix.Matrix` | `expTimesOnes(no.uib.cipr.matrix.Matrix A, double x, no.uib.cipr.matrix.Matrix leftMat)` Returns leftMat * exp(A x) * Ones, for the value x.
    `static double` | `expTimesOnes(no.uib.cipr.matrix.Matrix A, double x, no.uib.cipr.matrix.Vector leftVec)` Returns leftVec * exp(A x) * OnesVector, for the value x.
    `static no.uib.cipr.matrix.Matrix[]` | `expTimesOnes(no.uib.cipr.matrix.Matrix A, int n, double delta, no.uib.cipr.matrix.Matrix leftMat)` Returns leftMat * exp(A x) * OnesCol, for all values x = 0 + i*delta, i=0,...
    `static double[]` | `expTimesOnes(no.uib.cipr.matrix.Matrix A, int n, double delta, no.uib.cipr.matrix.Vector leftVec)` Returns leftVec * exp(A x) * OnesVector, for all values x = 0 + i*delta, i=0,...
    `static no.uib.cipr.matrix.Matrix[]` | `expUnif(no.uib.cipr.matrix.Matrix A, double[] times, no.uib.cipr.matrix.Matrix leftMat, no.uib.cipr.matrix.Matrix rightMat)` Computes leftMat * exp(A x) * rightMat, for all values x in times.
    `static no.uib.cipr.matrix.Matrix[]` | `expUnif(no.uib.cipr.matrix.Matrix A, double[] times, no.uib.cipr.matrix.Matrix leftMat, no.uib.cipr.matrix.Matrix rightMat, int truncate)` Computes leftMat * exp(A x) * rightMat, for all values x in times.
    `static double[]` | `expUnif(no.uib.cipr.matrix.Matrix A, double[] times, no.uib.cipr.matrix.Vector leftVec, no.uib.cipr.matrix.Vector rightVec, int truncate)` Computes leftVec * exp(A x) * rightVec, for all values x in times.
    `static no.uib.cipr.matrix.Matrix[]` | `expUnif(no.uib.cipr.matrix.Matrix A, double x, no.uib.cipr.matrix.Matrix leftMat, no.uib.cipr.matrix.Matrix rightMat)` Computes leftMat * exp(A x) * rightMat, for the value x.
    `static no.uib.cipr.matrix.Matrix[]` | `expUnif(no.uib.cipr.matrix.Matrix A, int n, double delta, no.uib.cipr.matrix.Matrix leftMat, no.uib.cipr.matrix.Matrix rightMat)` Computes leftMat * exp(A x) * rightMat, for all values x = 0 + i*delta, i=0,...
    `static no.uib.cipr.matrix.Matrix[]` | `expUnif(no.uib.cipr.matrix.Matrix A, int n, double delta, no.uib.cipr.matrix.Matrix leftMat, no.uib.cipr.matrix.Matrix rightMat, int truncate)` Computes leftMat * exp(A x) * rightMat, for all values x = 0 + i*delta, i=0,...
    `static double[]` | `expUnif(no.uib.cipr.matrix.Matrix A, int n, double delta, no.uib.cipr.matrix.Vector leftVec, no.uib.cipr.matrix.Vector rightVec)` Computes leftVec * exp(A x) * rightVec, for all values x = 0 + i*delta, i=0,...
    `static double[]` | `expUnif(no.uib.cipr.matrix.Matrix A, int n, double delta, no.uib.cipr.matrix.Vector leftVec, no.uib.cipr.matrix.Vector rightVec, int truncate)` Computes leftVec * exp(A x) * rightVec, for all values x = 0 + i*delta, i=0,...
    `static no.uib.cipr.matrix.Matrix` | `kronecker(no.uib.cipr.matrix.Matrix A, no.uib.cipr.matrix.Matrix B)` Returns the kronecker product of two matrices in dense format
    `static no.uib.cipr.matrix.Matrix` | `kronecker(no.uib.cipr.matrix.Matrix A, no.uib.cipr.matrix.Matrix B, no.uib.cipr.matrix.Matrix res)` Returns the Kronecker product of two matrices in the predefined storage format
    `static no.uib.cipr.matrix.Matrix` | `kronecker(no.uib.cipr.matrix.Matrix A, no.uib.cipr.matrix.Vector B, no.uib.cipr.matrix.Matrix res)` Returns the Kronecker product of one matrix with one vector (Matrix x Vector) in dense format
    `static no.uib.cipr.matrix.Matrix` | `kronecker(no.uib.cipr.matrix.Vector A, no.uib.cipr.matrix.Matrix B, no.uib.cipr.matrix.Matrix res)` Returns the Kronecker product of one vector with one matrix (Vector x Matrix) in dense format
    `static no.uib.cipr.matrix.Matrix` | `kroneckerMxRowVector(no.uib.cipr.matrix.Matrix A, no.uib.cipr.matrix.Vector B, no.uib.cipr.matrix.Matrix res)` Returns the Kronecker product of one matrix with one vector (Matrix x Vector) in dense format
    `static no.uib.cipr.matrix.Matrix` | `kroneckerSum(no.uib.cipr.matrix.Matrix A, no.uib.cipr.matrix.Matrix B)` Returns the kronecker sum of two matrices in dense format
    `static no.uib.cipr.matrix.Matrix` | `kroneckerSum(no.uib.cipr.matrix.Matrix A, no.uib.cipr.matrix.Matrix B, no.uib.cipr.matrix.Matrix res)` Returns the kronecker sum of two matrices and stores it in the predefined format
    `static no.uib.cipr.matrix.DenseVector` | `kroneckerVectors(no.uib.cipr.matrix.DenseVector A, no.uib.cipr.matrix.DenseVector B)` Returns the Kronecker product of two vectors in dense format
    `static no.uib.cipr.matrix.Vector` | `kroneckerVectors(no.uib.cipr.matrix.Vector A, no.uib.cipr.matrix.Vector B, no.uib.cipr.matrix.Vector res)` Returns the Kronecker product of two vectors format
    `static no.uib.cipr.matrix.Matrix` | `matPower(no.uib.cipr.matrix.Matrix A, int k)` Computes k power of the matrix A
    `static double` | `matPower(no.uib.cipr.matrix.Matrix A, int k, no.uib.cipr.matrix.Vector leftVec, no.uib.cipr.matrix.Vector rightVec)` Computes the kth power of the matrix A premultiplied by leftVec and postmultiplied by rightVec
    `static no.uib.cipr.matrix.Matrix` | `multVector(no.uib.cipr.matrix.Vector A, no.uib.cipr.matrix.Vector B, no.uib.cipr.matrix.Matrix res)` Computes the producto of two vectors A x B^T
    `static no.uib.cipr.matrix.DenseMatrix` | `OnesCol(int m)` Returns a one-column matrix in dense format with one in every entry
    `static no.uib.cipr.matrix.DenseMatrix` | `OnesRow(int m)` Returns a one-row matrix in dense format with one in every entry
    `static no.uib.cipr.matrix.DenseVector` | `OnesVector(int m)` Returns a DenseVector with one in every entry
    `static no.uib.cipr.matrix.Vector` | `OnesVector(no.uib.cipr.matrix.Vector vec)` Returns a Vector with one in every entry in the predefined storage format
    `static double` | `pow(double x, int n)` Calculates x^n
    `static double` | `scalar(no.uib.cipr.matrix.Matrix A)` Returns the value of the position (0,0) in the matrix, if its number of columns is equal to one (1)
    `static double` | `sumMatPower(no.uib.cipr.matrix.Matrix A, int k, no.uib.cipr.matrix.Vector leftVec, no.uib.cipr.matrix.Vector rightVec)` Computes the sum of the first k terms of the succesion T^(j-1), from j = 1
    `static double` | `variance(double[] data)` Return the variance of the data

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

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

- - ### Constructor Detail

    - #### MatrixUtils

          public MatrixUtils()

  - ### Method Detail

    - #### kroneckerSum

          public static no.uib.cipr.matrix.Matrix kroneckerSum(no.uib.cipr.matrix.Matrix A,
                                               no.uib.cipr.matrix.Matrix B)

      Returns the kronecker sum of two matrices in dense format
      Parameters:
        `A` - Matrix
        `B` - Matrix
      Returns:
        Kronecker Sum A + B

    - #### kroneckerSum

          public static no.uib.cipr.matrix.Matrix kroneckerSum(no.uib.cipr.matrix.Matrix A,
                                               no.uib.cipr.matrix.Matrix B,
                                               no.uib.cipr.matrix.Matrix res)

      Returns the kronecker sum of two matrices and stores it in the predefined format
      Parameters:
        `A` - Matrix
        `B` - Matrix
        `res` - Result Matrix such that res.numRows = A.numRows * B.numRows and res.numCols = A.numCols * B.numCols
      Returns:
        Kronecker Sum A + B

    - #### kronecker

          public static no.uib.cipr.matrix.Matrix kronecker(no.uib.cipr.matrix.Matrix A,
                                            no.uib.cipr.matrix.Matrix B)

      Returns the kronecker product of two matrices in dense format
      Parameters:
        `A` - Matrix
        `B` - Matrix
      Returns:
        Kronecker Product A x B

    - #### kronecker

          public static no.uib.cipr.matrix.Matrix kronecker(no.uib.cipr.matrix.Matrix A,
                                            no.uib.cipr.matrix.Matrix B,
                                            no.uib.cipr.matrix.Matrix res)

      Returns the Kronecker product of two matrices in the predefined storage format
      Parameters:
        `A` - Matrix
        `B` - Matrix
        `res` - Matrix such that res.numCols = A.numCols * B.numCols and res.numRows = A.numRows * B.numRows
      Returns:
        Kronecker Product A x B

    - #### kronecker

          public static no.uib.cipr.matrix.Matrix kronecker(no.uib.cipr.matrix.Matrix A,
                                            no.uib.cipr.matrix.Vector B,
                                            no.uib.cipr.matrix.Matrix res)

      Returns the Kronecker product of one matrix with one vector (Matrix x Vector) in dense format
      Parameters:
        `A` - Matrix
        `B` - Vector
        `res` - Matrix such that res.numRows = A.numRows and res.numCols = A.numCols * B.size
      Returns:
        Kronecker Product A x B

    - #### kroneckerMxRowVector

          public static no.uib.cipr.matrix.Matrix kroneckerMxRowVector(no.uib.cipr.matrix.Matrix A,
                                                       no.uib.cipr.matrix.Vector B,
                                                       no.uib.cipr.matrix.Matrix res)

      Returns the Kronecker product of one matrix with one vector (Matrix x Vector) in dense format
      Parameters:
        `A` - Matrix
        `B` - Vector
        `res` - Matrix such that res.numRows = A.numRows and res.numCols = A.numCols * B.size
      Returns:
        Kronecker Product A x B

    - #### kronecker

          public static no.uib.cipr.matrix.Matrix kronecker(no.uib.cipr.matrix.Vector A,
                                            no.uib.cipr.matrix.Matrix B,
                                            no.uib.cipr.matrix.Matrix res)

      Returns the Kronecker product of one vector with one matrix (Vector x Matrix) in dense format
      Parameters:
        `A` - Vector
        `B` - Matrix
        `res` - Matrix such that res.numRows = A.size * B.numRows and res.numCols = B.numCols
      Returns:
        Kronecker Product A x B

    - #### kroneckerVectors

          public static no.uib.cipr.matrix.DenseVector kroneckerVectors(no.uib.cipr.matrix.DenseVector A,
                                                        no.uib.cipr.matrix.DenseVector B)

      Returns the Kronecker product of two vectors in dense format
      Parameters:
        `A` - Vector
        `B` - Vector
      Returns:
        Kronecker Product A x B

    - #### kroneckerVectors

          public static no.uib.cipr.matrix.Vector kroneckerVectors(no.uib.cipr.matrix.Vector A,
                                                   no.uib.cipr.matrix.Vector B,
                                                   no.uib.cipr.matrix.Vector res)

      Returns the Kronecker product of two vectors format
      Parameters:
        `A` - Vector
        `B` - Vector
        `res` - Vector such that res.size = A.size * B.size
      Returns:
        Kronecker Product A x B

    - #### OnesRow

          public static no.uib.cipr.matrix.DenseMatrix OnesRow(int m)

      Returns a one-row matrix in dense format with one in every entry
      Parameters:
        `m` - size of the matrix (1, m)
      Returns:
        Row matrix with one in every entry

    - #### OnesCol

          public static no.uib.cipr.matrix.DenseMatrix OnesCol(int m)

      Returns a one-column matrix in dense format with one in every entry
      Parameters:
        `m` - size of the matrix (m, 1)
      Returns:
        One column matrix with one in every entry

    - #### OnesVector

          public static no.uib.cipr.matrix.DenseVector OnesVector(int m)

      Returns a DenseVector with one in every entry
      Parameters:
        `m` - size of the DenseVector
      Returns:
        DenseVector with one in every entry

    - #### OnesVector

          public static no.uib.cipr.matrix.Vector OnesVector(no.uib.cipr.matrix.Vector vec)

      Returns a Vector with one in every entry in the predefined storage format
      Parameters:
        `vec` - Vector to be modified
      Returns:
        Vector with one in every entry

    - #### pow

          public static double pow(double x,
                   int n)

      Calculates x^n
      Parameters:
        `x` - base
        `n` - exponent
      Returns:
        x^n

    - #### distance

          public static double distance(double[] v1,
                        double[] v2)

      Calculates the distance between two arrays, defined as the maximum Euclidean distance between every entry in those arrays
      Parameters:
        `v1` - array
        `v2` - array
      Returns:
        Distance between two arrays

    - #### expTimesOnes

          public static no.uib.cipr.matrix.Matrix expTimesOnes(no.uib.cipr.matrix.Matrix A,
                                               double x)

      Returns exp(A x) * Ones, for the value x. It uses the uniformization algorithm as described in page 60 of Latouche and Ramaswami
      Parameters:
        `A` - Matrix
        `x` - evaluation point
      Returns:
        exp(A x) * Ones

    - #### expTimesOnes

          public static no.uib.cipr.matrix.Matrix expTimesOnes(no.uib.cipr.matrix.Matrix A,
                                               double x,
                                               no.uib.cipr.matrix.Matrix leftMat)

      Returns leftMat * exp(A x) * Ones, for the value x. It uses the uniformization algorithm as described in page 60 of Latouche and Ramaswami
      Parameters:
        `A` - Matrix
        `x` - evaluation point
        `leftMat` - Matrix
      Returns:
        leftMat * exp(A x) * rightMat

    - #### expTimesOnes

          public static double expTimesOnes(no.uib.cipr.matrix.Matrix A,
                            double x,
                            no.uib.cipr.matrix.Vector leftVec)

      Returns leftVec * exp(A x) * OnesVector, for the value x. It uses the uniformization algorithm as described in page 60 of Latouche and Ramaswami
      Parameters:
        `A` - Matrix
        `x` - evaluation point
        `leftVec` - Vector
      Returns:
        leftVec * exp(A x) * OnesVector

    - #### expTimesOnes

          public static no.uib.cipr.matrix.Matrix[] expTimesOnes(no.uib.cipr.matrix.Matrix A,
                                                 int n,
                                                 double delta,
                                                 no.uib.cipr.matrix.Matrix leftMat)

      Returns leftMat * exp(A x) * OnesCol, for all values x = 0 + i*delta, i=0,...,n. It uses the uniformization algorithm as described in page 60 of Latouche and Ramaswami
      Parameters:
        `A` - Matrix
        `n` - number of evaluation points
        `delta` - separation between evaluation points
        `leftMat` - Matrix
      Returns:
        leftMat * exp(A x) * OnesCol, for x = 0 + i*delta, i=0,...,n

    - #### expTimesOnes

          public static double[] expTimesOnes(no.uib.cipr.matrix.Matrix A,
                              int n,
                              double delta,
                              no.uib.cipr.matrix.Vector leftVec)

      Returns leftVec * exp(A x) * OnesVector, for all values x = 0 + i*delta, i=0,...,n. It uses the uniformization algorithm as described in page 60 of Latouche and Ramaswami
      Parameters:
        `A` - Matrix
        `n` - number of evaluation points
        `delta` - separation between evaluation points
        `leftVec` - Vector
      Returns:
        leftVec * exp(A x) * OnesVector, for x = 0 + i*delta, i=0,...,n

    - #### scalar

          public static double scalar(no.uib.cipr.matrix.Matrix A)

      Returns the value of the position (0,0) in the matrix, if its number of columns is equal to one (1)
      Parameters:
        `A` - matrix
      Returns:
        Value of the position (0,0) in the matrix

    - #### exp

          public static no.uib.cipr.matrix.Matrix exp(no.uib.cipr.matrix.Matrix A,
                                      double x,
                                      no.uib.cipr.matrix.Matrix leftMat,
                                      no.uib.cipr.matrix.Matrix rightMat)

      Returns leftMat * exp(A x) * rightMat, for the value x. It uses the uniformization algorithm as described in page 60 of Latouche and Ramaswami
      Parameters:
        `A` - Matrix
        `x` - evaluation point
        `leftMat` - Matrix
        `rightMat` - Matrix
      Returns:
        leftMat * exp(A x) * rightMat

    - #### exp

          public static double exp(no.uib.cipr.matrix.Matrix A,
                   double x,
                   no.uib.cipr.matrix.Vector leftVec,
                   no.uib.cipr.matrix.Vector rightVec)

      Returns leftVec * exp(A x) * rightVec, for the value x. It uses the uniformization algorithm as described in page 60 of Latouche and Ramaswami
      Parameters:
        `A` - Matrix
        `x` - evaluation point
        `leftVec` - Vector
        `rightVec` - Vector
      Returns:
        leftVec * exp(A x) * rightVec

    - #### exp

          public static no.uib.cipr.matrix.Matrix exp(no.uib.cipr.matrix.Matrix A,
                                      double x)

      Returns exp(A x), for the value x. It uses the uniformization algorithm as described in page 60 of Latouche and Ramaswami
      Parameters:
        `A` - Matrix
        `x` - evaluation point
      Returns:
        exp(A x)

    - #### exp

          public static no.uib.cipr.matrix.Matrix exp(no.uib.cipr.matrix.Matrix A,
                                      double x,
                                      no.uib.cipr.matrix.Matrix leftMat,
                                      no.uib.cipr.matrix.Matrix rightMat,
                                      boolean useUniformization)

      Returns leftMat * exp(A x) * rightMat, for the value x. It uses the uniformization algorithm or the RungeKutta method
      Parameters:
        `A` - Matrix
        `x` - evaluation point
        `leftMat` - Matrix
        `rightMat` - Matrix
        `useUniformization` - true if the method to use is Uniformization, false if it is RungeKutta
      Returns:
        leftMat * exp(A x) * rightMat

    - #### exp

          public static no.uib.cipr.matrix.Matrix[] exp(no.uib.cipr.matrix.Matrix A,
                                        int n,
                                        double delta,
                                        no.uib.cipr.matrix.Matrix leftMat,
                                        no.uib.cipr.matrix.Matrix rightMat,
                                        boolean useUniformization)

      Computes leftMat * exp(A x) * rightMat, for all values x = 0 + i*delta, i=0,...,n. It uses the uniformization algorithm or the RungeKutta method
      Parameters:
        `A` - Matrix
        `n` - number of evaluation points
        `delta` - separation between evaluation points
        `leftMat` - Matrix
        `rightMat` - Matrix
        `useUniformization` - true if the method to use is Uniformization, false if it is RungeKutta
      Returns:
        leftMat * exp(A x) * rightMat, for x = 0 + i*delta, i=0,...,n

    - #### exp

          public static double[] exp(no.uib.cipr.matrix.Matrix A,
                     int n,
                     double delta,
                     no.uib.cipr.matrix.Vector leftVec,
                     no.uib.cipr.matrix.Vector rightVec,
                     boolean useUniformization)

      Returns leftVec * exp(A x) * rightVec, for all values x = 0 + i*delta, i=0,...,n. It uses the uniformization algorithm or the RungeKutta method
      Parameters:
        `A` - Matrix
        `n` - number of evaluation points
        `delta` - separation between evaluation points
        `leftVec` - Vector
        `rightVec` - Vector
        `useUniformization` - true if the method to use is Uniformization, false if it is RungeKutta
      Returns:
        leftVec * exp(A x) * rightVec

    - #### expRunge

          public static no.uib.cipr.matrix.Matrix[] expRunge(no.uib.cipr.matrix.Matrix A,
                                             int n,
                                             double delta,
                                             no.uib.cipr.matrix.Matrix leftMat,
                                             no.uib.cipr.matrix.Matrix rightMat)

      Computes leftMat * exp(A x) * rightMat, for all values x = 0 + i*delta, i=0,...,n. It uses the RungeKutta method
      Parameters:
        `A` - Matrix
        `n` - number of evaluation points
        `delta` - separation between evaluation points
        `leftMat` - Matrix
        `rightMat` - Matrix
      Returns:
        leftMat * exp(A x) * rightMat, for x = 0 + i*delta, i=0,...,n

    - #### expUnif

          public static no.uib.cipr.matrix.Matrix[] expUnif(no.uib.cipr.matrix.Matrix A,
                                            double x,
                                            no.uib.cipr.matrix.Matrix leftMat,
                                            no.uib.cipr.matrix.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
      Parameters:
        `A` - Matrix
        `x` - evaluation point
        `leftMat` - Matrix
        `rightMat` - Matrix
      Returns:
        leftMat * exp(A x) * rightMat

    - #### expUnif

          public static no.uib.cipr.matrix.Matrix[] expUnif(no.uib.cipr.matrix.Matrix A,
                                            int n,
                                            double delta,
                                            no.uib.cipr.matrix.Matrix leftMat,
                                            no.uib.cipr.matrix.Matrix rightMat)

      Computes leftMat * exp(A x) * rightMat, for all values x = 0 + i*delta, i=0,...,n. It uses the uniformization algorithm as described in page 60 of Latouche and Ramaswami
      Parameters:
        `A` - Matrix
        `n` - number of evaluation points
        `delta` - separation between evaluation points
        `leftMat` - Matrix
        `rightMat` - Matrix
      Returns:
        leftMat * exp(A x) * rightMat

    - #### expUnif

          public static double[] expUnif(no.uib.cipr.matrix.Matrix A,
                         int n,
                         double delta,
                         no.uib.cipr.matrix.Vector leftVec,
                         no.uib.cipr.matrix.Vector rightVec)

      Computes leftVec * exp(A x) * rightVec, for all values x = 0 + i*delta, i=0,...,n. It uses the uniformization algorithm as described in page 60 of Latouche and Ramaswami
      Parameters:
        `A` - Matrix
        `n` - number of evaluation points
        `delta` - separation between evaluation points
        `leftVec` - Vector
        `rightVec` - Vector
      Returns:
        leftVec * exp(A x) * rightVec

    - #### expUnif

          public static no.uib.cipr.matrix.Matrix[] expUnif(no.uib.cipr.matrix.Matrix A,
                                            double[] times,
                                            no.uib.cipr.matrix.Matrix leftMat,
                                            no.uib.cipr.matrix.Matrix rightMat)

      Computes leftMat * exp(A x) * rightMat, for all values x in times. It uses the uniformization algorithm
      Parameters:
        `A` - Matrix
        `times` - evaluation points
        `leftMat` - Matrix
        `rightMat` - Matrix
      Returns:
        leftMat * exp(A x) * rightMat

    - #### expUnif

          public static no.uib.cipr.matrix.Matrix[] expUnif(no.uib.cipr.matrix.Matrix A,
                                            int n,
                                            double delta,
                                            no.uib.cipr.matrix.Matrix leftMat,
                                            no.uib.cipr.matrix.Matrix rightMat,
                                            int truncate)

      Computes leftMat * exp(A x) * rightMat, for all values x = 0 + i*delta, i=0,...,n. It uses the uniformization algorithm
      Parameters:
        `A` - Matrix
        `n` - num of evaluation points
        `delta` - evaluation points separation
        `leftMat` - Matrix
        `rightMat` - Matrix
        `truncate` - upper bound for iterations
      Returns:
        leftMat * exp(A x) * rightMat

    - #### expUnif

          public static double[] expUnif(no.uib.cipr.matrix.Matrix A,
                         int n,
                         double delta,
                         no.uib.cipr.matrix.Vector leftVec,
                         no.uib.cipr.matrix.Vector rightVec,
                         int truncate)

      Computes leftVec * exp(A x) * rightVec, for all values x = 0 + i*delta, i=0,...,n. It uses the uniformization algorithm
      Parameters:
        `A` - Matrix
        `n` - num of evaluation points
        `delta` - evaluation points separation
        `leftVec` - Vector
        `rightVec` - Vector
        `truncate` - upper bound for iterations
      Returns:
        leftVec * exp(A x) * rightVec

    - #### expUnif

          public static no.uib.cipr.matrix.Matrix[] expUnif(no.uib.cipr.matrix.Matrix A,
                                            double[] times,
                                            no.uib.cipr.matrix.Matrix leftMat,
                                            no.uib.cipr.matrix.Matrix rightMat,
                                            int truncate)

      Computes leftMat * exp(A x) * rightMat, for all values x in times. It uses the uniformization algorithm
      Parameters:
        `A` - Matrix
        `times` - evaluation points
        `leftMat` - Matrix
        `rightMat` - Matrix
        `truncate` - upper bound for iterations
      Returns:
        leftMat * exp(A x) * rightMat

    - #### expUnif

          public static double[] expUnif(no.uib.cipr.matrix.Matrix A,
                         double[] times,
                         no.uib.cipr.matrix.Vector leftVec,
                         no.uib.cipr.matrix.Vector rightVec,
                         int truncate)

      Computes leftVec * exp(A x) * rightVec, for all values x in times. It uses the uniformization algorithm
      Parameters:
        `A` - Matrix
        `times` - evaluation points
        `leftVec` - Vector
        `rightVec` - Vector
        `truncate` - upper bound for iterations
      Returns:
        leftVec * exp(A x) * rightVec

    - #### average

          public static double average(double[] datos)

      Computes data average
      Parameters:
        `datos` -
      Returns:
        Data Average

    - #### average2

          public static double average2(double[] data)

      Computes the second moment of the data
      Parameters:
        `data` - data trace
      Returns:
        Second data trace moment

    - #### variance

          public static double variance(double[] data)

      Return the variance of the data
      Parameters:
        `data` - data trace
      Returns:
        Data Variance

    - #### CV

          public static double CV(double[] data)

      Return the Coefficient of Variation of the data trace
      Parameters:
        `data` - data trace
      Returns:
        Data Coefficient of Variation

    - #### concatCols

          public static no.uib.cipr.matrix.DenseMatrix concatCols(no.uib.cipr.matrix.DenseMatrix A,
                                                  no.uib.cipr.matrix.DenseMatrix B)

      Concatenates the columns of the matrices, keeping the same number of rows in dense format
      Parameters:
        `A` - DenseMatrix
        `B` - DenseMatrix
      Returns:
        Resulting matrix from cancatenation

    - #### concatCols

          public static no.uib.cipr.matrix.Matrix concatCols(no.uib.cipr.matrix.Matrix A,
                                             no.uib.cipr.matrix.Matrix B,
                                             no.uib.cipr.matrix.Matrix res)

      Concatenates the columns of the matrices, keeping the same number of rows in the predefined format
      Parameters:
        `A` - Matrix
        `B` - Matrix
        `res` - Resulting matrix
      Returns:
        Resulting matrix from cancatenation

    - #### concatRows

          public static no.uib.cipr.matrix.DenseMatrix concatRows(no.uib.cipr.matrix.DenseMatrix A,
                                                  no.uib.cipr.matrix.DenseMatrix B)

      Concatenates the rows of the matrices, keeping the same number of colums in dense format
      Parameters:
        `A` - DenseMatrix
        `B` - DenseMatrix
      Returns:
        Resulting matrix from cancatenation

    - #### concatRows

          public static no.uib.cipr.matrix.Matrix concatRows(no.uib.cipr.matrix.Matrix A,
                                             no.uib.cipr.matrix.Matrix B,
                                             no.uib.cipr.matrix.Matrix res)

      Concatenates the rows of the matrices, keeping the same number of colums in the predefined format
      Parameters:
        `A` - Matrix
        `B` - Matrix
        `res` - Resulting matrix
      Returns:
        Resulting matrix from cancatenation

    - #### concatQuad

          public static no.uib.cipr.matrix.Matrix concatQuad(no.uib.cipr.matrix.Matrix leftUp,
                                             no.uib.cipr.matrix.Matrix rightUp,
                                             no.uib.cipr.matrix.Matrix leftDown,
                                             no.uib.cipr.matrix.Matrix rightDown,
                                             no.uib.cipr.matrix.Matrix res)

      Concatenates the colums of the left and right upper matrices and the result is concatenated by rows with the concatenation of left and right lower matrices
      Parameters:
        `leftUp` - Left upper Matrix
        `rightUp` - Right upper Matrix
        `leftDown` - Left lower Matrix
        `rightDown` - Right lower matrix
        `res` - Resulting Matrix
      Returns:
        resulting matrix from concatenation

    - #### concatVectors

          public static no.uib.cipr.matrix.DenseVector concatVectors(no.uib.cipr.matrix.DenseVector A,
                                                     no.uib.cipr.matrix.DenseVector B)

      Concatenates the vectors in dense format
      Parameters:
        `A` - DenseVector
        `B` - DenseVector
      Returns:
        Resulting DenseVector from cancatenation

    - #### concatVectors

          public static no.uib.cipr.matrix.Vector concatVectors(no.uib.cipr.matrix.Vector A,
                                                no.uib.cipr.matrix.Vector B,
                                                no.uib.cipr.matrix.Vector res)

      Concatenates the vectors in the predefined format
      Parameters:
        `A` - Vector
        `B` - vector
        `res` - Resulting vector
      Returns:
        Resulting vectormatrix from cancatenation

    - #### multVector

          public static no.uib.cipr.matrix.Matrix multVector(no.uib.cipr.matrix.Vector A,
                                             no.uib.cipr.matrix.Vector B,
                                             no.uib.cipr.matrix.Matrix res)

      Computes the producto of two vectors A x B^T
      Parameters:
        `A` - Vector
        `B` - Vector
        `res` - Vector to store the resulting matrix
      Returns:
        res = A x B^T

    - #### matPower

          public static no.uib.cipr.matrix.Matrix matPower(no.uib.cipr.matrix.Matrix A,
                                           int k)

      Computes k power of the matrix A
      Parameters:
        `A` - matrix base
        `k` - exponent
      Returns:
        A^k

    - #### matPower

          public static double matPower(no.uib.cipr.matrix.Matrix A,
                        int k,
                        no.uib.cipr.matrix.Vector leftVec,
                        no.uib.cipr.matrix.Vector rightVec)

      Computes the kth power of the matrix A premultiplied by leftVec and postmultiplied by rightVec
      Parameters:
        `A` - Matrix base
        `k` - exponent
        `leftVec` - Vector
        `rightVec` - Vector
      Returns:
        leftVec * A^k * rightVec

    - #### sumMatPower

          public static double sumMatPower(no.uib.cipr.matrix.Matrix A,
                           int k,
                           no.uib.cipr.matrix.Vector leftVec,
                           no.uib.cipr.matrix.Vector rightVec)

      Computes the sum of the first k terms of the succesion T^(j-1), from j = 1
      Parameters:
        `A` - Matrix base
        `k` - maximum exponent
        `leftVec` -
        `rightVec` -
      Returns:
        leftVec * sum_(j=1)^k T^(j-1) * rightVec