Package net.fec.openrq.util.linearalgebra.matrix

Examples of net.fec.openrq.util.linearalgebra.matrix.ByteMatrix.rows()


    @Test
    public void testCreateConstantMatrix_2x5() {

        ByteMatrix a = factory().createConstantMatrix(2, 5, (byte)20);

        assertEquals(2, a.rows());
        assertEquals(5, a.columns());

        for (int i = 0; i < a.rows(); i++) {
            for (int j = 0; j < a.columns(); j++) {
                assertEquals(20, a.get(i, j));
View Full Code Here


        ByteMatrix a = factory().createConstantMatrix(2, 5, (byte)20);

        assertEquals(2, a.rows());
        assertEquals(5, a.columns());

        for (int i = 0; i < a.rows(); i++) {
            for (int j = 0; j < a.columns(); j++) {
                assertEquals(20, a.get(i, j));
            }
        }
    }
View Full Code Here

    @Test
    public void testCreateConstantMatrix_4x1() {

        ByteMatrix a = factory().createConstantMatrix(4, 1, (byte)30);

        assertEquals(4, a.rows());
        assertEquals(1, a.columns());

        for (int i = 0; i < a.rows(); i++) {
            for (int j = 0; j < a.columns(); j++) {
                assertEquals(a.get(i, j), 30);
View Full Code Here

        ByteMatrix a = factory().createConstantMatrix(4, 1, (byte)30);

        assertEquals(4, a.rows());
        assertEquals(1, a.columns());

        for (int i = 0; i < a.rows(); i++) {
            for (int j = 0; j < a.columns(); j++) {
                assertEquals(a.get(i, j), 30);
            }
        }
    }
View Full Code Here

    @Test
    public void testCreateRandomSymmetricMatrix() {

        ByteMatrix a = factory().createRandomSymmetricMatrix(5);

        for (int i = 0; i < a.rows(); i++) {
            for (int j = i; j < a.columns(); j++) {
                assertEquals(a.get(i, j), a.get(j, i));
            }
        }
    }
View Full Code Here

    @Test
    public void testCreateIdentityMatrix() {

        ByteMatrix a = factory().createIdentityMatrix(3);

        assertEquals(3, a.rows());
        assertEquals(3, a.columns());

        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                if (i == j) {
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.