Package net.fec.openrq.util.linearalgebra.io

Examples of net.fec.openrq.util.linearalgebra.io.ByteVectorIterator.index()


        assertEquals("index 3", 3, it.index());

        assertTrue("hasNext 4", it.hasNext());
        it.next();
        assertEquals("get 4", 3, it.get());
        assertEquals("index 4", 4, it.index());

        assertTrue("hasNext 5", it.hasNext());
        it.next();
        assertEquals("get 5", 0, it.get());
        assertEquals("index 5", 5, it.index());
View Full Code Here


        assertEquals("index 4", 4, it.index());

        assertTrue("hasNext 5", it.hasNext());
        it.next();
        assertEquals("get 5", 0, it.get());
        assertEquals("index 5", 5, it.index());

        assertFalse(it.hasNext());
    }

    @Test
View Full Code Here

        ByteVectorIterator it = a.rowIterator(1);

        assertTrue("hasNext 0", it.hasNext());
        it.next();
        assertEquals("get 0", 1, it.get());
        assertEquals("index 0", 0, it.index());

        assertTrue("hasNext 1", it.hasNext());
        it.next();
        assertEquals("get 1", 2, it.get());
        assertEquals("index 1", 1, it.index());
View Full Code Here

        assertEquals("index 0", 0, it.index());

        assertTrue("hasNext 1", it.hasNext());
        it.next();
        assertEquals("get 1", 2, it.get());
        assertEquals("index 1", 1, it.index());

        assertTrue("hasNext 2", it.hasNext());
        it.next();
        assertEquals("get 2", 3, it.get());
        assertEquals("index 2", 2, it.index());
View Full Code Here

        assertEquals("index 1", 1, it.index());

        assertTrue("hasNext 2", it.hasNext());
        it.next();
        assertEquals("get 2", 3, it.get());
        assertEquals("index 2", 2, it.index());

        assertFalse(it.hasNext());
    }

    @Test
View Full Code Here

        ByteVectorIterator it = a.rowIterator(1, 0, 1);

        assertTrue("hasNext 0", it.hasNext());
        it.next();
        assertEquals("get 0", 1, it.get());
        assertEquals("index 0", 0, it.index());

        assertFalse(it.hasNext());
    }

    @Test
View Full Code Here

        ByteVector result = blank(factory);
        ByteVectorIterator it = iterator();

        while (it.hasNext()) {
            it.next();
            result.set(it.index(), aPlusB(it.get(), value));
        }

        return result;
    }
View Full Code Here

        if (value != 0) {
            ByteVectorIterator it = iterator();
            while (it.hasNext()) {
                it.next();
                result.set(it.index(), aTimesB(value, it.get()));
            }
        }

        return result;
    }
View Full Code Here

            byte acc = 0;

            ByteVectorIterator it = iterator();
            while (it.hasNext()) {
                it.next();
                final byte prod = aTimesB(it.get(), matrix.get(it.index(), j));
                acc = aPlusB(acc, prod);
            }

            result.set(j, acc);
        }
View Full Code Here

            byte acc = 0;

            ByteVectorIterator it = iterator(fromIndex, toIndex);
            while (it.hasNext()) {
                it.next();
                final byte prod = aTimesB(it.get(), matrix.get(it.index() - fromIndex, j));
                acc = aPlusB(acc, prod);
            }

            result.set(j, acc);
        }
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.