Package Jama

Examples of Jama.Matrix.times()


        return new Dimension( dcRaw.getImageWidth(), dcRaw.getImageHeight() );
    }

    static Matrix pseudoinverse(Matrix m) {
        Matrix t = m.transpose();
        return t.times(m).inverse().times(t).transpose();
    }

    // specialized to 3 x 3 so we can use the real inverse matrix instead of a pseudoinverse
    // some day we should go back to the more generic 3 x 4 case
    static void cam_xyz_coeff(float cam_xyz[][], float rgb_cam[][], float pre_mul[]) {
View Full Code Here


            {0, sXYZ[1] / tXYZ[1], 0},
            {0, 0, sXYZ[2] / tXYZ[2]}
        };

        // total tansform
        return B.times(new Matrix(diag)).times(B.inverse()).getArrayFloat();
    }

    public static double saturation(double r, double g, double b) {
        double min = Math.min(r, Math.min(g, b));
        double max = Math.max(r, Math.max(g, b));
View Full Code Here

        for (int t = 1000; t < 40000; t+= (0.001 * t)) {
            Matrix B = new Matrix(chromaticAdaptation(t, refT, caMethod));
            Matrix combo = XYZtoRGB.times(B.times(RGBtoZYX));

            gray = combo.times(gray);

            double r = clip(gray.get(0, 0));
            double g = clip(gray.get(1, 0));
            double b = clip(gray.get(2, 0));

View Full Code Here

        double avg;
        double K = data.getTimeSeries().size() - data.getL() + 1; //количество векторов вложения
        List<Double> covarianceList = new ArrayList<Double>();
        double transp[][] = transpositionMatrix(data.getInclosureMatrix());
        Matrix S = new Matrix(data.getInclosureMatrix()).times(new Matrix(transp));
        S = S.times(1.0 / K); //ковариационная матрица
        int size = S.getColumnDimension();
        int N = size + size - 1;
        int n;
        for (int k = 0; k < N; k++) {
            if ((k % 2) == 0) {
View Full Code Here

     
     
      for(int i=0;i<this.iterations;i++)
      {
        tkplus1Matrix = trans.times(tkMatrix);
        tkplus1Matrix = tkplus1Matrix.times(1-a);
        tkplus1Matrix = tkplus1Matrix.plus(pMatrix.times(a));
        tkMatrix = new Matrix(tkplus1Matrix.getArrayCopy());
        //System.out.println(printMatrix(tkplus1Matrix.getArray()));
        //System.out.println("row=" + tkplus1Matrix.getRowDimension() + " column="+tkplus1Matrix.getColumnDimension());
      }
View Full Code Here

                }
                if( iii != jjj ) { randSigma[iii][jjj] = 0.0; } // Sigma is a symmetric, positive-definite matrix created by taking a lower diagonal matrix and multiplying it by its transpose
            }
        }
        Matrix tmp = new Matrix( randSigma );
        tmp = tmp.times(tmp.transpose());
        sigma.setMatrix(0, mu.length - 1, 0, mu.length - 1, tmp);
    }

    public double calculateDistanceFromMeanSquared( final VariantDatum datum ) {
        return MathUtils.distanceSquared( datum.annotations, mu );
View Full Code Here

            errorCount = try_failure(errorCount, "det()...",
                    "incorrect determinant calculation");
        }
        SQ = new Matrix(square);
        try {
            check(A.times(A.transpose()), SQ);
            try_success("times(Matrix)...", "");
        } catch (java.lang.RuntimeException e) {
            errorCount = try_failure(errorCount, "times(Matrix)...",
                    "incorrect Matrix-Matrix product calculation");
        }
View Full Code Here

        } catch (java.lang.RuntimeException e) {
            errorCount = try_failure(errorCount, "times(Matrix)...",
                    "incorrect Matrix-Matrix product calculation");
        }
        try {
            check(A.times(0.), Z);
            try_success("times(double)...", "");
        } catch (java.lang.RuntimeException e) {
            errorCount = try_failure(errorCount, "times(double)...",
                    "incorrect Matrix-scalar product calculation");
        }
View Full Code Here

            errorCount = try_failure(errorCount, "LUDecomposition...",
                    "incorrect LU decomposition calculation");
        }
        X = A.inverse();
        try {
            check(A.times(X), Matrix.identity(3, 3));
            try_success("inverse()...", "");
        } catch (java.lang.RuntimeException e) {
            errorCount = try_failure(errorCount, "inverse()...",
                    "incorrect inverse calculation");
        }
View Full Code Here

        A = new Matrix(pvals);
        CholeskyDecomposition Chol = A.chol();
        Matrix L = Chol.getL();

        try {
            check(A, L.times(L.transpose()));
            try_success("CholeskyDecomposition...", "");
        } catch (java.lang.RuntimeException e) {
            errorCount = try_failure(errorCount, "CholeskyDecomposition...",
                    "incorrect Cholesky decomposition calculation");
        }
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.