Package Jama

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


    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

    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

        } 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

            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

   
    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

TOP

Related Classes of Jama.EigenvalueDecomposition

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.