Package net.fec.openrq.util.linearalgebra.vector

Examples of net.fec.openrq.util.linearalgebra.vector.ByteVector


    @Test
    public void testSetColumn_InRangeOf_0_to_2() {

        ByteMatrix a = factory().createMatrix(new byte[][] { {0}, {0}, {0}, {0}});
        ByteMatrix b = factory().createMatrix(new byte[][] { {1}, {2}, {0}, {0}});
        ByteVector vector = factory().createVector(new byte[] {1, 2, 3, 4});

        a.setColumn(0, 0, vector, 0, 2);

        assertEquals(a, b);
    }
View Full Code Here


    @Test
    public void testSetColumn_InRangeOf_0_to_4() {

        ByteMatrix a = factory().createMatrix(new byte[][] { {0}, {0}, {0}, {0}});
        ByteMatrix b = factory().createMatrix(new byte[][] { {1}, {2}, {3}, {4}});
        ByteVector vector = factory().createVector(new byte[] {1, 2, 3, 4});

        a.setColumn(0, 0, vector, 0, 4);

        assertEquals(a, b);
    }
View Full Code Here

    @Test
    public void testSetColumn_InRangeOf_2_to_2() {

        ByteMatrix a = factory().createMatrix(new byte[][] { {0}, {0}, {0}, {0}});
        ByteMatrix b = factory().createMatrix(new byte[][] { {0}, {0}, {0}, {0}});
        ByteVector vector = factory().createVector(new byte[] {1, 2, 3, 4});

        a.setColumn(0, 0, vector, 2, 0); // yes, 0 is the length

        assertEquals(a, b);
    }
View Full Code Here

    @Test
    public void testSetColumn_InRangeOf_2_to_4() {

        ByteMatrix a = factory().createMatrix(new byte[][] { {0}, {0}, {0}, {0}});
        ByteMatrix b = factory().createMatrix(new byte[][] { {0}, {0}, {3}, {4}});
        ByteVector vector = factory().createVector(new byte[] {1, 2, 3, 4});

        a.setColumn(0, 2, vector, 2, 2); // yes, the second 2 is the length

        assertEquals(a, b);
    }
View Full Code Here

    @Test
    public void testSetColumn_InRangeOf_4_to_4() {

        ByteMatrix a = factory().createMatrix(new byte[][] { {0}, {0}, {0}, {0}});
        ByteMatrix b = factory().createMatrix(new byte[][] { {0}, {0}, {0}, {0}});
        ByteVector vector = factory().createVector(new byte[] {1, 2, 3, 4});

        a.setColumn(0, 4, vector, 4, 0); // yes, 0 is the length

        assertEquals(a, b);
    }
View Full Code Here

        ByteMatrix a = factory().createMatrix(new byte[][] {
                                                            {1, 0, 3},
                                                            {0, 5, 0}
        });

        ByteVector b = factory().createVector(new byte[] {10, 0, 30});

        ByteVector c = factory().createVector(new byte[] {40, 0});

        // products are done over GF(2^8)
        // adds are XORs
        assertEquals(c, a.multiply(b));
    }
View Full Code Here

                                                            {7, 0},
                                                            {3, 0},
                                                            {0, 1}
        });

        ByteVector b = factory().createVector(new byte[] {0, 10});

        ByteVector c = factory().createVector(new byte[] {0, 34, 0, 0, 10});

        assertEquals(c, a.multiply(b));
    }
View Full Code Here

                                                            {3},
                                                            {0},
                                                            {3},
                                                            {0}
        });
        ByteVector c = factory().createVector(new byte[] {5});

        assertEquals(c, a.multiplyRow(0, b));
    }
View Full Code Here

    @Test
    public void testMultiply_5_0x0_InRangeOf_0_to_0() {

        ByteMatrix a = factory().createMatrix(new byte[][] {{0, 1, 0, 2, 1}});
        ByteMatrix b = factory().createMatrix(new byte[][] {});
        ByteVector c = factory().createVector(new byte[] {});

        assertEquals(c, a.multiplyRow(0, b, 0, 0));
    }
View Full Code Here

        ByteMatrix b = factory().createMatrix(new byte[][] {
                                                            {1},
                                                            {3},
                                                            {0}
        });
        ByteVector c = factory().createVector(new byte[] {3});

        assertEquals(c, a.multiplyRow(0, b, 0, 3));
    }
View Full Code Here

TOP

Related Classes of net.fec.openrq.util.linearalgebra.vector.ByteVector

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.