Package edu.berkeley.spectralHMM.matrix

Examples of edu.berkeley.spectralHMM.matrix.EigenSystem


    if (eigenFunction != null)  {
      return eigenFunction;
    }
   
    // if eigenfunction not found in the cache, check if the eigensystem for the w coefficients was solved earlier
    EigenSystem eigenSystem = findEigenSystem (metaArgs);
   
    assert (matrixCutoff == eigenSystem.eigenVectors.length);
   
    // eigensystem exists, now compute the eigenfunction using it
    eigenFunction = BigDecimal.ZERO.setScale(mc.getPrecision());
View Full Code Here


    BigDecimal squaredEigenLength = t.get(n);
    if (squaredEigenLength != null)  {
      return squaredEigenLength ;
    }
   
    EigenSystem eigenSystem = findEigenSystem(metaArgs);
   
    assert(matrixCutoff == eigenSystem.eigenVectors.length);
   
    squaredEigenLength = BigDecimal.ZERO;
    // TODO Should this be summing till maxM?
View Full Code Here

  public static BigDecimal getC (BigDecimal alpha, BigDecimal beta, BigDecimal hetF, BigDecimal homF, int matrixCutoff, int maxM, MathContext mc) throws EigenRefineException, EigenRefineError {
   
    // get the eigensystem
    // TODO we don't need maxM for this eigensystem actually
    EigenfunctionMetaArguments metaArgs = new EigenfunctionMetaArguments (alpha, beta, hetF, homF, matrixCutoff, maxM, mc);
    EigenSystem theSystem = findEigenSystem (metaArgs);
   
    // initialize return value
    BigDecimal result = BigDecimal.ZERO;
    // initialize the running value of the "multinomial"
    BigDecimal multi = BigDecimal.ONE;
View Full Code Here

        return mp.getValue();
      }
    }

    // eigensystem not already solved, so do it now
    EigenSystem eigenSystem;

    // first let us create a coefficient matrix
    // for solving the system appropriately later (especially making 0 an eigenvalue), we need some extra precision
    int extraPrecision = Math.max(0, (int)(3. * Math.log10(1. * metaArgs.matrixCutoff / 100.) + 1)) + 5;
    System.out.println("# Old precision = " + metaArgs.mc.getPrecision());
View Full Code Here

    return eigenSystem;
  }
 
  public static BigDecimal getEigenValue(BigDecimal alpha, BigDecimal beta, BigDecimal hetF, BigDecimal homF, int matrixCutoff, int maxM, int n, MathContext mc) throws EigenRefineException, EigenRefineError {
    EigenfunctionMetaArguments metaArgs = new EigenfunctionMetaArguments(alpha, beta, hetF, homF, matrixCutoff, maxM, mc);
    EigenSystem eigenSystem = findEigenSystem(metaArgs);

    return eigenSystem.eigenValues[n];
  }
View Full Code Here

    return eigenSystem.eigenValues[n];
  }

  public static BigDecimal getEigenVectorEntry(BigDecimal alpha, BigDecimal beta, BigDecimal hetF, BigDecimal homF, int matrixCutoff, int maxM, int n, int m, MathContext mc) throws EigenRefineException, EigenRefineError {
    EigenfunctionMetaArguments metaArgs = new EigenfunctionMetaArguments(alpha, beta, hetF, homF, matrixCutoff, maxM, mc);
    EigenSystem eigenSystem = findEigenSystem(metaArgs);
   
    return eigenSystem.eigenVectors[n][m];
  }
View Full Code Here

    return eigenSystem.eigenVectors[n][m];
  }
 
  public static BigDecimal[] getEigenVectorCopy(BigDecimal alpha, BigDecimal beta, BigDecimal hetF, BigDecimal homF, int matrixCutoff, int maxM, int n, MathContext mc) throws EigenRefineException, EigenRefineError {
    EigenfunctionMetaArguments metaArgs = new EigenfunctionMetaArguments(alpha, beta, hetF, homF, matrixCutoff, maxM, mc);
    EigenSystem eigenSystem = findEigenSystem(metaArgs);
   
    return Arrays.copyOf (eigenSystem.eigenVectors[n], eigenSystem.eigenVectors[n].length);
  }
View Full Code Here

  }

  public static BigDecimal[][] getEigenVectorMatrixCopy(BigDecimal alpha, BigDecimal beta, BigDecimal hetF, BigDecimal homF, int matrixCutoff, int numRows, int numCols, MathContext mc) throws EigenRefineException, EigenRefineError {
    // maxM is numCols-1
    EigenfunctionMetaArguments metaArgs = new EigenfunctionMetaArguments(alpha, beta, hetF, homF, matrixCutoff, numCols-1, mc);
    EigenSystem eigenSystem = findEigenSystem(metaArgs);
   
    BigDecimal[][] result = new BigDecimal[numRows][numCols];
    for (int i=0; i<numRows; i++) {
      for (int j=0; j<numCols; j++)  {
        result[i][j] = eigenSystem.eigenVectors[i][j];
View Full Code Here

    if (eigenFunctionDerivative != null)  {
      return eigenFunctionDerivative;
    }
   
    // if eigenfunction not found in the cache, check if the eigensystem for the w coefficients was solved earlier
    EigenSystem eigenSystem = findEigenSystem (metaArgs);
   
    assert (matrixCutoff == eigenSystem.eigenVectors.length);
   
    // gets a bit more complicated due to product rule
   
View Full Code Here

TOP

Related Classes of edu.berkeley.spectralHMM.matrix.EigenSystem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.