Package mikera.matrixx

Examples of mikera.matrixx.AMatrix.asDoubleArray()


    @Test
    public void testSolveSquareMatrix() {
        AMatrix m= Matrix.create(new double[][] {{1,2,2},{1,4,1},{5,9,2}});
       
        AMatrix x = Linear.solveLeastSquares(m, Matrix.create(new double[][]{{1},{3},{3}}));
        assertArrayEquals(new double[] {-1.35294117647,1.05882352941,0.11764705882},x.asDoubleArray(), 1e-8);
    }
   
    @Test(expected=IllegalArgumentException.class)
    public void testSolveSquareMatrixRectangular() {
        AMatrix m= Matrix.create(new double[][] {{1,2},{1,4},{5,9}});
View Full Code Here


    private boolean extractTogether() {
        // extract the orthogonal from the similar transform
//        V = decomp.getQ(V,true);
        AMatrix temp = decomp.getQ(true);
        V = Matrix.wrap(temp.rowCount(), temp.columnCount(), temp.asDoubleArray());

        // tell eigenvector algorithm to update this matrix as it computes the rotators
        helper.setQ(V);

        vector.setFastEigenvalues(false);
View Full Code Here

        offSaved = helper.swapOff(offSaved);

        // extract the orthogonal from the similar transform
//        V = decomp.getQ(V,true);
        AMatrix temp = decomp.getQ(true);
        V = Matrix.wrap(temp.rowCount(), temp.columnCount(), temp.asDoubleArray());

        // tell eigenvector algorithm to update this matrix as it computes the rotators
        vector.setQ(V);

        // extract eigenvectors
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.