Package org.apache.mahout.math.matrix.impl

Examples of org.apache.mahout.math.matrix.impl.DenseDoubleMatrix2D.assign()


    @Test
    public void testMaxSparseness()
    {
        final DoubleMatrix2D sparse = new DenseDoubleMatrix2D(2, 2);
        sparse.assign(3);
        assertThat(MatrixUtils.computeSparseness(sparse)).isEqualTo(1);
    }

    @Test
    public void frobeniusNorm()
View Full Code Here


            // Update V
            U.zMult(U, T, 1, 0, true, false); // T <- U'U
            A.zMult(U, VT1, 1, 0, true, false); // VT1 <- A'U
            V.zMult(T, VT2, 1, 0, false, false); // VT2 <- VT
            VT1.assign(plusEps); // TODO: shift this to the dividing function?
            VT2.assign(plusEps);
            VT1.assign(VT2, Functions.DIV); // VT1 <- VT1 ./ VT2
            V.assign(VT1, Functions.MULT); // V <- V .* VT1

            // Update U
            V.zMult(V, T, 1, 0, true, false); // T <- V'V
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.