Examples of EigenvalueDecomposition


Examples of Jama.EigenvalueDecomposition

        double[] m = {xx, xy, xz, xy, yy, yz, xz, yz, zz};

        Matrix matrix = new Matrix(m, 3);

        EigenvalueDecomposition ed = matrix.eig();

        double x1 = ed.getV().get(0, 2);
        double y1 = ed.getV().get(1, 2);
        double z1 = ed.getV().get(2, 2);

        double length = Math.sqrt(x1 * x1 + y1 * y1 + z1 * z1);
        x1 /= length;
        y1 /= length;
        z1 /= length;
View Full Code Here

Examples of Jama.EigenvalueDecomposition

    time = System.currentTimeMillis();

    //laplacianise(matrix);
   
   
    EigenvalueDecomposition evd = matrix.eig();
    System.out.println("evd in: " + (System.currentTimeMillis() - time));
    double [] evr = evd.getRealEigenvalues();   
    Matrix evm = evd.getV();

    int evnum = evr.length;

    for(int i=0;i<evr.length;i++) {
      if(evr[i] <= 1.0) {
View Full Code Here

Examples of Jama.EigenvalueDecomposition

    public static void singularDecomposition(SSAData data) {
        double inclosureMatrix[][] = data.getInclosureMatrix();
        double transp[][] = transpositionMatrix(inclosureMatrix);
        Matrix S = new Matrix(inclosureMatrix).times(new Matrix(transp));
        //int d = new Matrix(inclosureMatrix).rank(); //ранг матрицы вложений
        EigenvalueDecomposition decomposition = new EigenvalueDecomposition(S);
        Matrix eigenvalue = decomposition.getD();   //матрица с собственными значениями
        Matrix eigenvec = decomposition.getV();     //матрица собственных векторов
        List<Double> eigenvalueList = new ArrayList<Double>();
        //формируем набор собственных значений, стоящих на диагонали
        for (int i = 0; i < eigenvalue.getRowDimension(); i++) {
            for (int j = 0; j < eigenvalue.getRowDimension(); j++) {
                if (i == j) {
View Full Code Here

Examples of Jama.EigenvalueDecomposition

        } catch (java.lang.RuntimeException e) {
            errorCount = try_failure(errorCount,
                    "CholeskyDecomposition solve()...",
                    "incorrect Choleskydecomposition solve calculation");
        }
        EigenvalueDecomposition Eig = A.eig();
        Matrix D = Eig.getD();
        Matrix V = Eig.getV();

        try {
            check(A.times(V), V.times(D));
            try_success("EigenvalueDecomposition (symmetric)...", "");
        } catch (java.lang.RuntimeException e) {
            errorCount = try_failure(errorCount,
                    "EigenvalueDecomposition (symmetric)...",
                    "incorrect symmetric Eigenvalue decomposition calculation");
        }
        A = new Matrix(evals);
        Eig = A.eig();
        D = Eig.getD();
        V = Eig.getV();
        try {
            check(A.times(V), V.times(D));
            try_success("EigenvalueDecomposition (nonsymmetric)...", "");
        } catch (java.lang.RuntimeException e) {
            errorCount = try_failure(errorCount,
View Full Code Here

Examples of Jama.EigenvalueDecomposition

            int t = (int) M.trace();

            print(fixedWidthIntegertoString(t, 10));

            EigenvalueDecomposition E = new EigenvalueDecomposition(
                    M.plus(M.transpose()).times(0.5));
            double[] d = E.getRealEigenvalues();

            print(fixedWidthDoubletoString(d[n - 1], 14, 3));

            int r = M.rank();
View Full Code Here

Examples of Jama.EigenvalueDecomposition

   
    if (!isControllableCanonical(system)) {
      throw new IllegalArgumentException("System must be in controllable-canonical form");
    }
   
    EigenvalueDecomposition eig = new Matrix(MU.convert(system.getA(0f))).eig();
    double[] eigReal = eig.getRealEigenvalues();
   
    double slowest = eigReal[0];
    for (int i = 1; i < eig.getRealEigenvalues().length; i++) {
      if (Math.abs(eigReal[i]) < Math.abs(slowest)) slowest = eigReal[i];
    }
   
    //may be repeated / complex conjugate so change all slowest real eigenvalues
    for (int i = 0; i < eigReal.length; i++) {
      if (Math.abs(eigReal[i] - slowest) < .0001*Math.abs(slowest)) eigReal[i] = -1d / (double) tau;
    }
 
    //coefficients of new transfer function polynomial ... 
    double[] eigImag = eig.getImagEigenvalues();
    float[][] poly = new float[][]{new float[]{1f, (float) -eigReal[0]}, new float[]{0f, (float) -eigImag[0]}};
    for (int i = 1; i < eigReal.length; i++) {
      poly = prod(poly, new float[][]{new float[]{1f, (float) -eigReal[i]}, new float[]{0f, (float) -eigImag[i]}});
    }
   
View Full Code Here

Examples of cern.colt.matrix.linalg.EigenvalueDecomposition

    double[][] mN = MatrixMath.multiply(dataDifference,
        MatrixMath.transpose(dataDifference));
   
    // eigenvaluedecomosition from cern
    DenseDoubleMatrix2D d = new DenseDoubleMatrix2D(mN);
    EigenvalueDecomposition e = new EigenvalueDecomposition(d);
    double[] eigenValues = MatrixMath.diag(e.getD().toArray());
    double[][] eigenVectors = e.getV().viewDice().toArray();
   
    // sorting
    Vector<EigenPair> eigenPairs = new Vector<EigenPair>();
    for (int i = 0; i < eigenValues.length; i++) {
      EigenPair ep = new EigenPair(eigenValues[i], eigenVectors[i]);
View Full Code Here

Examples of cern.colt.matrix.linalg.EigenvalueDecomposition

        if (i != l - 1) {
          hessian.setQuick(i + 1, i, 1);
        }
      }
    }
    final double[] d = new EigenvalueDecomposition(hessian).getRealEigenvalues().toArray();
    final Double[] result = new Double[d.length];
    for (int i = 0; i < d.length; i++) {
      result[i] = d[i];
    }
    return result;
View Full Code Here

Examples of de.lmu.ifi.dbs.elki.math.linearalgebra.EigenvalueDecomposition

   * @param covarMatrix the matrix used for performing pca
   * @return PCA result
   */
  public PCAResult processCovarMatrix(Matrix covarMatrix) {
    // TODO: add support for a different implementation to do EVD?
    EigenvalueDecomposition evd = covarMatrix.eig();
    return processEVD(evd);
  }
View Full Code Here

Examples of de.lmu.ifi.dbs.elki.math.linearalgebra.EigenvalueDecomposition

   * @param covarMatrix the matrix used for performing PCA
   */
  @Override
  public PCAFilteredResult processCovarMatrix(Matrix covarMatrix) {
    // TODO: add support for a different implementation to do EVD?
    EigenvalueDecomposition evd = covarMatrix.eig();
    return processEVD(evd);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.