Examples of ByteVectorIterator


Examples of net.fec.openrq.util.linearalgebra.io.ByteVectorIterator

    @Override
    public void divideInPlace(byte value) {

        if (value != 1) {
            ByteVectorIterator it = nonZeroIterator();
            while (it.hasNext()) {
                it.next();
                it.set(aDividedByB(it.get(), value));
            }
        }
    }
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.io.ByteVectorIterator

    }

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

        ByteVectorIterator it = indexer.nonZeroIterator(b);
        // TODO: these.andAlsoAdd(those)
        // these.andAlsoSubtract(those);
        while (it.hasNext()) {
            it.next();
            a.update(it.index(), ByteVectors.asPlusFunction(it.get()));
        }
        return null;
    }
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.io.ByteVectorIterator

    }

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

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

Examples of net.fec.openrq.util.linearalgebra.io.ByteVectorIterator

    }

    @Override
    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()), it.get()));
        }
        return null;
    }
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.io.ByteVectorIterator

    }

    @Override
    public void clearRow(int i) {

        ByteVectorIterator it = rowIterator(i);
        while (it.hasNext()) {
            it.next();
            it.set((byte)0);
        }
    }
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.io.ByteVectorIterator

    }

    @Override
    public void clearColumn(int j) {

        ByteVectorIterator it = columnIterator(j);
        while (it.hasNext()) {
            it.next();
            it.set((byte)0);
        }
    }
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.io.ByteVectorIterator

        Indexables.checkIndexBounds(i, rows());
        ensureFactoryIsNotNull(factory);

        ByteVector result = factory.createVector(columns);

        ByteVectorIterator it = nonZeroRowIterator(i);
        while (it.hasNext()) {
            it.next();
            result.set(it.index(), it.get());
        }

        return result;
    }
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.io.ByteVectorIterator

        Indexables.checkFromToBounds(fromColumn, toColumn, columns());
        ensureFactoryIsNotNull(factory);

        ByteVector result = factory.createVector(toColumn - fromColumn);

        ByteVectorIterator it = nonZeroRowIterator(i, fromColumn, toColumn);
        while (it.hasNext()) {
            it.next();
            result.set(it.index() - fromColumn, it.get());
        }

        return result;
    }
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.io.ByteVectorIterator

        Indexables.checkIndexBounds(j, columns());
        ensureFactoryIsNotNull(factory);

        ByteVector result = factory.createVector(rows);

        ByteVectorIterator it = nonZeroColumnIterator(j);
        while (it.hasNext()) {
            it.next();
            result.set(it.index(), it.get());
        }

        return result;
    }
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.io.ByteVectorIterator

        Indexables.checkFromToBounds(fromRow, toRow, rows());
        ensureFactoryIsNotNull(factory);

        ByteVector result = factory.createVector(toRow - fromRow);

        ByteVectorIterator it = nonZeroColumnIterator(j, fromRow, toRow);
        while (it.hasNext()) {
            it.next();
            result.set(it.index() - fromRow, it.get());
        }

        return result;
    }
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.