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

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


    public Void apply(DenseByteVector a, SparseByteVector b) {

        ByteVectorIterator it = b.nonZeroIterator();
        while (it.hasNext()) {
            it.next();
            a.set(it.index(), aMinusB(a.get(it.index()), it.get()));
        }
        return null;
    }
}
View Full Code Here


        ByteVectorIterator it = indexer.nonZeroIterator(b);
        // TODO: these.andAlsoAdd(those)
        // these.andAlsoSubtract(those);
        while (it.hasNext()) {
            it.next();
            a.addInPlace(it.index(), multB(it.get()));
        }
        return null;
    }

    @Override
View Full Code Here

    @Override
    public Void apply(SparseByteVector a, DenseByteVector b) {

        ByteVectorIterator it = indexer.iterator(a);
        while (it.hasNext()) {
            it.set(aPlusB(it.get(), multB(b.get(it.index()))));
        }
        return null;
    }

    @Override
View Full Code Here

    public Void apply(DenseByteVector a, SparseByteVector b) {

        ByteVectorIterator it = indexer.nonZeroIterator(b);
        while (it.hasNext()) {
            it.next();
            a.set(it.index(), aPlusB(a.get(it.index()), multB(it.get())));
        }
        return null;
    }

    private byte multB(byte bValue) {
View Full Code Here

    public Void apply(DenseByteVector a, SparseByteVector b) {

        ByteVectorIterator it = indexer.nonZeroIterator(b);
        while (it.hasNext()) {
            it.next();
            a.set(it.index(), aPlusB(a.get(it.index()), multB(it.get())));
        }
        return null;
    }

    private byte multB(byte bValue) {
View Full Code Here

                ByteVectorIterator it = A.nonZeroRowIterator(row, 0, L - u);
                while (it.hasNext()) {
                    it.next();
                    originalDegree += OctetOps.UNSIGN(it.get()); // add to the degree of this row
                    nodes.add(it.index()); // add the column index to the nodes
                }

                rows.put(row, new Row(row, nonZeros, originalDegree, isHDPC, nodes));
            }
            else {
View Full Code Here

                else {
                    final Set<Integer> nodes = new HashSet<>(2 + 1, 1.0f); // we know there will only be two non zeros
                    ByteVectorIterator it = A.nonZeroRowIterator(row.position, i, L - u);
                    while (it.hasNext()) {
                        it.next();
                        nodes.add(it.index()); // add node to this edge (column index)
                    }

                    row.nodes = nodes;
                }
            }
View Full Code Here

            ByteVectorIterator it = A.nonZeroRowIterator(row, i, L);
            while (it.hasNext()) {
                it.next();

                // "if the row has a nonzero entry at position j"
                final int j = it.index();
                // "if the value of that nonzero entry is b"
                final byte b = it.get();

                // "add to this row b times row j of I_u" -- this would "zerofy"
                // that position, thus we can save the complexity
View Full Code Here

            ByteVectorIterator it = A.nonZeroRowIterator(j, 0, j);
            while (it.hasNext()) {
                it.next();

                // "then add A[j,eL] multiplied with row eL of A to row j of A."
                final int eL = it.index();
                beta = it.get();

                // We do not actually have to perform this operation on the matrix A
                // because it will not be used again.
                // A.addRowsInPlace(beta, eL, j);
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

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.